How hqanhh/edugpt works
Main Components
• User Interface (UI)
• Gradio web interface launched by src/run.py
• Orchestration Layer
• run.py: ties UI inputs to the agent pipeline
• Agent Modules
• Role-playing Agents (syllabus designers)
– generating_syllabus.py
• Instructor Agent
– teaching_agent.py
• Core Services
• LangChain abstraction layer
• OpenAI LLM API (external service)
• Configuration & Environment
• .env (OPENAI_API_KEY)
• pyproject.toml / requirements.txt / setup.py
Relationships & Data Flows
1) User opens the Gradio UI (run.py).
2) User submits “desired learning topics.”
3) run.py invokes the Agent Initialization:
– Agents are instantiated via LangChain wrappers.
4) Role-playing Agents exchange messages:
– generating_syllabus.py orchestrates a two-agent dialogue.
5) Syllabus Generation:
– The conversation history is passed to OpenAI LLM to produce a structured syllabus.
6) Instructor Agent Activation:
– teaching_agent.py receives the syllabus and user questions.
– It uses OpenAI LLM calls to generate teaching responses.
7) Gradio UI updates live with syllabus then Q&A from the Instructor Agent.
Architectural Patterns & Principles
• Modular Agent Pipeline: each stage is its own Python module.
• External API Integration: all LLM calls go through LangChain → OpenAI.
• Separation of Concerns:
• UI (Gradio) vs. Orchestration (run.py) vs. Domain Logic (agents).
• Configuration-driven: environment variables & config files control API keys and dependencies.