This project is an LLM-powered eLearning support automation agent.
It simulates how a support team can move from manual SOP-based ticket handling to an agentic workflow. Incoming student emails are stored as tickets, processed asynchronously by an LLM-powered agent, and resolved or escalated using domain docs, database schema inspection, database queries, approved actions, and structured audit logs.
- Groq or Gemini function calling
- Async support ticket processing
- Multi-table database lookup
- Domain-knowledge-driven decisions
- Structured
structlogaudit events - Explicit API reset for the full demo database state
- Human escalation
- Simulated email outbox
- Full audit trail
pip install -r requirements.txt
cp .env.example .env
# Edit .env and set GROQ_API_KEY from https://console.groq.com/
python seed.py
uvicorn api:app --reload --port 8000
streamlit run app.pyReset demo data manually when needed:
curl -X POST http://localhost:8000/seed/reset- The default
LLM_PROVIDERisgroq, usingGROQ_MODEL=llama-3.1-8b-instant. - The default
AGENT_MODEisstaged_llm, which uses four LLM calls per ticket: triage, investigation planning, evidence reasoning, and final decision/email generation. - To use Groq, set
GROQ_API_KEYin.env. Groq keys are available fromhttps://console.groq.com/. - To use Gemini instead, set
LLM_PROVIDER=geminiand setGEMINI_API_KEYto a Google AI Studio API key. AI Studio keys usually begin withAIza. - A real provider API key is required. The agent does not use a local fallback or rule-based substitute.
- Restart both
uvicornand Streamlit after changing.env; environment variables are loaded when each process starts. - Streamlit posts tickets to the FastAPI backend and polls ticket status while the background agent processes the ticket.
- Student reply emails are generated by the final LLM decision call and then written once by the backend.
- Demo data is not reset automatically after each ticket. Call
POST /seed/resetwhen you want to clear tickets, replies, audit trails, actions, and restore the original learner/course records.