How boyedandtoyed/studyai works
StudyAI is a PDF-based study assistant. A student uploads notes; the backend indexes their content, then uses retrieval-augmented generation to answer questions with source context. The API also handles accounts, document and study-history operations, and quiz/flashcard features. The main internal layers are the FastAPI application, the RAG engine, and per-user persistence. The README documents PDF text and diagram processing, vector search, and model use; unsampled route implementations are represented only where documented.
Main entry points: main_fastapi.py FastAPI routes · gg.py PDF ingestion · user_store.py Account and history · db.py Relational database
Components 11
Backend API
- FastAPI routes
main_fastapi.py
RAG and Study
- PDF ingestion
gg.py - Context retrieval
gg.py - Answer generation
gg.py - Quiz and cards
gg.py - Vector index
gg.py
User Storage
- Account and history
backend/user_store.py - Relational database
backend/db.py
AI Models
- Ollama models
- OpenRouter models
Other components
- Student
Connections 14
- Student → FastAPI routes: uses API
README.md - FastAPI routes → PDF ingestion: indexes uploads
README.md - FastAPI routes → Context retrieval: requests context
main_fastapi.py - Context retrieval → Vector index: searches chunks
README.md - PDF ingestion → Vector index: stores vectors
README.md - PDF ingestion → Ollama models: embeds content
README.md - PDF ingestion → Ollama models: describes diagrams
gg.py - FastAPI routes → Answer generation: generates response
main_fastapi.py - Answer generation → Ollama models: calls model
gg.py - Answer generation → OpenRouter models: calls model
gg.py - FastAPI routes → Quiz and cards: requests study sets
main_fastapi.py - Quiz and cards → Context retrieval: uses context
gg.py - FastAPI routes → Account and history: reads and updates
main_fastapi.py - Account and history → Relational database: reads and writes
backend/user_store.py