Every agent passed its tests
(how to evaluate a graph of agents)
A lot of agent systems today aren't a single agent. They're a graph: several agents whose outputs branch out, merge and sometimes loop back, and every arrow between two agents is a handoff.
The usual way to test that is to check each agent on its own, then run the whole thing end to end and look at the score.
We did both with our own memory system, tested on BEAM, a public benchmark for long-term memory, and nothing looked wrong. It still had a bug that quietly marked most of the preferences users told it about as out of date.
How the system works
Here's how the system works. A writer agent reads each conversation and saves facts about the user, and a reader agent answers questions from those facts. In between sits a memory store. Some facts can only have one value at a time, like the city you live in, so when a new value comes in, the store retires the old one.
The writer saved preferences as that kind of fact. So every time a user mentioned a new preference, the store retired the previous one, even when the two had nothing to do with each other.
In one of BEAM's conversations, the user said they prefer practicing in the evening. Later they said they prefer practicing shooting on Sundays, and the first preference was marked "no longer true". Then they mentioned they prefer bus travel for soccer trips, and the second one was gone too.
In the BEAM memories we checked, 133 out of 176 preferences had been retired this way.
The bug lived in the handoff
Neither agent was wrong on its own. The writer saved valid facts, and the store followed its rule exactly. The bug lived in the handoff between them, because "this fact has one value" meant one thing to the writer and something else to the store.
The average hid it
The end-to-end score didn't catch it either. After we fixed it (and also showed the reader each user's current preferences), questions about preferences went up 9.2 points, but the overall score moved by −0.6, which is within the noise. A bug that badly hurts one kind of question can disappear inside an average.
What found it was reading the failed preference questions one by one. Each time, the preference was either missing or marked "no longer true".
That habit also kept us from fixing the wrong thing. Most people would blame retrieval first, but when we traced 34 questions we kept failing in four question types, retrieval caused only one of them. Even handing the reader the entire memory improved the score by less than a point.
What to test in a graph of agents
So when you evaluate a graph of agents, test four things:
- Each agent on its own job.
- Each handoff. Write down what the data means on both sides, and check real traffic against it, for example "a new fact can only retire an old fact about the same thing."
- The whole graph on the real task, broken down by type of question instead of one average.
- The cost of each successful task.
In our experience, the bugs that hurt the most live between the agents, where no single agent's test is looking.
