← back the engine
Inside the machine that builds the work.
No mystery box. AJ AI is one machine running one loop — classify → route → execute → persist — over real tools, with a deterministic router and an audit that ends with a human. Here's every moving part.
01 by the numbers
The data room, as it stands today
Every figure below is counted, not estimated. This is the real, current state of the engine AJ AI runs on.
02 architecture
One loop, one machine.
Think of it like a tiny operating system. A kernel decides; memory remembers; hands do the work; a clock runs it on a schedule. Every request walks the same four steps.
The kernel is Claude — it reads the request, classifies it, and picks the route. The vault (Obsidian markdown) is canonical memory; SQLite is an append-only ledger for audit, never the source of truth. The hands are Claude Code + Codex, which write and run real code. A scheduler (Windows/NSSM) runs the nightly jobs.
the kernel decides · memory remembers · hands build · the clock runs it
03 models & routing
One deterministic router. Five backends. Zero added cost.
The router isn't another AI deciding — it's plain keyword/prefix matching that sends each request to the right model. No extra LLM call, no extra latency, and the cheap model handles the cheap work.
Heavy reasoning goes to the big models; extraction and classification go to Haiku; offline/free work can run on a local model. Swapping routine classification onto Haiku cut the monthly model bill by roughly half with no quality loss on those tasks.
keyword/prefix match → exactly one backend, every time
04 end-to-end trace
How one request moves through the engine
One operator request, followed all the way down. classify → route → execute → audit → human → persist → deliver. No hand-waving — the real mechanics an engineer can trust.
· the gate inside step 06
The 4-gate audit
Nothing irreversible ships without all four. And a merge-guard hook blocks merge / reset --hard / force-push to main unless a one-shot MERGE-OK token exists.
05 token economics
The economics: ~$400 a month for work that lists at ~$6,150
7.72 billion Claude tokens went into building this stack. Priced at pay-as-you-go API rates, that work would bill out to roughly $6,150 — and it actually runs for a fraction of that.
Where the value sits, by model
The router sends the hard reasoning to Opus and keeps cheap, repetitive work on cheap models. Most of the spend concentrates in two Opus generations doing the heavy build work; the lighter models handle the long tail for cents.
One operator running ~$6,150 of API-rate work for about $400 a month. The router and the cache are what turn that budget into six thousand dollars of output — the cheap work stays cheap, and nothing gets paid for twice.
06 scale
A year of build, from one machine that doesn't sleep
One operator, one machine, and a scheduler that runs through the night. This is the raw throughput behind the system — counted, not estimated.
Volume the operator never typed by hand
Every number here is a side-effect of the same loop running over and over: a session opens, the agent acts, the work gets tested, and the decision gets written down. Run that loop 2,594 times and it compounds into a system no one person could keep in their head.
07 the audit moat
Nothing irreversible ships without passing four gates.
Code, deploys, anything touching money — every one runs the gauntlet. Three machine checks, then a human. That's why you can trust what comes out.
08 guardrails, in code
The guardrails, for real
The audit moat is the policy. This is the wiring underneath it. Speed with a seatbelt — the executors write and run real code at full pace, and a layer of deterministic hooks sits between intent and anything irreversible.
Four hooks, zero judgment calls
These run as Claude Code lifecycle hooks, not LLM checks. They are pattern matches and exit codes — deterministic, fast, and impossible to sweet-talk. A hook either passes or it blocks the tool call before it lands.
The MERGE-OK token
Irreversible git operations on main are denied by default. The only way through is a single-use MERGE-OK token, and that token is created only on an explicit human OK. One token, one merge — it is consumed on use, so a stale approval cannot quietly authorize the next operation.
09 the honest record
The engine writes its failures down
Most of building real AI is paths that go nowhere. Those paths live in the vault instead of getting buried — which is the whole reason to trust the parts that worked.
An honest log, not a highlight reel
Every run leaves a record. The dead ends, the wrong turns, the ideas that tested worse than the thing they were meant to replace — all of it gets logged with the same weight as the wins. A clean story is easy to write after the fact. A complete one is harder, and it is the only kind worth standing behind.
· the independent-audit gate
A second pass catches what the first one misses
Before a result counts, it goes through an independent audit gate. That gate routinely finds real defects a single pass glides past — mis-graded results, wrong numbers, a regression that slipped in silently — and it forces the fix before anything ships. The friction is the point. A claim that survives an adversary you built to break it is a claim you can actually trust.
→ the differentiator
Every result that ships has survived an independent model and a human
The honest record of what didn't work is the reason to believe what did. The engine keeps the receipts, runs its own adversary, and only lets a result stand once it survives the check.
10 the stack
What actually runs it.
Eleven layers, real components, each one chosen for a reason. Plain Python and markdown at the edges, deterministic routing and append-only audit at the core — so the system stays cheap to run, easy to inspect, and impossible to quietly corrupt.
One operator, one machine, a legible stack
There's no exotic infrastructure here. Claude is the reasoning kernel; a deterministic router picks the model and tool per request with zero added LLM cost. The hands are real CLIs that write and run code behind a four-gate audit. Memory is split on purpose — markdown is the truth you read, SQLite is the ledger you can't rewrite.
top: decide · middle: build + check · base: remember, connect, schedule, host
· why the memory is split
Markdown is the truth you read. SQLite is the ledger you can't rewrite.
The vault holds the canonical state — decisions, deliverables, the wiki — as plain markdown, so it's diffable, greppable, and editable by a human without a database client. The SQLite store sits underneath as an append-only audit ledger: it records what happened and never serves as source of truth. Keeping the two apart means a corrupted or contradictory record can't masquerade as canon, and every irreversible action leaves a trail you can replay. A SessionStart hook reloads the wiki index, living status, and user memory into every run — RAM loaded from disk at boot.
honest by design
Built to be trusted because an independent model and a human check everything it ships.
One operator, one machine, a few hundred dollars a month — and a paper trail for every irreversible thing it does.