Skip to content

About

๐Ÿง  Adaptive AI tutor that learns the learner โ€” detecting misconceptions, adapting interventions, and tracking mastery.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

17 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

LearnLoop AI

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 ยท

LearnLoop AI โ€” Light Theme

LearnLoop AI โ€” Dark Theme


๐Ÿš€ Live Project

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

Recommended demo path

High-confidence misconception โ†’ Targeted intervention โ†’ Reassessment โ†’ Learner-state update

This demonstrates the complete adaptive loop rather than only showing generated AI content.


๐Ÿง  What is LearnLoop?

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.

The Adaptive Loop

Diagnose โ†’ Detect โ†’ Intervene โ†’ Reassess โ†’ Adapt

Same concept. Different learner state. Different next action.


๐Ÿ”„ Core Adaptive Loop

Learner State(t) + New Evidence
            โ†“
       Policy Decision
            โ†“
      Intervention
            โ†“
       Reassessment
            โ†“
Learner State(t + 1)
  1. Diagnose โ€” The learner submits an answer, their reasoning, and a confidence level. The system evaluates the response and builds a diagnosis.

  2. 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.
    
  3. Select intervention โ€” A deterministic learner-model policy chooses the intervention based on mastery, confidence, correctness, misconception presence and confidence, previous intervention, and reassessment history.

  4. 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.

  5. Reassess โ€” The learner gets a follow-up question designed to check whether the underlying misconception has been addressed.

  6. 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
    
  7. Adapt โ€” The next intervention is selected using the updated learner state.


โœจ What Makes LearnLoop Different?

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.


๐ŸŽฏ Problem Statement

PS-03 โ€” Personalised AI Tutor for Learning AI

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.


๐Ÿ’ก Our Solution

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.


๐Ÿ—๏ธ System Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                Learner / UI                 โ”‚
โ”‚          Next.js + TypeScript               โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
                       โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  FastAPI                    โ”‚
โ”‚                 API Layer                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                       โ”‚
          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
          โ”‚            โ”‚            โ”‚
          โ–ผ            โ–ผ            โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚   Gemini     โ”‚ โ”‚ Learner      โ”‚ โ”‚ PostgreSQL / โ”‚
โ”‚ Diagnosis &  โ”‚ โ”‚ Model +      โ”‚ โ”‚   Supabase   โ”‚
โ”‚ Content      โ”‚ โ”‚ Policy       โ”‚ โ”‚              โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
                        โ–ผ
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚ Adaptive Learning   โ”‚
             โ”‚      Loop           โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿค– AI Architecture

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.


๐Ÿง  Learner Model

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.


๐ŸŽฏ Adaptive Intervention Policy

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

๐Ÿ“Š Evaluation

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.py

The 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.


๐Ÿงช Test Coverage

cd backend
source .venv/bin/activate
pytest -v

The 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

๐Ÿ–ฅ๏ธ Demo Scenarios

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.

3-minute demo flow

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

๐Ÿ› ๏ธ Technology Stack

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.


๐Ÿ—‚๏ธ Project Structure

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

โš™๏ธ Local Setup

Prerequisites

  • 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.

โ–ถ๏ธ Quick Start โ€” 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-AI

2. Backend setup

cd backend

python3 -m venv .venv
source .venv/bin/activate

On Windows:

.venv\Scripts\activate

Install dependencies and create the environment file:

pip install -r requirements.txt
cp ../.env.example .env

Start the backend:

uvicorn app.main:app --reload --port 8000

The 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 dev

Open http://localhost:3000.


โœจ Running with Gemini

To enable live Gemini-powered diagnosis and intervention generation:

  1. Create a Gemini API key through Google AI Studio.
  2. Add the key to backend/.env.
  3. Disable MOCK mode.
GEMINI_API_KEY=your_key_here
MOCK_MODE=false

The 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.


๐Ÿ—„๏ธ Database

  • 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.


๐Ÿ” Environment Variables

Backend

GEMINI_API_KEY=
MOCK_MODE=true
DATABASE_URL=sqlite:///./learnloop.db
CORS_ORIGINS=http://localhost:3000,http://127.0.0.1:3000

Frontend

NEXT_PUBLIC_API_URL=http://localhost:8000

Security: 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.


๐Ÿ›ก๏ธ Reliability and Failure Handling

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.


๐ŸŽจ Product Design Principles

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 Disclosure

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.


๐Ÿงญ Design Decisions

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."


๐Ÿ”ฎ Future Improvements

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.

๐Ÿ‘ฅ Team RudraCore

Member Responsibility
Asmita Roy Project Lead ยท AI / Backend
Akshita Data & Evaluation
Yogita Rana Development & Testing

๐Ÿ† Challenge Submission

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 โœ…

๐Ÿ“Œ Project Summary

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.

About

๐Ÿง  Adaptive AI tutor that learns the learner โ€” detecting misconceptions, adapting interventions, and tracking mastery.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages