
Every eval pushes the agent
Deep Agents is an open source, model-agnostic agent harness: it works with any model. It powers LangChain products like Fleet and Open SWE. To improve it, the team has been curating evals: tests that check whether the agent does its job well.
The article's starting point is that every eval is a vector that shifts the behavior of the system. If a test for efficient file reading fails, you'll probably tweak the system prompt or the description of the read_file tool until it passes. Every test you keep applies pressure on the whole system, and that pressure adds up over time.
That's why you need to be careful about which tests you add. It's tempting to throw in hundreds, or thousands, without looking, and that creates an illusion: the agent scores better and better on a suite that may not reflect what matters in production. In the article's words: more evals ≠ better agents. What works is targeted tests that reflect the behaviors you want in production.
Instead of running whole benchmarks and keeping the aggregate, they follow three steps:
- Decide which behaviors they want, like retrieving content spread across several files or chaining five or more tool calls, and find tests that measure them in a verifiable way.
- Document each test with a docstring that explains which capability it measures, and tag it with categories like
tool_useso tests can run in groups. - Read the output traces to understand failure modes and adjust coverage.
Every run is traced to a shared LangSmith project, so anyone on the team can jump in to analyze a failure, fix it, or rethink whether a test is still worth keeping: responsibility is shared. And there's a cost reason too: running many models on many tests gets expensive, and targeted tests save money while improving the agent.
Where the tests come from
The tests come from three places:
- Dogfooding: using their own agents every day.
- External benchmarks, like Terminal Bench 2.0 or BFCL, where they pick tasks and often adapt them to a particular agent.
- Artisanal tests, written by hand for the behaviors they consider important.
Since they use their agents every day, every mistake is an opportunity: write a test and update the agent definition and its context engineering. The article shows a real case in Slack: Harrison Chase tells their bot it's wrong about LangChain middleware, and the bot admits it had oversimplified. That kind of failure is exactly what a test is made of.
To find failures, what helps most is traces: the data on how the agent behaves. Since they're often huge, they analyze them with another agent, like Polly or Insights, inside LangSmith. You can do the same with other agents, like Claude Code or the Deep Agents CLI, plus a way to pull down traces, like the LangSmith CLI. The goal is to understand each failure mode, propose a fix, rerun the agent, and track progress and regressions over time.
One example is Open SWE, their open source background coding agent. According to the article, a large fraction of their bug-fix pull requests now go through it. Teams using it touch many different codebases, each with its own context, conventions and goals, which naturally leads to mistakes. Since every interaction is traced, each mistake can easily become a test so it doesn't happen again.
Other tests are pulled from benchmarks and adjusted, like BFCL for function calling. For coding, they integrate with Harbor to run selected Terminal Bench 2.0 tasks in sandboxed environments. And many are written from scratch: focused tests that watch one isolated behavior, like using the read_file tool properly.
An important distinction: the SDK's unit and integration tests (system prompt passthrough, interrupt config, subagent routing) are kept separate. Any model passes them, so including them in the score adds no signal. You should absolutely write them, but the article focuses only on evals that measure model capability.
Group them by what they measure
A taxonomy helps: a middle view of how the agent performs, neither a single number nor a pile of individual runs. The advice is to group tests by what they test, not by where they come from. If you tag tasks from FRAMES and BFCL as "external benchmarks", you won't see that one set measures retrieval and the other measures tool use.
These are their categories:
file_operations: file tools (read, write, edit, ls, grep, glob), parallel invocation and pagination.retrieval: finding information across files, search strategies and multi-hop document synthesis.tool_use: selecting the right tool, chaining multi-step calls and tracking state across turns.memory: recalling seeded context, extracting implicit preferences and persisting durable info.conversation: asking clarifying questions for vague requests and sustaining multi-turn dialogue with correct actions.summarization: handling context overflow, triggering summarization and recovering info after compaction.unit_tests: SDK plumbing, kept apart from the rest.
Today every test is an end-to-end run of the agent on a task, and they deliberately keep the structure diverse: some finish in a single step from the input prompt, while others take more than ten turns, with another model simulating the user.
Correctness first, then efficiency
When choosing a model for the agent, they start with correctness. If a model can't reliably complete the tasks that matter, nothing else counts. How it's measured depends on the test:
- Most internal tests use custom assertions, like "did the agent parallelize its tool calls?".
- Benchmarks like BFCL use an exact match against the dataset's ground truth.
- When correctness is semantic, like whether the agent saved the right thing to memory, they use LLM-as-a-judge.
Once several models clear that bar, they move to efficiency. Two models that solve the same task can behave very differently: one might take extra turns, make unnecessary tool calls, or move more slowly because of its size. In production, that shows up as higher latency, higher cost and a worse user experience.
On every run they measure five things:
- Correctness: whether the model completed the task correctly.
- Step ratio: observed agent steps / ideal agent steps.
- Tool call ratio: observed tool calls / ideal tool calls.
- Latency ratio: observed latency / ideal latency.
- Solve rate: expected steps / observed latency, with a score of 0 if the task wasn't solved.
Solve rate measures how fast the agent moves through a task. Like the latency ratio, it captures all the time: model round trips, provider latency, wrong turns and tool execution. But for simple tasks where you can define an ideal trajectory, it's easier to work with, because you only need to measure how long that agent took.
With this, picking a model is simple:
- Correctness first: which models are accurate enough on the tasks you actually care about?
- Then efficiency: among the ones that are good enough, which gives the best tradeoff between correctness, latency and cost?
The ideal trajectory: an example
For comparisons to be useful, you need a reference for what good execution looks like beyond accuracy. That reference is the ideal trajectory: the sequence of steps that produces a correct outcome with no unnecessary actions. For simple, well-scoped tasks, the best path is usually obvious. For open-ended ones, they approximate it with the best model they've seen so far, and revisit that baseline as models and harnesses improve.
The article uses a simple request: "What is the current time and weather where I live?". The ideal trajectory resolves the user, then their location, then fetches the time and the weather at once, in parallel, before answering: 4 steps, 4 tool calls and about 8 seconds.
Now another run that is also correct, but makes one extra call (the location details) and runs nothing in parallel: 6 steps, 5 tool calls and about 14 seconds. Same answer, but latency and cost go up, and there are more chances to fail.
With the metrics, that slow run scores:
- Correctness: 1 (it succeeded).
- Step ratio: 6 / 4 = 1.5, 50% more steps than ideal. Lower is better.
- Tool call ratio: 5 / 4 = 1.25, 25% more calls. Lower is better.
- Latency ratio: 14 / 8 = 1.75, 75% slower. Lower is better.
- Solve rate: 4 / 14 = 0.29 expected steps per second. Here, higher is better.
The author points out that these examples are illustrative: a REPL could solve this task even faster, but the tool-calling version makes the idea easier to explain. What matters is the framework: measuring correctness and efficiency together, and turning every run into numbers you can compare across experiments.
How they run them
They use pytest with GitHub Actions to run evals in CI, so every change runs in a clean, reproducible environment. Each test creates a Deep Agents instance with a given model, feeds it a task and computes the correctness and efficiency metrics.
Thanks to the tags, they can run just a subset to save money and run targeted experiments. If the agent needs to process and synthesize lots of local files, they focus on the file_operations and tool_use categories. This is the command from the article:
uv run pytest tests/evals --eval-category file_operations --eval-category tool_use --model baseten:nvidia/zai-org/GLM-5
The whole eval architecture is open source, in the Deep Agents repository.
What's next
The team is expanding the eval suite and doing more work with open models. They announce three things that this article doesn't cover yet:
- How open models measure up against closed frontier models in each category.
- Evals as a mechanism for agents to improve themselves in real time.
- How they maintain, trim and expand each agent's evals over time.
In short
Every test you add pushes your agent, so choose carefully where. Decide first which behaviors matter in production and find targeted tests for them; source them from your own failures, adapted benchmarks and hand-written tests; group them by what they measure; demand correctness first and then efficiency against an ideal trajectory; and run them in continuous integration, by category when you want to save money.
Don't measure more: measure better.
Sources
- "How we build evals for Deep Agents", by Vivek Trivedy, on X (March 26, 2026). Also published on the LangChain blog.
- The eval code, in the Deep Agents repository.
- My post on the anatomy of an agent harness, another article by Vivek Trivedy.
- The video, on my channels: English and Spanish.