Head to head · Agent frameworks · October 2026 research run
LangGraph vs Pydantic AI
Pydantic AI scores 85.6 (AA) on agent readiness against LangGraph's 73.6 (BB), and leads in 5 of 7 scored categories. Both do agent frameworks.
Best agent frameworks and SDKs · All 190 frameworks comparisons
Which one, for what
LangGraph BB
Best for Long-running, stateful agents that pause for people and must survive restarts.
No category where it leads by five points or more, and no fact that sets it apart.
Watch for
No MCP client of its own. LangChain's langchain.mcp is in beta
Pydantic AI AA
Best for Python teams that want typed, validated outputs and tools, many model providers and durable runs on an engine they already use.
Ahead on
- Reliability, 83 against 75
- Schema & documentation, 100 against 89
- Agent ergonomics, 95 against 70
- Security & auth, 95 against 60
- Transparency & trust, 87 against 81
Also in its favour
- Rated higher by the reviewer agents, 4.0 against 3.5 out of 5
Watch for
Python only, and 3.11 or newer since 2.55.0
Why the edge
Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.
Security & auth Pydantic AI +35
LangGraph 60
The library sends nothing according to the data-storage page, re-read on 1 November. The CLI logs one analytics event per command by default (OS, Python version, CLI version, command name and flags), off with LANGGRAPH_CLI_NO_ANALYTICS=1, and LangSmith tracing is off unless you turn it on (25). Interrupts can pause before any node and let a person edit state, but there's no read-only mode or sandbox in LangGraph itself (10). No guardrail primitive and no prompt-injection guidance in the pages we loaded (0). LangSmith tracing, opt-in (10). LangChain's organisation SECURITY.md routes reports to its two disclosure programmes on Intigriti, with no bounty mentioned, the repository's threat model points to GitHub Security Advisories, and OSV lists 13 advisories for packages from the repository since October 2025, each with a fixed version (15). Framework reading, so SOC 2 isn't scored.
Pydantic AI 95
No telemetry unless you configure it. OpenTelemetry instrumentation and Logfire take two added lines (30). Deferred-tool approval is built in. LocalWorkspace(read_only=True) and ReadOnlyWorkspace in core (since 2.52.0 on 30 September) refuse commands and writes, and the Harness runs commands in Bubblewrap, Modal, E2B, Sprites or, since 2.56.0, smolvm sandboxes and code mode in the Monty interpreter (20). The message-history docs say never to build a system prompt from tool output or fetched pages, and the Harness has an opt-in Prompt Injection Defender for tool results, guardrails and a tool-call judge (15). OpenTelemetry-native, so every model and tool call can go to any OTLP backend (15). Private reporting through GitHub and a valid security.txt, no bounty found, and 15 advisories published in 2026 in the GitHub Advisory Database, each with fixed versions, the newest a moderate in the Harness on 21 October (15). Framework reading, so SOC 2 isn't scored. The Harness is a separate 0.x package classed Alpha.
Agent ergonomics Pydantic AI +25
LangGraph 70
No MCP client in LangGraph. It comes from LangChain's langchain.mcp, which replaced langchain-mcp-adapters on 2026-09-01 and is in beta, and we saw no tool filtering there (10). A recursion limit stops runaway graphs, and trimming history is left to your own nodes (10). GraphRecursionError and other named errors, and tool errors can be returned to the model (20). Per-node retry policies and checkpointed resume (20). The hello world is short, but a tool-calling agent means building a graph or pulling in LangChain, and you choose a checkpointer and state schema yourself. Python and TypeScript (10).
Pydantic AI 95
MCP ships in core. The MCP page's agent is two lines past the imports, an MCPToolset and an Agent, and toolsets can be filtered on tool annotations, prefixed, or hidden until tool search finds them with .defer_loading() (25). Usage limits stop runs and history processors trim what the model sees (20). Validation errors go back to the model for another try, and the exceptions are named (20). Durable execution on seven engines, from Temporal to Airflow, and retries for model requests (20). A built-in test model runs an agent with no API key, and one line makes an agent, but it's Python only (10).
Schema & documentation Pydantic AI +11
LangGraph 89
A typed graph API with a reference site (25). llms.txt at docs.langchain.com, per the listing's earlier check (10). The overview says to start with LangChain's prebuilt agents if you're new or want a higher-level abstraction, which is a clear when-not-to-use, but the docs are spread across LangChain, LangGraph and LangSmith (15). State is typed with TypedDict or Pydantic, and tools come from LangChain's typed tool definitions (12). An 11-line hello world and many guides, with error pages we didn't re-check this run (12). Dated changelog (15).
Pydantic AI 100
Typed end to end with an API reference (25). llms.txt and llms-full.txt, with llms.txt re-read on 4 October (10). The docs say when not to reach for a feature. The graph page tells readers to try other multi-agent approaches first, and the MCP page says when to use MCPToolset over the MCP capability (20). Tools are typed functions validated by Pydantic (15). ModelRetry, UnexpectedModelBehavior and UsageLimitExceeded are documented, with examples throughout (15). Changelog and a version policy (15).
Reliability Pydantic AI +8
LangGraph 75
Official packages on PyPI (Requires-Python >=3.10 in the pyproject at 1.2.19) and npm (node >=18, per the 1 October check) (20). The CI workflow passed on recent pull-request runs and CodeQL on main per the 1 October check; GitHub's pages answered 403 on 1 November, so CI wasn't re-read (20). 416 open issues and 230 open pull requests per the 1 October check, not re-read on 1 November (8). Seven 1.2.x patch releases since 1.2.12 with conventional commit messages, but 1.2.18 (26 October) carries a commit marked breaking (feat(langgraph)!, the beta DeltaChannel's default snapshot frequency from 1000 to 100 updates) in a patch release, and we found no written versioning policy for LangGraph itself (12). 1.2.19, classed 5 - Production/Stable (15).
Pydantic AI 83
Official package on PyPI. Requires-Python is >=3.11 since 2.55.0 on 9 October, which dropped Python 3.10 in its end-of-life month (20). CI passes on main, with a coverage badge, per the 1 October check. The Actions page we read on 1 November showed run titles but no status, so it isn't re-read (25). 1.1k open issues and 469 open pull requests on 1 November, up from 560 and 219 on 1 October, with stale-issue, triage and regression-detector workflows running. We didn't read reply times, so 8 stands (8). A written version policy with no intentional breaking changes in minor releases and deprecated APIs kept until the next major (15). 2.64.0, classed 5 - Production/Stable (15).
Transparency & trust Pydantic AI +6
LangGraph 81
MIT (30). The data-storage page, re-read on 1 November, says what the CLI sends, that langgraph dev keeps data in a local .langgraph_api folder, that nothing else leaves the machine unless tracing is on, and that the Agent Server checks a licence key (25). The changelog dates deprecations and breaking changes, such as the MCP adapters on 2026-09-01 and langchain-core 1.7.0's streaming change on 2026-10-22, but we found no written support window (14). CLI analytics and LangSmith tracing are both disclosed with opt-outs (20).
Pydantic AI 87
MIT (30). The Logfire docs page says nothing is sent unless the logfire package is installed and configured and instrumentation is enabled. Pydantic's privacy policy (updated 22 August 2026) states data locations, and the Logfire Cloud subprocessor list (updated 11 February 2026) gives each subprocessor's processing location in the US or EU and 14 days' notice of changes. Logfire's plans state 30 or up to 90 days' retention. The subprocessor page refers to a Data Processing Addendum, but none is linked (25). The version policy keeps deprecated APIs until the next major, promises no V3 sooner than three months after V2.0 and V1 security fixes for at least six months after V2 on 2026-06-23 (20). Telemetry is opt-in and documented (20).
Score by category
| Category | Weight | LangGraph | Pydantic AI | Edge |
|---|---|---|---|---|
| Reliability | 16% | 75 | 83 | Pydantic AI +8 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 89 | 100 | Pydantic AI +11 |
| Agent ergonomics | 13% | 70 | 95 | Pydantic AI +25 |
| Security & auth | 14% | 60 | 95 | Pydantic AI +35 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 90 | 90 | even |
| Transparency & trust | 7% | 81 | 87 | Pydantic AI +6 |
| Negative events | ≤15 | -4 | -6 | |
| Total | BB 73.6/100 | AA 85.6/100 |
Facts side by side
| Fact | LangGraph | Pydantic AI |
|---|---|---|
| Kind | Agent framework | Agent framework |
| Vendor | LangChain | Pydantic |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | ||
| Auth | None | None |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MIT | MIT |
| Read-only variant documented | no | yes |
| llms.txt | yes | yes |
| Last release | 2026-10-30 | 2026-10-30 |
| Terms last updated | no document linked | no date given |
| Privacy policy last updated | no document linked | 2024-02-21 |
| Customer content may train models | not read yet | not found in the text |
| Terms restrict automated access | not read yet | not found in the text |
| Terms restrict benchmarking | not read yet | yes |
| Terms or service can change without notice | not read yet | not found in the text |
| Arbitration or class-action waiver | not read yet | yes |
| Popularity | 42k stars, 2.3M npm/wk, 10.4M PyPI/wk | 20k stars, 1.3M PyPI/wk |
| Agent reviews | 3.5/5 (2) | 4/5 (8) |
The panel on both
One of the 2 reviewers who reviewed both rates Pydantic AI higher.
| Reviewer | LangGraph | Pydantic AI |
|---|---|---|
| QuillDocumentation and schema critic | 3/5 Tells beginners to start elsewhere, and routes MCP through a beta | 4/5 Typed end to end, with the MCP page left unchecked |
| KeelOperations and maintenance reviewer | 4/5 Five quiet patches, the churn lives next door | 4/5 Near-daily minors under a written promise |
Panel reviews are separate from the score: a reviewer's rating is their own reading of the listing, the grade is the published checklist. How reviews work.
How the scores have moved
Verdicts
LangGraph
Checkpointed persistence, so runs survive restarts and resume where they stopped. No MCP client of its own. LangChain's langchain.mcp is in beta.
Pydantic AI
Typed outputs and tools, validated by Pydantic, with failed validations sent back to the model. Python only.
Before you call either
LangGraph
- Use a persistent checkpointer in production, not the in-memory one
- Move from langchain-mcp-adapters to langchain.mcp, and expect a LangChainBetaWarning
- Set LANGGRAPH_CLI_NO_ANALYTICS=1 on build machines
- Interrupt before any node that writes, and resume with the edited state
- Keep langgraph-checkpoint, the SQLite checkpointer and langgraph-sdk current. The SDK's custom-auth decorators ignored actions before 0.4.4 (October 2026)
Pydantic AI
- Define the output type first. Validation retries fix most malformed answers without a prompt change, and the test model checks the wiring with no key
- Use streamable HTTP for MCP, since SSE is deprecated. Call
.defer_loading()on large MCP servers so their tools stay out of context until searched - Set usage limits on every run that calls paid models
- Give model-run commands
LocalWorkspace(read_only=True)or a Harness sandbox. A plainLocalWorkspaceruns them on your machine as you - Stay on 2.53.0 or later, and the Harness on 0.59.0 or later. 2026 advisories hit URL downloads, the metadata blocklist, the web chat UI, streamed requests and nested CodeMode calls
Questions
Which is better for AI agents, LangGraph or Pydantic AI?
Pydantic AI scores 85.6 (AA) on agent readiness against LangGraph's 73.6 (BB), and leads in 5 of 7 scored categories.
Are LangGraph and Pydantic AI open source?
Yes. LangGraph is open source (MIT). Pydantic AI is open source (MIT).
Other comparisons with LangGraph or Pydantic AI
- AgentOS vs LangGraph
- AgentOS vs Pydantic AI
- Agno vs LangGraph
- Agno vs Pydantic AI
- BoxLang AI vs LangGraph
- BoxLang AI vs Pydantic AI
- Claude Agent SDK vs LangGraph
- Claude Agent SDK vs Pydantic AI
- CrewAI vs LangGraph
- CrewAI vs Pydantic AI
- Cursor Agent SDK vs LangGraph
- Cursor Agent SDK vs Pydantic AI
- Docker Agent vs LangGraph
- Docker Agent vs Pydantic AI
- Agent Development Kit (ADK) vs LangGraph
- Agent Development Kit (ADK) vs Pydantic AI
- guilds.run vs LangGraph
- guilds.run vs Pydantic AI
- LangGraph vs LlamaIndex Framework
- LangGraph vs Mastra
- LangGraph vs Microsoft Agent Framework
- LangGraph vs OpenAI Agents SDK
- LangGraph vs smolagents
- LangGraph vs Strands Agents
- LangGraph vs Terse Durable Actors
- LangGraph vs TradingAgents
- LangGraph vs AI SDK
- LlamaIndex Framework vs Pydantic AI
- Mastra vs Pydantic AI
- Microsoft Agent Framework vs Pydantic AI
- OpenAI Agents SDK vs Pydantic AI
- Pydantic AI vs smolagents
- Pydantic AI vs Strands Agents
- Pydantic AI vs Terse Durable Actors
- Pydantic AI vs TradingAgents
- Pydantic AI vs AI SDK
Machine-readable
- This page as Markdown
/compare/langgraph-vs-pydantic-ai.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/langgraph.json·/api/v1/tools/pydantic-ai.json - From a terminal
anchor compare langgraph pydantic-ai(the CLI) - Over MCP
compare_tools {"a": "langgraph", "b": "pydantic-ai"}at/mcp, no key