
RootsAI
Overview
When a student struggles with a topic in Class 9, the real problem is often something from Class 7 or 8 that was never fully understood. Most learning tools don't go looking for that. RootsAI does.
The system takes a student's problem, maps it onto an authored curriculum graph, traverses prerequisites to build a "Concept MRI," diagnoses knowledge gaps through targeted quizzes, and guides the student through a gamified remediation path — ending with a Feynman-style verification where the student teaches the concept back to the AI.
Core principles:
- The graph is the source of truth, not the LLM. Every AI output is validated against the real curriculum graph. The LLM maps problems to existing nodes — it never invents curriculum.
- Deterministic where it matters. Same problem → same concept map → same prerequisite tree → same quiz. Reproducible diagnostics, every time.
- Mastery is earned, not assumed. Students prove understanding by re-answering missed questions and explaining concepts back (Feynman technique).
How It Works
Student submits problem (text or photo)
│
▼
┌─────────┐ Zod-validated against
│ Map │───▶ real graph slugs
└────┬────┘ (hallucinated slugs rejected)
│
▼
┌──────────┐ Deterministic BFS
│ Traverse │───▶ prerequisite subtree
└────┬─────┘ ("Concept MRI")
│
▼
┌────────┐ Authored questions verbatim,
│ Quiz │────▶ or generate-once + cache
└────┬───┘ in Firestore
│
▼
┌──────────┐ Duolingo-style serpentine path,
│ Learn │───▶ foundational-first ordering,
└────┬─────┘ sequential unlock
│
▼
┌──────────┐ Student teaches concept back
│ Verify │───▶ to the AI (Feynman technique)
└──────────┘
Two modes
- Legacy (demo): Hardcoded NCTB Class 9 Physics graph — mechanics vertical with 19 authored nodes and hand-written quiz questions.
- Classroom: Teachers upload materials → AI extracts a concept graph → students run diagnostics against that graph. Works with any subject.
Features
Diagnostic Engine
- GraphRAG mapping: LLM routes problems to existing curriculum nodes with Zod hard-validation — no hallucinated concepts.
- Concept MRI: Deterministic BFS traversal builds the same prerequisite tree for the same root, every time.
- Hybrid quizzes: Authored questions used verbatim; unauthored nodes get AI-generated questions cached in Firestore.
- Adaptive remediation: All gaps recorded and ordered foundational-first. Lesson plans are deterministically structured from the graph.
Learning Path
- Serpentine path: Duolingo-style winding path of medallion nodes with strict sequential unlock.
- Earned mastery: Each gap node reuses the exact MCQ the student missed (options shuffled). Answer correctly → mastered.
- Feynman verification: Students teach the concept back to the AI via voice or text+photo before moving on.
- Gamification: Progress bar, XP system (+10/mastered), celebration animations (reduced-motion guarded).
Classroom System
- Teacher workflows: Create classrooms, upload materials (PDF/syllabus/notes/textbook), manage students.
- Dynamic graph extraction: AI extracts concept dependency graphs from uploaded materials for any subject.
- RAG-powered tutoring: LangGraph agent retrieves from teacher's knowledge base — never fabricates content.
- Analytics: Teacher dashboard with student progress and engagement tracking.
Additional
- Multimodal input: Students can photograph problems (camera/upload) — image is sent alongside text to the diagnostic engine.
- Voice transcription: Audio input transcribed via Gemini for Feynman verification.
- Real-time chat: Contextual AI tutor grounded in classroom materials with citation support.
- Role-based access: Firebase Auth with student/teacher roles and onboarding flow.
Architecture
| Layer | Stack | Responsibilities |
|---|---|---|
| Frontend | Next.js 16, React 18, Chakra UI, Tailwind | Role-based app shell, diagnostic flow, serpentine learning path |
| Diagnostic Engine | Custom pipeline (map → traverse → quiz) | Problem mapping, prerequisite traversal, quiz resolution |
| Tutor Agent | LangGraph + LangChain | Stateful multi-tool agent: RAG retrieval, mastery check, grounded response |
| Curriculum Graph | Authored graph + Neo4j (optional) | Source-of-truth concept dependencies, BFS traversal |
| RAG Pipeline | LangChain TextSplitters + Gemini Embeddings | Chunk materials, embed, store in Supabase pgvector, HNSW cosine search |
| LLM Provider | Gemini (primary) + fallback chain | Structured JSON generation with retry + model-chain fallback |
| Auth / Data | Firebase Auth + Firestore | Identity, roles, diagnoses, classrooms, quiz cache, progress |
| File Storage | Supabase Storage | Problem photos, Feynman verification uploads |
The Infinity AI BuildFest
Built for The Infinity AI BuildFest organized by CloudCamp Bangladesh. The idea: when a student struggles with a Class 9 topic, the real gap is often something from Class 7 or 8 that was never fully understood. RootsAI goes looking for that root cause.
Team
- @bokaif (Badruddoza Kaif)
- @MrDuck04 (Abror Mahir)
- @mdnaimur0 (Md. Naimur Rahman)
- @Moraladnan (Md. Adnan Arefin Ratul)