A RAG (Retrieval-Augmented Generation) pipeline embedded in a Moodle-integrated LMS that answers student queries using uploaded course materials, streams responses token-by-token via SSE, and delivers them through a Flutter mobile app.
- Smart Q&A Retrieval: Extracts and vectorizes multi-format course materials (PDF, DOCX) via NVIDIA NIM.
- Vision-Driven Parsing: Extracts tabular data and calendars using NVIDIA Vision LLM.
- Dynamic Query Routing: Intelligently routes queries between vector search, SQL calendar lookup, and LMS APIs.
- SSE Streaming: Delivers token-by-token stream responses with active source references.
- Mobile Chat App: Cross-platform Flutter application with history persistence and markdown formatting.
- Admin Dashboard: Simple web UI to upload documents, manage subjects, and configure models.
- Student Query: Student asks a question via the Flutter application chat screen.
- Intent Classification: Backend classifies query intent (
concept_explanation,calendar_query, orstudent_data_query). - Retrieval Search: System executes pgvector similarity search, SQL calendar lookup, or LMS API retrieval.
- LLM Generation: NVIDIA NIM LLM synthesizes an answer using the retrieved context.
- Client SSE Stream: Flutter receives token-by-token server-sent events (SSE) and displays them in real-time.
Supabase acts as the primary data store and vector database, combining relational integrity with vector search capabilities:
- Course Material Vectors (
pgvector): Stores chunked course text mapped to1024-dimensionalembeddings generated via NVIDIA NIM. - Relational Tables: Manages data for academic subjects, document metadata, logs, and calendar event schedules.
Here is a preview of the student client application interface:
Deployed live on AWS EC2 with a full CI/CD pipeline (GitHub Webhook → Jenkins → Docker).
GitHub push on main triggers a webhook to Jenkins, which runs 6 stages: Checkout Code → Cleanup Docker → Build Docker Image → Remove Old Container → Run Docker Container → Health Check. Full pipeline completes in ~2 minutes.
Webhook — Last delivery successful
Jenkins Pipeline — 6-stage Docker CI/CD (latest run #11, all green)
Docker container live on EC2 — health check confirmed
$ docker ps
CONTAINER ID IMAGE COMMAND STATUS PORTS NAMES
3e3d29e48392 moodle-ai-backend "docker-entrypoint.s…" Up About a minute 0.0.0.0:3000->3000/tcp, [::]:3000->3000/tcp moodle-ai-container
$ curl http://43.206.238.148:3000/health
{"status":"ok"}The backend runs as a Docker container (moodle-ai-container) built from server/Dockerfile, exposing port 3000. Managed via docker-compose and orchestrated by Jenkins on every push.