# Engineering Deterministic AI Coding Agents, second edition

> A field manual in 21 parts, by Mac Anderson of Oxagen. Parts 1 to 13 show how to build the deterministic system around a coding agent, with published evidence in each part. Parts 14 to 20 show how to operate the agents you now run: identity, authority, budget, equipment, and a record another person can read. Every part ends with steps for this week and metrics to track.

By Mac Anderson. 21 parts and 27 cited sources.

- [How to use this book](https://macanderson.com/manual/how-to-use-this-book.md): Read the two parts that match your problem this week. Come back for the rest.
- [Part 1: AI agents are not expensive. Bad architecture is.](https://macanderson.com/manual/agents-are-not-expensive-bad-architecture-is.md): Most of an agent's token bill comes from the system around the model, not from the model.
- [Part 2: Stop making agents read your entire logs](https://macanderson.com/manual/stop-making-agents-read-your-logs.md): Logs are structured data, and treating them as prompt text costs tokens you do not have to spend.
- [Part 3: Parse the user prompt before the model ever sees it](https://macanderson.com/manual/parse-the-prompt-before-the-model-sees-it.md): Your prompt already carries structured information, so extract it before you pay for inference.
- [Part 4: Why grep is the wrong retrieval engine](https://macanderson.com/manual/why-grep-is-the-wrong-retrieval-engine.md): Searching is not understanding, and code already carries the structure you need.
- [Part 5: Build semantic memory once](https://macanderson.com/manual/build-semantic-memory-once.md): A run should start from what the last one learned instead of repeating it.
- [Part 6: A rule written in prose cannot fail CI](https://macanderson.com/manual/rules-belong-in-data-not-in-prose.md): Constraints belong in a representation a validator can check.
- [Part 7: Context compression is worth more than a bigger model](https://macanderson.com/manual/compression-beats-a-bigger-model.md): Removing irrelevant information beats buying a larger model.
- [Part 8: Agents guess at schema they were not shown](https://macanderson.com/manual/show-the-agent-the-schema.md): A model adds a duplicate column when the context did not carry the existing one.
- [Part 9: Why coordinator agents don't scale](https://macanderson.com/manual/why-coordinator-agents-do-not-scale.md): Most multi-agent systems pay a coordination tax and call it architecture.
- [Part 10: Tests should be first-class retrieval objects](https://macanderson.com/manual/tests-as-retrieval-objects.md): Tests describe behavior in executable form, and a test runner's verdict is computed rather than inferred.
- [Part 11: Agents need working memory, not bigger context windows](https://macanderson.com/manual/working-memory-not-bigger-windows.md): You do not reread every book you own before fixing a bug, and your agent should not either.
- [Part 12: Knowledge graphs beat prompt engineering](https://macanderson.com/manual/knowledge-graphs-over-concatenation.md): Knowledge should be connected, not concatenated.
- [Part 13: Measuring agent intelligence](https://macanderson.com/manual/measuring-an-agent-in-production.md): Benchmarking on coding challenges misses what matters in production.
- [Part 14: Give every agent its own identity](https://macanderson.com/manual/give-every-agent-its-own-identity.md): You cannot set authority for, bill, or review something you cannot name.
- [Part 15: Write the mandate](https://macanderson.com/manual/write-the-mandate.md): Four decisions govern an agent. Most teams have made all four. Few have them in one place.
- [Part 16: The agent asks, a rule decides](https://macanderson.com/manual/the-agent-asks-a-rule-decides.md): Authority is a decision at the moment of use, written down by the team that owns the system.
- [Part 17: Spend you can attribute](https://macanderson.com/manual/spend-you-can-attribute.md): A total is not an answer. The answer is which agent spent what, and on whose behalf.
- [Part 18: Equip agents on purpose](https://macanderson.com/manual/equip-agents-on-purpose.md): A tool in the catalog is not a tool in the agent's hands. Assign equipment the way you assign access.
- [Part 19: Keep a record another person can read](https://macanderson.com/manual/keep-a-record-another-person-can-read.md): A log answers the engineer who wrote it. A record answers the person who was not there.
- [Part 20: Bounded tasks and ongoing work](https://macanderson.com/manual/bounded-tasks-and-ongoing-work.md): Some work has an endpoint. Other work continues. Manage each in its own way.
- [Part 21: Better systems, not better models](https://macanderson.com/manual/better-systems-not-better-models.md): You rent the model. You own the system around it, and the way you operate it.
- [Closing thought](https://macanderson.com/manual/closing-thought.md): Intelligence is expensive. Determinism is cheap. Spend the first only where the second cannot do the job.
- [Field kit](https://macanderson.com/manual/field-kit.md): Templates and worksheets to copy. Print this section and fill it in with the people who own each line.
- [Glossary](https://macanderson.com/manual/glossary.md): The words this book uses in a fixed sense.
- [About the author](https://macanderson.com/manual/about-the-author.md): Oxagen is workforce management for autonomous agents: give each agent an identity, set its authority and budget, equip it with tools and skills, and review…
- [Sources](https://macanderson.com/manual/sources.md): Every empirical claim in this book traces to one of the sources below. Read the primary literature. It is better than any summary of it, including this one.…
