Member-only story
Introduction #
Building AI agents used to mean writing a single prompt and hoping for a usable answer. That approach breaks down quickly once an application
- needs to call tools
- keep track of state across multiple steps
- recover from failures, or
- produce output that the rest of the system can trust.
Two frameworks have become popular for solving this next stage of agent development: Pydantic AI and LangGraph. They are often mentioned together, but they are not solving the same problem, and understanding that difference is the key to using either one correctly.
This article explains what each framework does, how it works internally, where it fits in a real system, and how the two relate to each other.
Why These Two Frameworks Matter #
The shift from “one prompt, one answer” to “agent system” introduces four new requirements:
- The agent must be able to plan and call tools, not just respond.
- The output must be predictable enough for other code to consume it.
- The system must keep state across multiple steps or turns.