The Primer
An AI tutor that teaches young children reading, writing and arithmetic. I built it as a real platform and not as a demo, because I wanted to know what it takes.
- Status
- Personal project, in development
- Stack
- TypeScript, React, Hono, SQLite; Python and Pipecat for live voice
- Methods
- Tool-calling agents, real-time voice, vision, spaced repetition
The problem
A good private tutor does something that a worksheet cannot. The tutor watches the child work, sees the exact thing that confuses them, and changes the next step. Most educational software gives a fixed sequence and marks the answers.
A language model can have that kind of conversation. The hard part is everything around it:
- What do you teach next?
- Has the child learned something, or were they lucky?
- How do you keep a model that improvises on the curriculum?
What I built
The teaching logic is a core that does no input or output at all. It holds four things:
- a graph of 157 skills for reading, writing and maths, from kindergarten to year 6
- a model of what the child has mastered
- a placement for the first session, done as a search over the graph
- a schedule that brings each skill back at growing intervals
The model leads the conversation. It does not decide the curriculum.
Around the core, these are the parts I found most interesting:
- Two voice paths, one brain. In the first, each step is separate: the microphone, speech recognition, the tutor, speech synthesis. In the second, the browser holds a live call with a Python agent that runs a realtime model. Both go through the same tool runtime.
- The tutor can look. One vision call lets it see what the child drew: traced letters, or working on the scratch paper. The platform checks the verdict before it reaches the session. No drawing is stored, and there is a switch that turns this off.
- It fails in steps. Cloud speech falls back to a local voice, then to the voice of the browser. With no API keys at all, a fixed mock tutor still runs the complete platform.
- You can type everything. It is made for touch on a tablet, but nothing needs speech or a touchscreen.
What I learned
- Keep the curriculum out of the model. A model improvises. With the plan in ordinary code, the model cannot leave the plan.
- Code with no input or output is code that you can test. The core is fully unit-tested. The tests need no model, so they are fast and they give the same result each time.
- One tool runtime for every path. A second way to talk to the tutor did not need a second copy of the rules.
- Build the path with no keys. The mock tutor made every other part testable with no paid service.
- Check what the model says it saw. A verdict about a child's drawing goes through a check before the session can use it.