How shreshth1805/ai-tutor works
EduSmart AI Tutor is a Streamlit learning assistant with two paths: document-based study and general tutoring. In study mode, uploaded files are extracted, embedded in a FAISS index, retrieved for a conversational QA chain, and used for chat, summaries, quizzes, and flashcards. General questions are routed by keyword or arithmetic symbols to research, Wikipedia, calculator, or the default LLM path. The README also describes contextual learning and tool capabilities. The sampled LLM implementation uses Hugging Face, despite the README describing Groq; unsampled behavior and integrations are not inferred.
Main entry points: app.py Streamlit app · tutor.py Conversational QA · tools.py Tool definitions · llm.py LLM client
Components 18
Student interface
- Streamlit app
app.py
Document learning
- File extraction
src/doc_loader.py - Chunk and index
src/vecor_store.py - Text embeddings
src/embeddings.py - FAISS index
src/vecor_store.py - Document retriever
src/vecor_store.py - Conversational QA
src/tutor.py
Tutor and routing
- Chat memory
src/memory.py - Question router
src/agents.py - Tutor prompt
src/prompts.py
Models and tools
- LLM client
src/llm.py - API configuration
src/config.py - Tool definitions
src/tools.py
Other components
- Student
- Wikipedia
- ArXiv
- Calculator
- Hugging Face endpoint
Connections 19
- Student → Streamlit app: uses
README.md - Streamlit app → File extraction: loads upload
app.py - Streamlit app → Chunk and index: builds index
app.py - Chunk and index → Text embeddings: creates embeddings
src/vecor_store.py - Chunk and index → FAISS index: stores vectors
src/vecor_store.py - Streamlit app → Document retriever: creates retriever
app.py - Streamlit app → Conversational QA: creates QA chain
app.py - Streamlit app → Conversational QA: invokes for study
app.py - Conversational QA → Document retriever: retrieves context
src/tutor.py - Conversational QA → Chat memory: uses memory
src/tutor.py - Conversational QA → LLM client: uses model
src/tutor.py - Streamlit app → Question router: routes general query
app.py - Question router → Tool definitions: dispatches tools
src/agents.py - Question router → LLM client: answers default query
src/agents.py - Tool definitions → Wikipedia: queries
README.md - Tool definitions → ArXiv: searches
README.md - Tool definitions → Calculator: evaluates expression
src/tools.py - LLM client → API configuration: reads token
src/llm.py - LLM client → Hugging Face endpoint: calls endpoint
src/llm.py