Evaluation Patterns for Deep Agents in Production

The LangChain Team3 Dec 2025

Problem

Teams shipping long-running LLM agents find the classic eval loop too narrow: one dataset, one evaluator, one score on the final message. An agent can give a fine answer after a wrong tool call, or skip a state update such as writing a memory file. Untested trajectories and state let regressions through. Full runs are also slow and flaky when they hit live services.

Example from the article: a calendar agent is told "remember to never schedule meetings before 9am". The test must show that it edited its memory file, told the user, and that the file holds the rule.

Solution in brief

Write each test case as its own small program with assertions on trajectory, final response and state. Run the agent at the smallest scope that answers the question: one step, one full turn, or several turns with checks between. Reset the environment per test and replay recorded API calls.

Questions this case answers
  • How to evaluate a stateful multi-step LLM agent when one shared evaluator and a final-answer score cannot express each case's success criteria
  • How to keep agent regression tests cheap, deterministic and debuggable when runs are long and depend on external systems
  • How to test an LLM agent when each test case needs its own success criteria
  • How to check that an agent chose the right tool and arguments at one decision point without running the whole task

Tools and methods

  • Bespoke assertions per test case — code checks on tool calls, regex or LLM-as-a-judge on text and files.
  • Single-step, full-turn and multi-turn runs — three run scopes.
  • LangSmith Pytest and Vitest integrations — log each test's inputs, outputs and feedback to an experiment.
  • LangGraph interrupt_before — stops before the tools node.
  • Clean per-test environment and HTTP replay (vcr) — fresh directory or container per test, recorded requests instead of live APIs.
Continue reading — it's free

Google or a one-time email code. No password.