Philip Tran
← Blog

Notes on building an AI agent ecosystem

2026-06-13

I work in online advertising, and over the past while I've been building a network of AI agents to handle the diagnostic and reporting work that used to eat up most of my day — checking why an account's spend dropped, producing health reports for clients, working out budget splits. This post is about the architecture that's emerged, not a pitch for it.

The starting problem

A single AI assistant that's supposed to do everything degrades fast. Give it instructions for ten different jobs and it forgets half of them, mixes up output formats, and gets harder to debug every time you add something new. The fix wasn't a smarter model — it was splitting the work into narrow, single-purpose agents and being strict about how they talk to each other.

Five layers

The ecosystem ended up with five layers, each with one job:

Diagram of the agent ecosystem: a request enters through the Agent Manager router, gets dispatched to one of several task agents, which hand off writes to DocsManager, get scored by the Auditor and Quality Judge, and everything reads from a shared knowledge layer

The "one writer" rule

This is the decision I'd point to first if someone wanted to copy one thing. Every agent except DocsManager is read-only. If AccountCheck finishes a diagnostic and needs to log the result, it doesn't write anything itself — it hands the write to DocsManager.

The payoff is boring but real: no two agents can corrupt the same file at the same time, there's exactly one place to look when something's wrong with the stored data, and adding a new agent never means adding a new way for files to get written.

Quality scoring, and why it's silent

After a task agent answers, it gives itself a score out of 10. That score goes to the Auditor, which also asks the Quality Judge — a separate agent that scores the same output without seeing the self-score, to avoid anchoring. Both scores get logged.

None of this is visible to whoever asked the original question — they get their answer and move on. The scoring exists so that an agent's quality can be tracked over time without anyone having to manually review transcripts.

Agents move through a small lifecycle based on these scores:

DRAFT → TESTING → STABLE

An agent gets promoted to STABLE after at least 3 scored runs with an average score of 8/10 or higher and zero flagged issues. If a score drops below 6, that's a flagged issue; three flagged issues sends it back to TESTING and pings me.

What's still missing

Writing this down also made the gaps obvious:

None of these are urgent, but they're the next things to build rather than adding more task agents.

Why files, not platform features

Everything — instructions, schema docs, the agent registry, the standards every agent follows — lives in plain Markdown files, not in platform-specific configuration. The agents themselves are just configurations that point at these files. If I ever move off the current platform, the files are what carry over; the platform is just the thing that executes them.