https://intelligent-lms-support-ppfz.vercel.app/
https://masaischool.duckdns.org/
- Introduction
- Features
- Architecture
- Technology Stack
- Getting Started
- Usage
- API Endpoints
- Project Structure
- Future Enhancements
- Contributing
- License
- Contact
The Intelligent LMS Support System is an AI-powered ticketing solution for Learning Management Systems that:
- Automates student query resolution.
- Retrieves knowledge from a centralized database.
- Escalates complex cases to human admins.
This is a production-ready AI-powered support system for Masai School's LMS that automates 70-80% of support ticket resolution using:
- LangGraph: Orchestrates multi-agent workflow with state management
- LangChain: Provides LLM integration and prompt engineering
- Google Gemini: Powers natural language understanding and generation
- Pinecone: Vector database for semantic search and RAG
- MongoDB: Primary data storage for tickets, users, and documents
- Redis: High-performance semantic caching
- FastAPI: Modern, fast web framework for building APIs
- ๐ค AI-Powered Ticket Resolution โ Automated, accurate responses.
- ๐ Contextual Understanding โ Retrieval-Augmented Generation (RAG).
- โก Semantic Caching โ Faster repeated queries.
- ๐ Intelligent Escalation โ Human handoff when needed.
- ๐ค Role-Based Access Control โ Student/Admin separation.
- ๐ Knowledge Base Management
- Document ingestion (PDF, Excel, CSV, etc.)
- Categorization
- Listing & deletion tools
- ๐ Analytics Dashboard โ Automation rates, agent performance.
- ๐ Modular & Scalable โ Easy to add new programs and knowledge bases.
- ๐จ User-Friendly UI โ Intuitive design for all roles.
graph TD
A[Student Query] --> B{Routing Agent}
B --> C{Cache Check (Redis)}
C -- Cache Hit --> D[Personalize Response (LLM)]
D --> E[Response to Student]
C -- Cache Miss --> F{Query Decomposition}
F --> G{Triage (EC/IA)}
G --> H{Retriever Agent}
H --> I{Pinecone Vector DB}
I --> J{Re-ranking}
J --> K{Response Agent}
K --> L{Confidence Scoring}
L -- High Confidence (>=85%) --> E
L -- Medium/Low Confidence (<85%) --> M{Escalation Agent}
M --> N[Notify Admin]
N --> O[Admin Response]
O --> P[Update Cache & KB]
P --> E
๐ฅ Backend
- Framework: FastAPI (Python 3.11+)
- DB: MongoDB (pymongo)
- Vector DB: Pinecone
- Cache/Analytics: Redis
- AI Frameworks: LangChain, LangGraph
- LLM: Google Generative AI (Gemini 2.5 Flash)
- Embeddings: HuggingFace
all-mpnet-base-v2 - Document Processing: unstructured.io, pandas, pdfminer.six, pytesseract
๐ป Frontend
- Framework: Next.js 14 (React, TypeScript)
- Styling: Tailwind CSS + Shadcn/ui
- Python 3.11+
- Node.js 18+
- MongoDB & Redis instances
- Google API Key
- Pinecone API Key
๐ Click to view .env example
# Database
MONGODB_URL="mongodb://localhost:27017/lms_support"
REDIS_URL="redis://localhost:6379"
# Google AI
GOOGLE_API_KEY="YOUR_GOOGLE_API_KEY"
# Pinecone
PINECONE_API_KEY="YOUR_PINECONE_API_KEY"
PINECONE_ENVIRONMENT="YOUR_PINECONE_ENVIRONMENT"
# Index & Collection Maps
PINECONE_INDEX_MAP='{"program_details_documents": "program-details-documents", "qa_documents": "qa-documents", "curriculum_documents": "curriculum-documents"}'
MONGO_COLLECTION_MAP='{"program_details_documents": "program_details_documents", "qa_documents": "qa_documents", "curriculum_documents": "curriculum_documents"}'
# App Config
ENVIRONMENT="development"
DEBUG=True
SESSION_SECRET_KEY="YOUR_SECRET"cd Intelligent_lms_support
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
pip install uv
uv sync
python backend/app/db/init_db.pycd frontend
npm install # or pnpm install
echo 'NEXT_PUBLIC_API_BASE="http://localhost:8000"' > .env.local# Backend
uvicorn backend.app.main:app --host 0.0.0.0 --port 8000 --reload
# Frontend
cd frontend
npm run dev- Backend: http://localhost:8000
- Frontend: http://localhost:3000
๐จโ๐ Student Flow
- Visit
http://localhost:3000 - Login as student
- Create and track tickets
- Reopen or rate resolved tickets
๐ Admin Flow
- Login as admin
- Manage tickets and documents
- Choose a category for the document with help of category guide provided
- Select categories and courses to which document is applicable
- Upload the document (Might take few minutes to process)
- Respond to escalated tickets
- View analytics dashboard
POST /v1/auth/login- User loginPOST /v1/auth/logout- User logoutGET /me- Get current user information
POST /v1/tickets/create- Create new ticketGET /v1/tickets/my_tickets- List user's ticketsGET /v1/tickets/{ticket_id}- Get ticket detailsPOST /v1/tickets/{ticket_id}/reopen- Reopen resolved ticketPOST /v1/tickets/{ticket_id}/rate- Rate ticket resolutionPOST /{ticket_id}/messages- A user (student or admin) adds a message to an existing ticket.
GET /v1/admin/tickets- List tickets for adminPOST /v1/admin/tickets/{ticket_id}/respond- Admin responsePOST /v1/admin/documents/upload- Upload knowledge base documentDELETE /v1/admin/documents/{doc_id}- Delete documentGET /v1/admin/documents- List documentsPOST /v1/admin/tickets/{ticket_id}/resolve- Admin Resolves a ticketGET /v1/admin/analytics
- Student: student1@masaischool.com / password123
- Student: student2@masaischool.com / password123
- Student: student3@masaischool.com / password123
- Admin: ec1@masaischool.com / admin123
- Admin: ec2@masaischool.com / admin123
- Admin: ia1@masaischool.com / admin123
- Admin: ia2@masaischool.com / admin123
Once the server is running, visit:
- Interactive API Docs: http://localhost:8000/docs
- Alternative Docs: http://localhost:8000/redoc
# 1. Login as student
POST /v1/auth/login
{
"username": "student1@masaischool.com",
"password": "password123"
}
# 2. Create a ticket
POST /v1/tickets/create
{
"category": "Course Query",
"title": "Cannot access Unit 3",
"message": "I completed Unit 2 but cannot see Unit 3 materials"
}
# 3. Check ticket status
GET /v1/tickets/my_tickets
# The system will automatically process the ticket through the LangGraph workflow- Response Time: 3-5 seconds for cached queries, 8-10 seconds for new queries
- Automation Rate: 70-80% of tickets resolved without human intervention
- Escalation Rate: 20-30% for complex or unclear queries
-
MongoDB Connection Error
- Ensure MongoDB is installed and running
- Check connection string in .env
-
API Key Errors
- Verify Google Gemini API key is valid
- Check Pinecone API key and environment
-
Import Errors
- Run
pip install -r requirements.txtagain - Check Python version (3.9+ required)
- Run
-
Cache Not Working
- Install and start Redis
- Check Redis connection URL
Intelligent_lms_support/
โโโ backend/
โ โโโ app/
โ โโโ agents/ # Multi-agent implementations
โ โ โโโ langgraph_workflow.py # Enhanced LangGraph workflow
โ โ โโโ routing_agent.py
โ โ โโโ retriever_agent.py
โ โ |
โ โ โโโ escalation_agent.py
โ โโโ api/ # FastAPI routes
โ โโโ core/ # Configuration and security
โ โโโ db/ # Database initialization
โ โโโ models/ # Data models
โ โโโ scripts/ # Data ingestion scripts
โ โโโ services/ # Document and cache services
โโโ Documents/ # Sample FAQs and documents
โโโ .env # Environment configuration
โโโ requirements.txt # Python dependencies
โโโ run.py # Main application entry
- Support for attachments in tickets.
- Suggest response to query option for admins.
- Tags for metadata of documents for easier organization and search.
- Live updates/notifications for escalations and responses.
- LLM fine-tuning with feedback loop.
- Granular analytics.
This project is developed for Masai School as part of the Improving the LMS Support System initiative.
** Aravind Yuraj ** ๐ง aravind98761234@gmail.com ๐ GitHub Profile
** Kinjal Momaya ** ๐ง kinjalmomaya99@gmail.com ๐ GitHub Profile