AI engine
A glass-box Claude architecture tuned for an 8-year-old. Every reasoning step is visible, every patch is reversible, every output is moderated on both sides of the model call. This is the product IP.
The AI engine is the load-bearing piece of Tekku. It is what turns a kid idea into a shipped URL without losing safety, pedagogy, or parent legibility on the way. The shape of the engine is deliberate and, at each layer, the tradeoffs are readable.
This page walks the full turn. Kid input arrives. The moderation layer runs. The Claude call fires with a cached system prompt and a cached per-template prompt. The model responds with a tool call (submit_patch or checkpoint_question). The response is moderated again. The concept detector labels the code. The snapshot is written. The parent view updates. Everything below is the detail under each of those boxes.
Per-turn architecture
Provider matrix
Primary model, moderation, fallbacks. The architecture can survive any one of these providers breaking. Switching cost grows with the prompt-cache and fine-tune surface, not with the code path.
| Primary use | Cost per 1M | Latency | Availability | Switching cost | ||
|---|---|---|---|---|---|---|
| Anthropic (Claude Sonnet 4.6) | Kid-facing reasoning and tool calls | $3 in / $15 out (cache $0.30 / $3.75) | TODO(ai-engine): p50/p95 from observability | Hot path, primary | Moderate: prompt cache warmth, evaluation suite | |
| Anthropic (Claude Haiku) | Stage 2 concept classifier (TODO-002) | $0.80 in / $4 out (approx) | Sub-second | Stage 2, not yet wired | Low: classifier is one call with a strict schema | |
| OpenAI (omni-moderation-latest) | Pre and post-model content moderation | Included with OpenAI account | 10-second timeout, usually under 200ms | Hot path, primary | Low: moderation is a single call behind a wrapper | |
| OpenAI (GPT) fallback | Cold-swap if Anthropic availability breaks | Comparable tier pricing | Comparable | Contingency only. TODO(ai-engine) | Moderate: different tool-call schema, different safety posture | |
| Vercel (Blob + hosting) | Kid ship pipeline and shared artifact URLs | Platform cost, not per-turn | Edge-cached | Hot path, ship flow | Low at Stage 1: Next.js app, portable | |
| Supabase | Auth, parent-kid linkage, transcripts, snapshots | Platform cost | Fast-path reads | Hot path, persistence layer | Moderate: RLS rules and schema are portable Postgres |
Latency p50/p95, cache hit rates, and false-positive rates are TODO(ai-engine) until the observability dashboard publishes them. We will not hand-wave numbers here.