What is a Graph Trajectory and how is it structured?
mainFor graph-based agents (like LangGraph), agentevals uses a graph trajectory format instead of simple message lists. This format represents trajectories in terms of nodes visited (steps) rather than just messages, making it easier to evaluate complex agent behaviors like tool calls and interrupts.
A GraphTrajectory consists of:
inputs: A list of inputs representing the start of new invocations in a thread.results: The final output from each turn in the thread.steps: A list of lists representing the internal nodes/steps taken for each turn (e.g.,['__start__', 'agent', 'tools', '__interrupt__']).
# Python structure
class GraphTrajectory(TypedDict):
inputs: Optional[list[dict]]
results: list[dict]
steps: list[list[str]]// TypeScript structure
export type GraphTrajectory = {
inputs?: (Record<string, unknown> | null)[];
results: Record<string, unknown>[];
steps: string[][];
};