Most tutors know the subject. LearnLoop learns the learner.
Personalised AI Tutor for Learning AI
Team RudraCore ยท PS-03 ยท Build Fast with AI โ AI Build Challenge 2026
๐ Live Demo ยท ๐ป GitHub ยท โ๏ธ Backend API ยท ๐น Demo Video ยท
| Resource | Link |
|---|---|
| ๐ Live Demo | https://learnloop-ai-eight.vercel.app |
| ๐ป GitHub Repository | https://github.com/techAsmita/LearnLoop-AI |
| โ๏ธ Backend API | https://learnloop-ai-vp36.onrender.com |
| ๐ฅ Demo Video | https://drive.google.com/file/d/1sZZyDVhdxzcx3bDYxtMVuGXhfAvwkCE8/view?usp=sharing |
| ๐ Project Presentation | https://drive.google.com/file/d/10Q6iRQ2Bg8ixb7gIx6Qt2HMKopdtlH9n/view?usp=sharing |
High-confidence misconception โ Targeted intervention โ Reassessment โ Learner-state update
This demonstrates the complete adaptive loop rather than only showing generated AI content.
LearnLoop AI is a learner-model-driven adaptive tutor for learning AI/ML concepts.
Instead of giving every learner the same explanation and practice sequence, LearnLoop maintains an explicit learner state containing:
- Concept mastery
- Confidence
- Active misconceptions
- Attempt history
- Intervention history
The learner state determines what the learner receives next โ and why.
Diagnose โ Detect โ Intervene โ Reassess โ Adapt
Same concept. Different learner state. Different next action.
Learner State(t) + New Evidence
โ
Policy Decision
โ
Intervention
โ
Reassessment
โ
Learner State(t + 1)
-
Diagnose โ The learner submits an answer, their reasoning, and a confidence level. The system evaluates the response and builds a diagnosis.
-
Detect โ The system identifies whether the learner holds a potential misconception.
Learner: "Training accuracy is high, so the model should generalize well." Detected misconception: High training performance implies strong generalization. -
Select intervention โ A deterministic learner-model policy chooses the intervention based on mastery, confidence, correctness, misconception presence and confidence, previous intervention, and reassessment history.
-
Intervene โ The system delivers a foundational explanation, targeted misconception explanation, guided example, reinforcement, or practice challenge. Gemini can generate the content; the application policy controls the decision.
-
Reassess โ The learner gets a follow-up question designed to check whether the underlying misconception has been addressed.
-
Update โ The learner model is updated with the new evidence.
Before: Mastery = 0.24, Active misconception = Yes โ Targeted intervention โ Reassessment After: Mastery = Updated, Active misconception = Resolved / Persistent -
Adapt โ The next intervention is selected using the updated learner state.
LearnLoop is not a generic ChatGPT-style educational chatbot. The learner state directly influences the next action:
| Learner state | Adaptive response |
|---|---|
| Incorrect + high confidence + strong misconception | Targeted misconception intervention |
| Incorrect + persistent misconception | Guided example |
| Correct + low confidence | Reinforcement |
| Low mastery without a clear misconception | Foundational explanation |
| Strong mastery + high confidence | Practice challenge |
Every adaptive decision is surfaced in the interface through "Why this next?", making the adaptation observable rather than hidden behind an LLM.
Traditional online learning systems often provide the same explanations, examples, and practice sequence to every learner. But two students can answer the same question incorrectly for completely different reasons:
- One learner may lack the basic concept.
- Another may have a specific misconception.
- Another may understand the concept but lack confidence.
- A strong learner may need a harder challenge rather than another explanation.
A useful AI tutor needs to understand the learner, not just the subject.
LearnLoop maintains an explicit learner model and continuously adapts the learning path based on evidence from the learner. Two learners answering the same question can receive different interventions because their learner states are different.
Why we built LearnLoop: We wanted to move beyond generic AI tutoring by making the learner's evolving understandingโnot just the subject matterโthe input that determines what the tutor teaches next.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Learner / UI โ
โ Next.js + TypeScript โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FastAPI โ
โ API Layer โ
โโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ
โ Gemini โ โ Learner โ โ PostgreSQL / โ
โ Diagnosis & โ โ Model + โ โ Supabase โ
โ Content โ โ Policy โ โ โ
โโโโโโโโโโโโโโโโ โโโโโโโโฌโโโโโโโโ โโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโ
โ Adaptive Learning โ
โ Loop โ
โโโโโโโโโโโโโโโโโโโโโโโ
One of the core architectural decisions is that the LLM does not own the learner state or the final adaptive policy.
Learner Response
โ
โผ
Gemini Diagnosis
โ
โผ
Structured Diagnosis
โ
โผ
Deterministic Learner Policy
โ
โโโ Foundational explanation
โโโ Targeted misconception
โโโ Guided example
โโโ Reinforcement
โโโ Practice challenge
โ
โผ
Gemini-generated intervention content
โ
โผ
Reassessment
โ
โผ
Deterministic state update
Gemini is used for:
- Diagnosing learner responses
- Identifying potential misconceptions
- Estimating diagnosis-related signals
- Generating intervention content
Deterministic Python logic controls:
- Intervention selection
- Mastery updates
- Misconception persistence
- Reassessment evaluation
- State transitions
- Evaluation scenarios
- Decision explanations
This separation makes the system more explainable, testable, reproducible, and resilient to LLM failures.
Each learner-concept state contains:
LearnerConceptState
โโโ mastery
โโโ confidence
โโโ active_misconceptions
โโโ attempt_count
โโโ last_intervention_type
โโโ history
โโโ updated_at
The state is updated after every learner interaction:
State(t) + Evidence โ State(t+1)
The system therefore has a persistent learner model rather than treating every question as an isolated conversation.
The deterministic policy considers learner state when selecting the next intervention.
Incorrect + High misconception confidence + Active misconception
โ
Targeted Misconception Intervention
Correct + Low confidence
โ
Reinforcement
Low mastery + Incorrect + No clear misconception
โ
Foundational Explanation
The policy also detects when a misconception persists after intervention and changes strategy:
Targeted misconception โ Misconception persists โ Guided example โ Reassessment
LearnLoop includes a deterministic evaluation harness for testing whether learner-state changes actually produce different adaptive behavior.
cd backend
source .venv/bin/activate
python ../evaluation/run_evaluation.pyThe evaluation is designed to answer one question:
Does the system actually change its behavior when learner state changes?
| Metric | Result |
|---|---|
| Adaptive policy accuracy | 100% |
| Strategy change rate | 66.7% |
| Misconception adaptation rate | 100% |
| Controlled simulated learning-gain difference | +0.017 |
What each metric measures
- Adaptive policy accuracy โ whether the policy selects the intended intervention for controlled learner states.
- Strategy change rate โ how often the adaptive policy changes strategy relative to the fixed baseline under different learner states.
- Misconception adaptation rate โ whether the system changes strategy when a misconception persists.
- Controlled learning-gain simulation โ a comparison of mastery transitions under the adaptive and fixed policies.
The learning-gain benchmark is a controlled simulation using predefined learner scenarios and the implemented mastery-update logic. It is not a real-user learning study, and no real-world learning outcomes are claimed.
cd backend
source .venv/bin/activate
pytest -vThe test suite covers:
- Health endpoint
- Concept retrieval
- Session creation
- Diagnostic flow
- Adaptive intervention selection
- Full adaptive learning loop
- Different learner states producing different interventions
- Mastery update determinism
- State persistence
The dashboard supports controlled learner-state scenarios:
1. High-confidence misconception
Incorrect โ High confidence โ Misconception detected โ Targeted intervention
2. Correct but low confidence
Correct โ Low confidence โ Reinforcement
The concept is reinforced instead of being unnecessarily retaught.
3. Low mastery
Low mastery โ No clear misconception โ Foundational explanation
Together these show the core product claim: different learner states โ different interventions.
0:00 โ 0:20 Problem + learner-model idea
0:20 โ 0:50 Introduce learner state
0:50 โ 1:30 Incorrect answer with high confidence โ misconception detected
1:30 โ 1:55 Targeted intervention โ "Why this next?"
1:55 โ 2:20 Reassessment โ mastery and misconception state update
2:20 โ 2:45 A different learner state โ a different intervention
2:45 โ 3:00 Evaluation + architecture + closing
| Layer | Technology |
|---|---|
| Frontend | Next.js 14, TypeScript, React, Tailwind CSS |
| Backend | FastAPI, Python, Pydantic |
| ORM / Database layer | SQLAlchemy |
| Database | PostgreSQL / Supabase (production), SQLite (local) |
| Generative AI | Gemini API (google-generativeai) |
| Evaluation | Python |
| Testing | pytest |
| Deployment | Vercel (frontend), Render (backend), Supabase (database) |
| Version control | Git + GitHub |
Intentionally excluded: LangChain, RAG, vector databases, multi-agent frameworks, and unnecessary orchestration layers. The architecture keeps the adaptive policy explicit and understandable.
LearnLoop_AI/
โ
โโโ backend/
โ โโโ app/
โ โ โโโ __init__.py
โ โ โโโ main.py
โ โ โโโ config.py
โ โ โโโ database.py
โ โ โโโ models.py
โ โ โโโ schemas.py
โ โ โโโ seed.py
โ โ โ
โ โ โโโ routers/
โ โ โ โโโ __init__.py
โ โ โ โโโ api.py
โ โ โ
โ โ โโโ services/
โ โ โโโ __init__.py
โ โ โโโ learner_model.py
โ โ โโโ gemini_ai.py
โ โ โโโ mock_ai.py
โ โ โโโ evaluation.py
โ โ
โ โโโ tests/
โ โ โโโ __init__.py
โ โ โโโ test_api.py
โ โ
โ โโโ requirements.txt
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ app/
โ โ โโโ components/
โ โ โโโ lib/
โ โ โโโ types/
โ โโโ public/
โ โโโ package.json
โ โโโ ...
โ
โโโ evaluation/
โ โโโ __init__.py
โ โโโ test_cases.py
โ โโโ run_evaluation.py
โ
โโโ screenshots/
โ โโโ learnloop-light-theme-hero.png
โ โโโ learnloop-dark-theme-hero.png
โ
โโโ .env.example
โโโ .gitignore
โโโ run-local.sh
โโโ README.md
- Python 3.10 or 3.11
- Node.js 18+
- npm
- PostgreSQL / Supabase (production deployment only)
- Gemini API key (live AI mode only)
A Gemini API key is not required to run the application in MOCK/DEMO mode.
MOCK mode runs the entire adaptive workflow without an external AI API.
1. Clone the repository
git clone https://github.com/techAsmita/LearnLoop-AI.git
cd LearnLoop-AI2. Backend setup
cd backend
python3 -m venv .venv
source .venv/bin/activateOn Windows:
.venv\Scripts\activateInstall dependencies and create the environment file:
pip install -r requirements.txt
cp ../.env.example .envStart the backend:
uvicorn app.main:app --reload --port 8000The backend will be available at http://localhost:8000, with interactive API docs at http://localhost:8000/docs.
3. Frontend setup
Open a second terminal:
cd LearnLoop-AI/frontend
npm install
echo "NEXT_PUBLIC_API_URL=http://localhost:8000" > .env.local
npm run devOpen http://localhost:3000.
To enable live Gemini-powered diagnosis and intervention generation:
- Create a Gemini API key through Google AI Studio.
- Add the key to
backend/.env. - Disable MOCK mode.
GEMINI_API_KEY=your_key_here
MOCK_MODE=falseThe deterministic learner-model policy continues to control critical state updates and intervention selection.
If a Gemini request fails, the application falls back to demo mode so the learning workflow continues instead of crashing.
- Local development: SQLite
- Production: PostgreSQL / Supabase
The SQLAlchemy models support both environments. For production, configure:
DATABASE_URL=postgresql://...The application initializes the required tables on startup.
Backend
GEMINI_API_KEY=
MOCK_MODE=true
DATABASE_URL=sqlite:///./learnloop.db
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000Frontend
NEXT_PUBLIC_API_URL=http://localhost:8000Security: never commit real credentials. These are intentionally ignored by Git:
.env
.env.local
*.db
node_modules/
.next/
.venv/
A sanitized .env.example is included for reproducible setup.
LearnLoop does not depend entirely on successful LLM calls. Because AI-generated reasoning and content are separated from deterministic learner-state management, the system can:
- Continue operating in MOCK/DEMO mode
- Fall back when Gemini is unavailable
- Test adaptive decisions deterministically
- Reproduce learner-state transitions
- Evaluate policy behavior independently of an LLM
This matters for a learning product, where an external model failure should not destroy the learner's session. The core adaptive behavior can also be reproduced locally without a paid AI service by running pytest -v and python ../evaluation/run_evaluation.py.
The interface is built around the learner's current state rather than a generic chatbot window. The dashboard surfaces:
- Current mastery
- Learning progress
- Active learner state
- Current lesson / intervention
- Adaptive next step
- "Why this next?"
The goal is to make the system's adaptation visible to both the learner and the evaluator.
AI tools were used during development and are disclosed here as required by the Build Fast with AI challenge.
1. Gemini API โ used in the product itself
Gemini is integrated into LearnLoop for learner-response diagnosis, misconception detection assistance, structured diagnostic output, and intervention content generation. The application does not delegate the entire learner model to Gemini; deterministic Python logic controls learner-state updates and intervention policy.
2. Grok โ development assistance
Used for frontend development, code generation, UI implementation, and development iteration. Generated code was integrated, tested, modified, and validated as part of the project.
3. ChatGPT โ development and engineering assistance
Used for architecture discussion, debugging assistance, code review and refinement, API and backend reasoning, evaluation design, documentation, testing strategy, and deployment preparation. All suggestions were reviewed and adapted to the project's actual implementation.
AI assistance was used as a development tool; the final architecture, integration, testing, evaluation design, and project decisions were made and validated by the team.
Why not make Gemini responsible for everything? Learner-state transitions and intervention policy need to be testable and explainable.
Why not use a vector database? The problem does not require semantic retrieval over a large document corpus. The MVP focuses on learner adaptation, not knowledge retrieval.
Why not use LangChain? The architecture does not require an orchestration framework. Direct model integration keeps the system simpler and easier to inspect.
Why not use multiple agents? The core challenge is learner adaptation. Additional agents would add complexity without improving the central adaptive loop.
Why use an explicit learner model? Because the central product claim is not "The AI can explain AI." It is:
"The AI changes what it teaches based on what it learns about the learner."
LearnLoop's current implementation focuses on the core adaptive learning loop. Potential next steps include:
- Richer learner modeling โ incorporate long-term learning patterns, response-time signals, and concept dependencies.
- Expanded evaluation โ evaluate adaptation with larger controlled datasets and eventually real learner studies.
- Adaptive coding practice โ add executable coding exercises whose difficulty changes with learner performance.
- Knowledge graph integration โ model prerequisite relationships between AI/ML concepts.
- Multimodal tutoring โ support diagrams, visual explanations, and eventually voice-based interaction.
- Teacher / mentor analytics โ provide aggregated insights into learner progress and recurring misconceptions.
- Long-term personalization โ adapt learning paths across multiple sessions and concepts rather than a single learning cycle.
| Member | Responsibility |
|---|---|
| Asmita Roy | Project Lead ยท AI / Backend |
| Akshita | Data & Evaluation |
| Yogita Rana | Development & Testing |
Built for: Build Fast with AI โ AI Build Challenge 2026 Problem Statement: PS-03 โ Personalised AI Tutor for Learning AI Team: RudraCore
| Deliverable | Status |
|---|---|
| Runnable project | โ |
| GitHub repository | โ |
| Deployment | โ |
| 3-minute demo video | โ |
| Project PPT (max 10 slides) | โ |
| AI tools disclosure | โ |
LearnLoop AI is an adaptive AI tutor built around an explicit learner model. It maintains mastery, confidence, misconceptions, history, and intervention history, and continuously updates that state:
Diagnose โ Detect โ Intervene โ Reassess โ Adapt
The next action is determined by the learner's current state, not by a fixed learning path.
Most tutors know the subject. LearnLoop learns the learner.

