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.
Key Features
-
Upload Notes or PDFs: Extracts text automatically from uploaded files.
-
Smart Summarization: Summarizes your notes into clear, concise bullet points.
-
Flashcard Generator: Converts text into 10 ready-to-use question-answer flashcards.
-
Q&A Mode: Allows you to ask specific questions based on your uploaded material.
-
Quiz Creator: Generates multiple-choice quizzes with correct answer markings.
-
Swagger API UI: View and test endpoints interactively.
- 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)
Follow these steps to run the project locally.
git clone https://github.com/yourusername/ai-study-assistant.git
cd ai-study-assistant
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
Create a .env file in the backend directory:
OPENROUTER_API_KEY=your_api_key_here
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.
Open index.html using Live Server (VS Code extension).
This will connect your frontend interface to the running FastAPI backend.
| 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 |
- 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).





