How adhamhesham07/tutai works
TutAI is an educational chat application: a student sends a message or uploads course material, then the agent classifies the request and routes it to document analysis, question answering, quizzes, or web research. Its retrieval path uses embeddings and FAISS, while responses and synthesis use configured language models; session memory supports follow-up dialogue. The README documents these capabilities, but unsampled modules such as confidence evaluation are represented only at the documented level. Edges reflect shown calls or README relationships; optional external integrations are marked dashed where wiring is not fully shown.
Main entry points: orchestrator.py Agent handler · router.py RAG router · rag_system.py RAG retrieval · model_loader.py Answer generation
Components 19
Chat experience
- Gradio interface
app.py - Session memory
tools/memory_tool.py
Agent orchestration
- Agent handler
agent/orchestrator.py - Intent classifier
agent/intents.py - Confidence check
agent/confidence.py - RAG router
agent/router.py - Runtime settings
config/settings.py
Document intelligence
- File parser
tools/parser_tool.py - Uploaded-file index
agent/orchestrator.py - RAG retrieval
rag/rag_system.py - FAISS index and chunks
data/faiss_index.bin
Models and tools
- Educational prompts
llm/prompt_templates.py - Answer generation
llm/model_loader.py - Quiz generator
tools/quiz_tool.py - Web search
tools/search_tool.py - Web synthesis
agent/orchestrator.py
Other components
- Student
- Gemini
- SerpAPI
Connections 30
- Student → Gradio interface: sends input
README.md - Gradio interface → Agent handler: calls agent
app.py - Gradio interface → RAG retrieval: initializes
app.py - Agent handler → Intent classifier: classifies
agent/orchestrator.py - Agent handler → File parser: parses upload
agent/orchestrator.py - Agent handler → Uploaded-file index: builds index
agent/orchestrator.py - Agent handler → RAG retrieval: queries
agent/orchestrator.py - Agent handler → RAG router: delegates questions
agent/orchestrator.py - Agent handler → Quiz generator: generates quiz
agent/orchestrator.py - Agent handler → Web search: requests search
agent/orchestrator.py - Agent handler → Web synthesis: synthesizes search
agent/orchestrator.py - Agent handler → Session memory: updates history
agent/orchestrator.py - RAG router → RAG retrieval: retrieves context
agent/router.py - RAG router → Confidence check: checks answer
agent/router.py - RAG router → Answer generation: generates answer
agent/router.py - RAG router → Session memory: builds context
agent/router.py - File parser → Uploaded-file index: provides text
agent/orchestrator.py - RAG retrieval → FAISS index and chunks: loads and saves
rag/rag_system.py - Uploaded-file index → Answer generation: supplies context
agent/orchestrator.py - Agent handler → Answer generation: generates summary
agent/orchestrator.py - Agent handler → Session memory: reads history
agent/orchestrator.py - Answer generation → Gemini: calls model
llm/model_loader.py - Intent classifier → Gemini: classifies via
agent/intents.py - Quiz generator → Gemini: generates with
tools/quiz_tool.py - Web search → SerpAPI: searches via
tools/search_tool.py - Web synthesis → Gemini: synthesizes with
agent/orchestrator.py - RAG retrieval → Runtime settings: reads paths
rag/rag_system.py - Answer generation → Runtime settings: reads model settings
llm/model_loader.py - RAG router → Educational prompts: formats prompt
agent/router.py - Quiz generator → Educational prompts: formats quiz
tools/quiz_tool.py