How priyamakeshwari/teachgpt works
TeachGPT’s Type and Purpose
• Type: An open‐source AI‐Powered Virtual Tutor platform implemented in Python.
• Purpose: Ingest educational documents, build a retrieval‐augmented knowledge store, power an interactive LLM‐based tutoring agent with speech I/O and gamification.
File Structure
• builder.py & config.py: Data‐preparation pipeline for creating/updating the vector database.
• db/…: Chroma (or similar) vector store files and a SQLite metadata store.
• documents/: Source PDFs (e.g., Tom Mitchell’s ML book).
• main.py: Orchestrates the runtime service—loads config, starts the tutor agent loop.
• requirements.txt: Specifies LLM, embedding, ASR/TTS, and gamification libs.
README Insights
• No client‐UI folder—service likely exposes a CLI or HTTP API.
• Calls out LLM, speech recognition integration, and gamification.
Core Components & Their Interactions
a. Document Ingestion & Vector Store Builder
– Inputs: PDFs from documents/
– Process: builder.py reads text, computes embeddings, writes to db/(uuid)… bins + chroma.sqlite3
– Config: config.py defines model endpoints, DB paths.
b. Vector Database (Chroma + SQLite)
– Stores high‐dim embeddings and metadata for retrieval.
c. LLM Tutor Service (main.py)
– Loads vector store + LLM model (OpenAI/in‐house)
– Exposes interaction loop or REST endpoints.
d. Speech Pipeline
– ASR Module: Speech → Text
– TTS Module: Response Text → Speech
e. Gamification Engine
– Tracks user progress, awards points/badges, updates user state.
f. External Clients
– CLI, Web front‐end, or other consumer apps sending/receiving JSON or audio streams.
Architectural Patterns & Design Principles
• Modular “Pipeline” for data prep (builder → db).
• Retrieval‐Augmented Generation (RAG) pattern: Vector DB + LLM.
• Pluggable speech I/O and gamification modules following Dependency Injection via config.