How itiyashah/ai-teaching-assistant works
The product is a Streamlit study assistant: students manage chat sessions, ask questions, and receive AI explanations that are saved to chat history. The assistant graph retrieves textbook context, generates an answer, critiques it, and updates weak-topic state; users can also pin questions for later review. The UI persists users, conversations, messages, and weak topics through SQLAlchemy. The README documents PDF RAG and cloud persistence; the excerpts show the RAG and database implementations, but not all UI wiring to them, so uncertain links are dashed.
Main entry points: app.py Streamlit interface · agent.py Answer critique · database.py SQLAlchemy models · rag.py PDF ingestion
Components 16
Study interface
- Streamlit interface
app.py - Chat sessions
app.py - Weak topics UI
app.py - Math formatting
app.py
Study persistence
- SQLAlchemy models
database.py - PostgreSQL / SQLite
Answer workflow
- Assistant graph
agent.py - Context retrieval
agent.py - Answer generation
agent.py - Answer critique
agent.py - Weak-topic update
agent.py
PDF learning
- PDF ingestion
rag.py - Chroma retriever
rag.py
Other components
- Student
- Groq model API
- Hugging Face embeddings
Connections 19
- Student → Streamlit interface: asks questions
README.md - Streamlit interface → Chat sessions: manages chats
app.py - Streamlit interface → SQLAlchemy models: reads and writes
app.py - Chat sessions → SQLAlchemy models: loads history
app.py - Weak topics UI → SQLAlchemy models: saves topics
app.py - Streamlit interface → Assistant graph: invokes graph
app.py - Assistant graph → Context retrieval: dispatches
agent.py - Context retrieval → Answer generation: passes context
agent.py - Answer generation → Answer critique: reviews answer
agent.py - Answer critique → Answer generation: requests revision
agent.py - Answer critique → Weak-topic update: proceeds
agent.py - Answer generation → Groq model API: requests completion
agent.py - Answer critique → Groq model API: requests critique
agent.py - SQLAlchemy models → PostgreSQL / SQLite: persists records
database.py - Streamlit interface → Math formatting: formats responses
app.py - Streamlit interface → PDF ingestion: offers PDF learning
app.py - PDF ingestion → Hugging Face embeddings: embeds chunks
rag.py - PDF ingestion → Chroma retriever: builds retriever
rag.py - Context retrieval → Chroma retriever: queries retriever