Frameworks Perform Equally, Model Shift Reveals Weaknesses

A recent benchmark study pitting LangGraph against Pydantic AI for agent orchestration has concluded that, under identical conditions, the two frameworks perform on par. The critical finding emerged not from the framework comparison itself, but from a subsequent test where the underlying language model was changed, revealing significant task execution failures that the frameworks themselves did not predict or prevent.

The question of LangChain versus LangGraph is a recurring one for developers embarking on new agent projects. This experiment, however, framed the inquiry slightly differently: once LangGraph is selected as the runtime, does the choice of the orchestrating library truly impact production outcomes? The controlled benchmark aimed to answer this.

The setup involved LangGraph version 1.2.9 and Pydantic AI version 2.13.0. Researchers designed four distinct tasks to simulate realistic agent workloads: order processing with tool calls, shipping quote calculations, refund eligibility assessment involving date logic, and inventory reorder decisions. Each task utilized the same tool implementations and the same scoring mechanism. The sole variable introduced was the library responsible for orchestrating the agent's calls and tool interactions.

The experiment employed GPT-4o with a temperature setting of 0, and importantly, no parallel tool calls were permitted. This configuration ensured a deterministic environment for evaluating the core orchestration logic. The harness used for this benchmark is publicly available on GitHub, allowing for replication and further investigation by the community.

Diagram illustrating the controlled benchmark setup for LangGraph vs Pydantic AI agent tasks

The Unexpected Failure Mode

The initial phase of the benchmark, which involved running 160 agent tasks, demonstrated a clear tie between LangGraph and Pydantic AI. Both frameworks successfully handled the tasks, executing the logic as intended and producing consistent results according to the predefined scoring criteria. This outcome suggests that for straightforward, well-defined agent workflows, the choice between these two popular orchestration libraries may be less critical than initially assumed, provided the underlying model and tools are robust.

However, the study took a crucial turn when the model was changed. While the prompt and the task definitions remained the same, switching to a different model — details of which are not specified in the initial report but are crucial for understanding the failure — led to a dramatic increase in errors. Specifically, one task began failing repeatedly, to the point of failing 20 consecutive times. This stark contrast highlights a significant vulnerability: the frameworks themselves might not be the bottleneck, but they are responsible for managing and reporting failures originating from the LLM or the interaction with external tools.

This failure mode is particularly concerning because it wasn't a gradual degradation. It was a sharp, binary shift where a previously successful task became intractable. The frameworks, designed to manage complex sequences of calls, tool integrations, and state management, did not appear to have inherent mechanisms to detect or gracefully handle this level of model-induced breakdown. The implication is that while these frameworks provide the structure for agents, the reliability and robustness of the agent's reasoning and execution still heavily depend on the capabilities and consistency of the chosen LLM.

Rethinking Agent Robustness

The benchmark’s findings prompt a deeper discussion about agent robustness. If changing the LLM can so drastically alter task success rates, then the frameworks must evolve to incorporate more sophisticated error detection, retry strategies, or fallback mechanisms. Relying solely on the LLM's output without a secondary layer of validation or resilience could lead to brittle agent systems that fail unexpectedly in production.

Consider this analogy: imagine building a house with a sophisticated automated system for managing water and electricity. If the primary power grid (the LLM) suddenly fluctuates wildly, the house's internal wiring (the framework) might short-circuit or fail to manage the influx, leading to system-wide failure. The wiring itself might be perfectly sound, but it wasn't designed to handle such extreme external input variations.

The study raises an important, yet unanswered question: What responsibility should agent frameworks bear in detecting and mitigating failures originating from the underlying LLM? Should they be passive conduits, or should they actively monitor for anomalous behavior, implement adaptive retry policies, or even suggest switching to a more stable model or tool when performance degrades?

The public availability of the harness is a positive step, enabling further research. Developers can now explore the specific conditions that trigger such failures and potentially contribute to solutions. The next logical step would be to replicate this experiment with various model versions, different tool complexities, and varying temperature settings to map out the performance envelope more comprehensively.

Implications for Developers and Deployments

For developers currently building with LangGraph or Pydantic AI, this benchmark underscores the critical importance of rigorous testing, especially when anticipating model updates or using models known for variability. It is no longer sufficient to test an agent once with a specific model. Continuous evaluation and monitoring are essential.

If you are managing an agent-based system, this implies a need to:

  • Implement comprehensive logging and monitoring for task success/failure rates.
  • Develop sophisticated retry and fallback strategies that go beyond simple re-execution.
  • Maintain a catalog of known model behaviors and their impact on your specific tasks.
  • Consider implementing a validation layer that checks LLM outputs for plausibility before they are acted upon.

The study, while demonstrating a tie between frameworks, ultimately serves as a cautionary tale. The true fragility in agent systems often lies not in the orchestration layer, but in the unpredictable nature of the large language models they depend on. The frameworks provide the structure, but ensuring end-to-end reliability requires a holistic approach that accounts for the entire system, including the ever-evolving LLMs.