How do I evaluate a LangGraph agent?
Grade it against a fixed dataset at three levels: the final output, the path the run took through the graph, and single nodes, because a right answer can come from a wrong path and a wrong one can start in a single node. LangSmith’s evaluate() takes the compiled graph as its target, and LangChain’s docs call grading the final output the most common kind.
The path is where agents differ from a single model call. LangChain’s open-source agentevals package compares a run’s trajectory with a reference one in four modes: strict wants the same tool calls in the same order, unordered the same calls in any order, superset allows extra calls, and subset forbids them. Its graph-trajectory evaluators read which nodes ran from a LangGraph thread, interrupts included, so a pause for human input counts as a step. It can also hand the trajectory to an LLM judge instead of a reference.
Single nodes you can call directly. A reference trajectory records one acceptable route, so pick the loosest mode your policy allows: strict fails an agent that found a different, valid order.
published