How sam-se23/se201-project works
AI Study Buddy lets students ingest course PDFs/PPTX, ask citation-grounded questions, compare answers with exact-text Ctrl+F, and generate and review quizzes. The Gradio UI delegates actions to a backend orchestrator, which coordinates retrieval, QA, quiz, logging, and document management. Retrieval combines document parsing and chunking with vector and BM25 search. The README documents major behaviors not fully visible in the excerpts; those links are cited to it, while internal links are limited to shown references and calls.
Main entry points: orchestrator.py Orchestrator · components.py UI actions · __init__.py Retriever adapter · retrieve.py Hybrid retrieval
Components 23
Student interface
- Gradio app
frontend/app.py - UI actions
frontend/components.py - Result formatting
frontend/formatting.py
Backend coordination
- Orchestrator
backend/orchestrator.py - Upload management
backend/files.py
Document retrieval
- Retriever adapter
backend/retrieval/__init__.py - PDF/PPTX ingestion
backend/retrieval/rag-pipeline/pipeline/ingest.py - Chunking and sanitizing
backend/retrieval/rag-pipeline/pipeline/chunk.py - Query embeddings
backend/retrieval/rag-pipeline/pipeline/embed.py - Vector index
backend/retrieval/rag-pipeline/pipeline/store.py - BM25 index
backend/retrieval/rag-pipeline/pipeline/bm25.py - Hybrid retrieval
backend/retrieval/rag-pipeline/pipeline/retrieve.py
Learning engines
- Grounded Q&A
backend/qa/components.py - QA prompts and citations
backend/qa/qa_prompts.py - Quiz generation and grading
backend/quiz/__init__.py
Shared services
- LLM client
backend/llm/__init__.py - Ctrl+F baseline
backend/baseline/ctrl_f.py - AI interaction log
backend/disclosure_log.py - Runtime configuration
backend/config.py - Component contracts
backend/interfaces.py
Other components
- Student
- Course files
- Ollama or hosted model
Connections 26
- Student → Gradio app: uses
README.md - Course files → UI actions: uploads
README.md - Gradio app → UI actions: builds tabs
frontend/app.py - UI actions → Orchestrator: dispatches actions
README.md - UI actions → Result formatting: formats results
frontend/components.py - Orchestrator → Upload management: stores and deletes
backend/orchestrator.py - Orchestrator → Retriever adapter: ingests and queries
backend/orchestrator.py - Orchestrator → Ctrl+F baseline: indexes and searches
backend/orchestrator.py - Orchestrator → Grounded Q&A: answers questions
README.md - Orchestrator → Quiz generation and grading: runs quiz actions
README.md - Orchestrator → AI interaction log: records interactions
backend/orchestrator.py - Orchestrator → Runtime configuration: loads settings
backend/orchestrator.py - Retriever adapter → PDF/PPTX ingestion: parses documents
backend/retrieval/__init__.py - PDF/PPTX ingestion → Chunking and sanitizing: feeds text
backend/retrieval/rag-pipeline/pipeline/chunk.py - Retriever adapter → Hybrid retrieval: retrieves passages
backend/retrieval/__init__.py - Hybrid retrieval → Query embeddings: embeds query
backend/retrieval/rag-pipeline/pipeline/retrieve.py - Hybrid retrieval → Vector index: queries index
backend/retrieval/rag-pipeline/pipeline/retrieve.py - Hybrid retrieval → BM25 index: searches keywords
backend/retrieval/rag-pipeline/pipeline/retrieve.py - Grounded Q&A → Retriever adapter: retrieves context
README.md - Grounded Q&A → LLM client: generates answers
README.md - Grounded Q&A → QA prompts and citations: uses grounding rules
backend/qa/components.py - Quiz generation and grading → Retriever adapter: retrieves passages
README.md - Quiz generation and grading → LLM client: generates questions
README.md - LLM client → Ollama or hosted model: calls provider
README.md - UI actions → Orchestrator: receives results
README.md - Runtime configuration → Component contracts: selects implementations
backend/config.py