This file provides guidance to Claude Code when working with code in this repository.
ExamTutor - An AI-powered learning platform for UK students preparing for 11+ entrance exams and GCSEs. Built on the architecture of DeepTutor/AIEducator.
- Backend: Python 3.12+, FastAPI (port 8001)
- Frontend: Next.js, React, TailwindCSS (port 3782)
- RAG Engine: LightRAG for knowledge graph-based retrieval
- LLM Support: OpenAI, Ollama, LM Studio
- Content API: Oak National Academy (Open Government License)
src/
├── api/ # FastAPI backend endpoints
├── agents/ # AI agent implementations (explain, practice, mock_exam)
├── knowledge/ # RAG and curriculum knowledge base
├── question_bank/ # Question storage and retrieval
├── progress/ # Student progress tracking
├── tools/ # Tools for agents
└── core/ # Core utilities and configuration
web/
├── app/ # Next.js app router pages
├── components/ # React components
├── context/ # React context providers
└── lib/ # Utility functions
data/
├── curriculum/ # National curriculum documents
├── questions/ # Question bank data
└── oak_content/ # Cached Oak Academy content
config/
├── main.yaml # Server configuration
├── agents.yaml # Agent configurations
└── exams.yaml # Exam board specifications
# Create Python virtual environment
python3.12 -m venv venv
source venv/bin/activate
# Install Python dependencies
pip install -r requirements.txt
# Install frontend dependencies
cd web && npm installsource venv/bin/activate
python scripts/start_web.py
# Frontend: http://localhost:3782
# Backend: http://localhost:8001/docspytest tests/
cd web && npm run lint- Base URL: https://open-api.thenational.academy/
- License: Open Government License
- Used for: Curriculum-aligned lessons, videos, quizzes
- Link to official sources, don't host
- AQA: https://www.aqa.org.uk/find-past-papers-and-mark-schemes
- Edexcel: https://qualifications.pearson.com/en/support/support-topics/exams/past-papers.html
- Primary: Oak API content (free, legal)
- Secondary: AI-generated questions based on patterns
- Tertiary: Links to official exam board resources
- GL Assessment (most common)
- CEM (Durham University)
- Subjects: Verbal Reasoning, Non-Verbal Reasoning, Maths, English
- AQA, Edexcel, OCR, WJEC
- Core: English, Maths, Science
- Options: History, Geography, Languages, etc.
PLAN.md- Comprehensive project plan and researchsettings.py- Pydantic settings for configurationconfig/exams.yaml- Exam specifications and question types
These bugs were reported by Jon after real-world testing. Fix all 4:
Problem: The same question appears multiple times within a single practice test.
Fix: Track question IDs/hashes within a test session. Before presenting a question, check it hasn't already been shown. Use a Set of question hashes (question text + options) to deduplicate.
Files: src/agents/practice_agent.py — generate_question() needs a session-level dedup mechanism.
Problem: Code word questions have answers that are too obvious because each coded word starts with different letters. Need more distractors that share the same first 1-2 coded letters.
Fix: In _build_vr_prompt() for code_words type, update the generation prompt to explicitly require:
- Multiple answer options must share the same first 1-2 coded letters
- Distractors should be plausible (only differ by 1-2 letters from correct answer)
- Add instruction: "Make sure at least 2-3 options start with the same coded letters to increase difficulty"
Files:
src/agents/practice_agent.py—_build_vr_prompt(), thecode_wordsexample/instruction section.
Problem: The alphabet/letter line helper is displayed for question types that don't need it (should only show for code words, letter sequences, etc.)
Fix: Only render the letter line component when question_type is in a whitelist: ['code_words', 'letter_codes', 'letter_sequences', 'code_breakers']. Check both the backend response and frontend rendering.
Files: Frontend — check web/app/practice/page.tsx and related components for letter line rendering logic.
Problem: Same questions keep coming back across different practice sessions.
Fix: Store a history of recently-seen question hashes (last 200-500) in the student progress/session state. Exclude these when generating or selecting new questions. If the question bank is small for a type, allow repeats only after all questions have been seen.
Files: src/progress/ for tracking, src/agents/practice_agent.py for filtering.