AI-powered question engine
A model-agnostic architecture where AI generates curriculum-aligned questions through a contract-driven component system with programmatic validation.
Compatible with any LLM that supports structured output via JSON Schema — from cloud-hosted reasoning models to locally-run open-source models like Gemma 3.
System architecture
The complete pipeline from AI model to student-facing questions, with validation at every stage.
Question engine anatomy
Every question is a composable unit — single or multi-part — where each component has defined contracts for rendering, answering, and knowledge node impact.
Question Render Components
Display layer combining LaTeX mathematical notation, Cartesian grids, number lines, and rich text. Each component renders the question visually.
- LaTeX formulas
- Cartesian grids
- Number lines
- Geometric shapes
- Data tables
Answer Components
Interactive input layer where students provide responses. Each type has its own validation logic and can embed mathematical components in read-only mode.
- Multiple choice
- True/false
- Numeric input
- Pairings/matching
- Interactive math
- Free text
Difficulty Engine
Non-AI parametric system that determines value ranges, complexity, and constraints for each question type based on year level and difficulty setting.
- Parameter matrices
- Year-level calibration
- Value range selection
- Complexity scaling
- Component suitability filtering
Component composability
Each multiple choice option is itself a separate entity that can contain its own mathematical render component in read-only mode. This means an answer option can display a LaTeX formula, a graph, or a geometric diagram — not just text. The same composability applies to all answer types, enabling arbitrarily rich assessment formats while maintaining a consistent validation contract.
Difficulty engine
Deterministic, not AI-driven
Behind every question for every module, there is a difficulty engine calibrated per year level. This engine is not AI-driven — it uses fine-tuned parameters based on aggregate student performance data.
- Determines value ranges and numerical constraints based on difficulty setting
- Maintains a matrix of compatible components per question type
- Filters out inappropriate component combinations automatically
- Parameters continuously refined based on overall cohort results
- For AI-generated questions, difficulty is set by the AI input — the engine validates solvability
Difficulty parameter matrix
AI generation pipeline
How AI transforms a query into a validated, curriculum-aligned question set.
Where AI is used
Question Generation
AI generates individual questions by selecting appropriate components, setting parameters within schema constraints, and producing valid question data.
Question Set Assembly
For multi-part questions spanning multiple submodules, AI selects and combines components that assess different concepts while maintaining pedagogical coherence.
Baseline Test Optimisation
AI designs diagnostic tests that maximise submodule coverage with minimal questions. Year 8 has 44 submodules — AI generates questions touching multiple submodules simultaneously.
Predecessor Reinforcement
Based on mastery data, AI generates questions from prerequisite submodules to harden potentially atrophied skills that underpin current learning goals.
Component Generation
AI is used to build the components themselves — creating new question and answer types that conform to the system's schema contracts and validation requirements.
Vector database
Component registry & search
All question and answer components are stored in a vector database with rich metadata. When AI needs to generate a question, it performs a semantic search to find the most appropriate components for the target concept, year level, and question type.
Each component entry includes its full JSON schema contract — defining exactly what inputs it accepts and what outputs it produces. This is the bridge between AI creativity and system reliability.
Component metadata
Knowledge hardening
Practising higher-level concepts automatically strengthens the prerequisite chain — the engine identifies and reinforces atrophied skills.
Baseline test optimisation
Year 8 Maths has 44 submodules. Testing each individually would require at minimum 44 questions. AI generates questions that touch multiple submodules simultaneously, dramatically reducing the number of questions needed while maintaining comprehensive diagnostic coverage.
Predecessor reinforcement
When mastery data shows a student struggling with a higher-level concept, AI generates targeted questions from prerequisite submodules across previous years. This hardens the foundation before re-attempting the advanced material.
Model agnostic
The architecture works with any LLM that supports structured output via JSON Schema — plug in any model, from frontier to local.
Why model agnostic?
Because every component interaction is governed by a strict JSON Schema contract, the system doesn't depend on any specific model's capabilities beyond structured output. The LLM's role is to make intelligent selections and fill in parameters — the engine handles all validation and rendering.
Schema
Defines the contract
LLM
Fills the contract
Engine
Validates the contract
Architecture at a glance
JSON Schema
Contract System
Every component defined
Vector DB
Component Search
Semantic retrieval
Any LLM
Model Agnostic
Structured output required
Validated
Every Question
Engine-verified solvable
Kick the tyres properly
Bring your most sceptical maths teacher to the demo. The architecture holds up — that's the point of building it this way.