3 Ways to Save Money on Tokens for Your AI Agents
Your agent bill is mostly input tokens. Not the clever parts: the re-reading.
Terraphim
Your agent bill is mostly input tokens. Not the clever parts: the re-reading.
As AI agents write more and more production code, the question shifts from "can the agent write code?" to "can we verify the code is good?" Two tools tackle this from opposite ends: Sentrux measures structural health, Terraphim measures semantic completeness. Neither is complete without the other.
AWS has published the Context Ontology Accelerator (COA), an Apache-2.0 semantic context layer that runs in your own AWS account and serves AI agents through MCP. It builds context with two techniques. One is a formal ontology induced from your tables. The other is a lexical knowledge graph built from your documents. Its documentation is unusually candid about where the two fall short, and several of those gaps fall where a deterministic concept layer such as Terraphim's fits.
This post reads COA at version 0.3.11 (commit 5dd33d7). It names the gaps in COA's own words and shows what our graph does with them, on a small demo against real code. It also covers the two places where COA already does better than we do.
First published on Reference Architecture for AI.
Every pull request we merge is reviewed by a second model before it lands. The rule is simple: the model that wrote the code never signs it off. We use a different model family as the reviewer, at a fixed rubric, and we merge only when it returns no blocking findings and a confidence of 4 or 5 out of 5.
I like that rule. This week a paper made me look harder at what it actually buys.
A checklist is an enumerated set of terms that must be checked. That is the whole problem, and it is the reason vector embeddings are the wrong tool for it: a nearest-neighbour index returns fuzzy neighbours, it cannot enumerate a fixed set and report which members fired. A knowledge graph can. Write the checklist once as synonyms under a normalised term, compile it into an Aho-Corasick automaton, and every check becomes a deterministic match with a named edge you can audit.
This post shows that machinery applied to the two places a checklist earns its keep around an LLM call: terraphim-grep with a role thesaurus before the call, and terraphim-agent hooks plus learning after it. Every command below was run while writing this article; the outputs are real.
Search-first AI agent with knowledge-graph context, session memory, and failure capture
Read MoreYou know what is embarrassing? Making the same mistake for the tenth time. Last week, I typed docker-compose up instead of docker compose up. The command failed. I sighed. I corrected it. Three days later? Same thing. Same sigh. Same correction.
Builds on Why Graph Embeddings Matter — the deterministic engine that lets Terraphim store and replay corrections in microseconds. Apply the pattern in your own project via the Command Rewriting How-to.
This is the February 2026 announcement for v1.8.1. For the tested failure → reviewed correction → execution flow, follow the current command-rewriting guide.
We are announcing native hook support for terraphim-agent v1.8.1. This feature captures failed commands from AI agents (Claude Code, Codex, OpenCode) and learns from them, creating a personal knowledge base of mistakes and corrections. No more jq dependency, no more bash wrappers: just terraphim-agent learn hook.
Search