TutorTrap: Project Details

Project Story

About the project

TutorTrap is an AI-powered diagnostic learning experience for introductory physics. It goes beyond traditional educational tools to identify not just whether a learner is wrong, but why they're wrong.

The Problem

Most educational tools excel at one thing: telling a learner whether an answer is wrong.

They struggle with the more important question:

Why is the learner wrong?

Two students can give the same incorrect answer while holding completely different mental models. Giving both students the same explanation is not truly adaptive learning.

TutorTrap was built around a simple idea:

Don't just detect the mistake. Detect the misconception behind it.

What TutorTrap Does

TutorTrap presents learners with a plausible but incorrect educational claim. Instead of a traditional quiz, learners must decide whether they agree or disagree and explain their reasoning in their own words.

TutorTrap then:

  1. Analyzes the learner's reasoning
  2. Identifies the underlying misconception
  3. Shows evidence from the learner's own explanation
  4. Generates a targeted follow-up intervention
  5. Checks whether the misconception has actually been resolved

The Complete Loop

AI-generated trap
      ↓
Learner reasoning
      ↓
Misconception diagnosis
      ↓
Targeted intervention
      ↓
Second reasoning attempt
      ↓
Recovery check
      ↓
Adaptive learner-state update

The key moment is not simply detecting that a learner is incorrect. It is seeing:

misconception detected → targeted intervention → conceptual recovery

Why We Built It

We wanted to explore whether generative AI could be used for something more meaningful than simply answering questions for students.

A generic AI tutor provides an explanation immediately. TutorTrap instead makes the AI behave more like a diagnostic teacher:

First understand the learner's mental model. Then decide how to teach.

A Concrete Example

Consider the classic physics misconception that heavier objects fall faster.

A learner might write:

"I agree because a heavier object has more mass, so gravity pulls on it with more force and therefore it accelerates faster."

A conventional quiz would simply mark the answer wrong.

TutorTrap identifies the reasoning pattern:

Greater gravitational force automatically means greater acceleration.

It then generates a follow-up designed specifically to challenge that misconception rather than giving a generic gravity explanation. Finally, the learner is asked to reason again, allowing the system to check whether their conceptual model changed.

How We Built It

TutorTrap is intentionally implemented as a single self-contained Jupyter notebook so the complete system can be understood and run without a large backend.

Architecture

The system has two clearly separated responsibilities.

Generative AI

Groq-hosted language models perform the semantic tasks:

  • Generating plausible misconception-based claims
  • Interpreting free-form learner reasoning
  • Diagnosing misconceptions
  • Generating targeted interventions
  • Evaluating recovery

Transparent Learner Model

Python manages the adaptive state:

  • Concept mastery
  • Misconception history
  • Misconception confidence
  • Attempts
  • Resolution state
  • Session history

This is deliberately not presented as a black-box ML model. The learner model uses transparent, inspectable logic while the LLM provides the semantic reasoning.

Canonical Knowledge

Each concept has a canonical physics explanation and known misconception seeds.

The generated claim is validated against this canonical knowledge before being shown to the learner. This creates an important trust boundary:

Canonical concept truth
        ↓
AI claim generation
        ↓
AI validation
        ↓
Learner

The LLM is therefore not treated as the unquestioned source of truth.

Technology Stack

TutorTrap was built with:

  • Python
  • Groq API
  • Generative LLMs
  • Gradio
  • Jupyter Notebook
  • Transparent adaptive learner modeling
  • Structured JSON outputs for AI pipeline components

The prototype currently focuses on introductory physics, with a reusable concept-library architecture that can be extended to additional subjects and concepts.

What We Learned

Building TutorTrap changed how we thought about "adaptive learning."

We initially approached the problem as if the main goal were generating better questions. The more important insight was that the learner's reasoning is itself valuable data.

An incorrect answer does not tell a tutor enough. A learner's explanation can reveal:

  • Which rule they are applying
  • Which relationship they misunderstand
  • How confident they are
  • What kind of intervention might help

We also learned that putting an LLM in the center of an educational system is not enough by itself. The system needs explicit grounding, validation, structured outputs, and transparent state updates to make the behavior understandable and reliable.

Challenges

Pipeline Reliability

One of the biggest engineering challenges was making the LLM pipeline reliable enough for an interactive demo. TutorTrap uses multiple AI stages:

claim generation
      ↓
claim validation
      ↓
reasoning diagnosis
      ↓
intervention generation
      ↓
recovery check

Each stage can fail independently, so we added structured JSON parsing, retries, model discovery, validation, and concept-specific fallbacks.

We also deliberately avoided treating every Groq model as interchangeable. TutorTrap selects from compatible generative chat models rather than accidentally selecting specialized classification or safety models.

Scope Management

Another challenge was keeping the system small. It would be easy to build accounts, dashboards, databases, analytics pipelines, and a full learning platform. We chose not to.

The prototype focuses on one question:

Can AI identify a misconception, respond specifically to it, and verify recovery?

What Makes TutorTrap Different

TutorTrap is not primarily a chatbot.

It is not primarily a quiz generator.

It is not a black-box prediction model.

It is a misconception-aware intervention loop.

The system deliberately creates a learning moment where the learner's reasoning becomes visible, then adapts the next teaching step to that reasoning.

That makes the recovery check the core product feature:

TutorTrap doesn't stop when the learner gets the answer right. It asks whether the learner's thinking changed.

Future Direction

The current prototype focuses on introductory physics to make the learning loop easy to demonstrate.

The architecture can be extended with:

  • Additional subjects
  • Richer misconception taxonomies
  • Longitudinal learner histories
  • Teacher-facing intervention analytics
  • Intervention effectiveness evaluation
  • Human evaluation of diagnostic accuracy

The goal is not to build a larger dashboard. The goal is to make the diagnose → intervene → recover loop increasingly accurate and useful.


TutorTrap

Challenge the tutor. Reveal the misconception

Built With

Share this project:

Updates

Submission history