Students often struggle to grasp difficult topics or summarize lengthy notes.
SGPA is an AI-powered web app that acts as a personal academic assistant, capable of:
- π§© Explaining complex concepts in simple terms
- π Summarizing notes or uploaded PDFs
- β Generating quizzes, solving exam questions, and evaluating answers
Combines Streamlit for UI and Gemini 2.5 Flash API for fast, intelligent AI responses β all in a clean chat-based interface.
Recent updates (v1.2.0):
- Explainer now suggests simple sketchable diagrams for visual understanding.
- Summarizer handles very short or scanned PDFs more safely with clearer warnings.
- Added lightweight, privacy-friendly usage analytics (anonymous sessions and mode usage).
A lightweight Streamlit frontend interacts with Google Gemini 2.5 Flash backend via secure API calls.
All secrets managed safely via .env and st.secrets.
| Mode | Function | Example |
|---|---|---|
| π§ Explainer | Simplifies academic concepts | βExplain Deadlock in OSβ |
| π Summarizer | Condenses notes or PDFs | Upload 20-page PDF β summary |
| π§© Quizzer | Quiz generator, solver, evaluator (multi-mode workflow) | MCQs, solve/evaluate Q&As |
Other Features:
- π PDF upload (PyPDF2 extraction, with guards for very short/empty text)
- π Lightweight usage logging for sessions and mode usage (CSV-based, privacy-friendly)
- π¬ Real-time chat interface
- π New chat/reset option
- βοΈ Deployed on Streamlit Cloud
- π Generate Questions
Enter a topic/chapter/passage. Get a variety of questions (MCQ, T/F, fill-in, descriptive) β answers listed together as an answer key for self-testing. - π Solve Questions
Paste your exam questions (optionally add word limits or marks). Get concise, exam-ready answers formatted per input. - β
Evaluate Answers
Submit questions and your answers (with '---' separator, or sequential prompts). Get detailed feedback, correction, and scoring.
SGPA/
βββ main.py
βββ requirements.txt
βββ assets/
β βββ PROBLEM STATEMENTS.pdf
βββ components/
β βββ chat_ui.py
β βββ pdf_handler.py
β βββ sidebar.py
βββ core/
β βββ ai_utils.py
β βββ explainer.py
β βββ pdf_handler.py
β βββ quizzer.py
β βββ summarizer.py
βββ utils/
βββ gemini_helper.py
Β©οΈπΌοΈ Diagram Credits: https://gitdiagram.com/
You can keep the PDF as the detailed reference and mirror a concise, in-README guide here.
- Open the deployed app:
https://sgpai-study-buddy.streamlit.app/ - Select a mode from the sidebar: Explainer, Summarizer, or Quizzer
- Provide input (topic, notes, PDF, or questions) in the main chat area
-
Explainer:
Type your concept or question (e.g., βExplain paging in OS for examsβ).
SGPA returns a simple, exam-oriented explanation, plus an idea for a quick diagram you can sketch. -
Summarizer:
Upload a PDF or paste notes.
SGPA returns an exam-ready summary with headings, bullets, and practice questions. -
Quizzer:
- Use βGenerate Questionsβ for practice questions with an answer key.
- Use βSolve Questionsβ to get answers to your questions.
- Use βEvaluate Answersβ to paste both question and your answer to receive feedback and scoring.
- Mention exam context (e.g., βfor B.Tech 3rd sem OS vivaβ) for sharper responses.
- Use follow-up prompts in the same chat to refine or extend answers.
- Reset the chat using the βNew Chatβ / reset option before switching topics heavily.
For full details, screenshots, and troubleshooting, refer to the PDF:
| Category | Technologies |
|---|---|
| Frontend | Streamlit |
| Backend / AI | Google Gemini 2.5 Flash API |
| Language | Python |
| Libraries | PyPDF2, google-generativeai, streamlit, dotenv |
| Deployment | Streamlit Community Cloud |
| Security | .env + st.secrets key handling |
- π― Simple, modern, and interactive chat-based UI
- π Smart summarization, quiz generation, and answer evaluation
- β‘ Fast, context-aware AI with Gemini 2.5 Flash
- π§© Smooth multi-mode workflow for study and revision
- π£οΈ Speech-to-text / text-to-speech interaction
- π Multi-language explanations
- π§ Flashcard & spaced-repetition support
- π€ Memory-based user personalization
- βοΈ Drive/Notion integration for notes & sessions
π§© βIntegrating AI with Education β Making Learning Simpler, Smarter, and Accessible for All.β
- You are welcome to fork this repository to learn from it or build your own version of SGPA.
- If you deploy this project publicly or create a derivative version:
- Keep the existing license file.
- Credit βSGPA by Ammaar Ahmad Khan (GPA95)β.
- Include a link back to the original repo:
For contributions, please see CONTRIBUTING.md for guidelines on forking, branching, and opening pull requests.
Ammaar Ahmad Khan
- GitHub: @GPA95
π If you find this repository useful, please give it a star! π
