How santosh-sankranthi/study-buddy works
Study Buddy is the small AI-tutor product inside a teaching workshop repository; the numbered phases and archived material teach how it evolves, rather than forming runtime product subsystems. The user-facing flow is a chat request to the FastAPI backend, which can apply safety checks, assemble prompts and session context, call an LLM or agent tools, then return an answer. The README also documents structured study endpoints, persistent notes, MCP tools, and evaluation reports. Some integration links below are documented capabilities rather than inspected call sites.
Main entry points: main.py Tutor API · llm.py LLM Client · agent.py Agent Loop · memory.py Session Memory
Components 21
Tutor API
- Tutor API
app/main.py - Prompt Builder
app/prompts.py - Output Schemas
app/schemas.py - Safety Filters
app/security.py - Evaluation Reports
app/evals/judge.py - Milestone v3
app/versions/v3/main.py - Milestone v4
app/versions/v4/main.py - Milestone v5
app/versions/v5/main.py - Milestone v6
app/versions/v6/main.py
Conversation Context
- Context Budget
app/context.py - Session Memory
app/memory.py - Token Counting
common/tokens.py
Agent Tools
- Agent Loop
app/agent.py - Study Tools
app/tools.py - Persistent Notes
app/notes_store.py - MCP Server
mcp_server/server.py
Model Integrations
- LLM Client
common/llm.py - MCP Client
app/mcp_client.py
Other components
- Student
- LLM Providers
- External MCP Server
Connections 25
- Student → Tutor API: sends chat
- Tutor API → Safety Filters: sanitizes input
app/main.py - Tutor API → Prompt Builder: builds prompts
app/main.py - Tutor API → Output Schemas: validates output
app/main.py - Tutor API → Context Budget: checks budget
app/main.py - Tutor API → Session Memory: loads and saves
app/main.py - Tutor API → Agent Loop: runs agent
app/main.py - Tutor API → MCP Client: uses MCP
app/main.py - Tutor API → LLM Client: requests completion
app/main.py - Tutor API → Evaluation Reports: reports evaluations
- Context Budget → Token Counting: counts tokens
app/context.py - Session Memory → Token Counting: budgets history
app/memory.py - Session Memory → LLM Client: summarizes history
app/memory.py - Agent Loop → LLM Client: requests tool calls
app/agent.py - Agent Loop → Study Tools: executes calls
app/agent.py - Study Tools → Persistent Notes: reads and writes
app/tools.py - MCP Server → Study Tools: exposes tools
mcp_server/server.py - MCP Server → Persistent Notes: uses notes
mcp_server/server.py - Safety Filters → LLM Client: moderates output
app/security.py - LLM Client → LLM Providers: calls provider
- MCP Client → External MCP Server: connects to server
- Milestone v3 → Agent Loop: adds agent support
app/versions/v3/main.py - Milestone v4 → MCP Client: adds MCP support
app/versions/v4/main.py - Milestone v5 → Safety Filters: adds safety
app/versions/v5/main.py - Milestone v6 → Tutor API: is live milestone