Skip to content

tanishapritha/study-mate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Study Assistant

An AI-powered backend built with FastAPI that helps students summarize study materials, generate flashcards, answer questions, and create quizzes — all from uploaded notes or PDFs.

This backend integrates with OpenRouter (GPT-4.1-mini) to provide accurate and concise learning assistance.


Project Overview

Key Features

  • Upload Notes or PDFs: Extracts text automatically from uploaded files.

  • Upload Screen

  • Smart Summarization: Summarizes your notes into clear, concise bullet points.

  • Summary

  • Flashcard Generator: Converts text into 10 ready-to-use question-answer flashcards.

  • Flashcards

  • Q&A Mode: Allows you to ask specific questions based on your uploaded material.

  • Q&A

  • Quiz Creator: Generates multiple-choice quizzes with correct answer markings.

  • Quiz

  • Swagger API UI: View and test endpoints interactively.

  • Swagger


Tech Stack

  • Backend: FastAPI
  • AI Model: OpenRouter GPT-4.1-mini
  • File Processing: pdfplumber
  • Environment Management: python-dotenv
  • Frontend: Simple HTML/JS interface (optional, via Live Server)

Setup Instructions

Follow these steps to run the project locally.

1. Clone the Repository

git clone https://github.com/yourusername/ai-study-assistant.git
cd ai-study-assistant

2. Navigate to the Backend

cd backend

3. Create a Virtual Environment

python -m venv venv

4. Activate the Virtual Environment

venv\Scripts\activate

5. Install Dependencies

pip install -r requirements.txt

6. Add Your OpenRouter API Key

Create a .env file in the backend directory:

OPENROUTER_API_KEY=your_api_key_here

7. Local Setup

uvicorn main:app --reload

Open your browser and visit:

http://127.0.0.1:8000/docs

You’ll find the interactive Swagger UI to test all endpoints.


Frontend Setup

Open index.html using Live Server (VS Code extension).
This will connect your frontend interface to the running FastAPI backend.


API Endpoints

Endpoint Method Description
/summary POST Generate a 5-point summary from text or PDF
/flashcards POST Create 10 flashcards in Q&A format
/qa POST Answer a question based on given text
/quiz POST Generate 5 multiple-choice quiz questions

Notes

  • Ensure your OpenRouter API key has valid credits and access.
  • Large PDFs may take longer to process.
  • All endpoints accept either text input or file upload (PDF/TXT).

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published