Pydantic AI vs LangChain & LangGraph
LangChain is a large Python ecosystem: LangGraph underneath it for graph-based control flow, deepagents for its coding harness, and a large catalogue of integrations. Pydantic AI does it from one typed Agent with plain Python control flow: pydantic-graph when you want an explicit graph, a Harness SDK of ready-made capabilities and complete agents, and validation from the library you already use.
Pydantic AI is one part of a stack: the Harness SDK for capabilities and complete agents, Pax to run any of your agents in a coding terminal, Pydantic Evals for evaluation, Pydantic Graph for graph-based workflows, Pydantic Logfire for observability, and Pydantic itself for validation. The tables below cover the whole of it.
Already built on LangChain? The migrating-langchain-to-pydantic-ai skill ports an existing application to Pydantic AI one working path at a time, preserving behavior rather than translating API names.
| LangChain & LangGraph | Pydantic AI and Harness SDK | |
|---|---|---|
| Language | Python | Python |
| License | MIT | MIT |
| Model providers | Many | Many |
| Extensibility | Middleware, callbacks | Capabilities and toolsets; 100+ with the Harness SDK |
| Harnesses | deepagents, or your own on LangGraph | Built-in Coder and Researcher, or compose your own, and run any of them in Pax |
| Observability | OpenTelemetry via LangSmith | OpenTelemetry, including Pydantic Logfire |
| Enterprise support | With LangSmith Enterprise | For the framework itself, no platform required |
| Durable execution | Yes | Ten integrations |
| Interfaces | LangSmith Agent Server, Fleet | Pax coding terminal (pax --agent runs yours), legacy CLI (clai), web chat, AG-UI, Vercel AI, ACP (experimental), GitHub Agentic Workflows |
| Realtime voice | No | Realtime |
| Evals | Yes | Pydantic Evals |
| Image generation | Provider-hosted tools only | Image Generation |
| LangChain & LangGraph | Pydantic AI and Harness SDK | |
|---|---|---|
| Multi-agent | Yes | Subagents, delegation, or pydantic-graph |
| Planning | Yes | Planning |
| Skills | Yes | Skills |
| Memory | Yes | Memory |
| Compaction | Yes | Compaction |
| Guardrails | Yes | Guardrails |
| Code sandboxes | Yes | Your machine, SSH and 11 sandboxes, with per-path authority |
| Browser use | Provider-hosted tools only | Web & research, and computer use on a desktop in 11 sandboxes |
Do you have a graph library? Yes. pydantic-graph: typed nodes, edges from return
types, and persistence for pausing and resuming. Reach for it when the control flow is a real state
machine; plain Python and sub-agents cover the rest.
Can I control which content my agent treats as instructions? Yes. What a capability tells the model mid-conversation is a typed part that records who wrote it (you, your user, or nobody you trust), and Pydantic AI speaks it in the voice that authority allows; what a capability enqueues can be lowered, never raised, as it moves through a run. Tool results and fetched pages stay data on every provider, and text that imitates the framework’s own frames is flagged to the model. A workspace’s files carry your authority unless you mark them untrusted, path by path. See Where the content came from for the source and authority table, Capability parts for how they are stored, and Marking who wrote the files.
Last checked: 2026-09-24