# DSPy vs LangGraph

> LangGraph scores 73.6 (BB) to DSPy's 68.3 (B) for agent frameworks. Prices, MCP, x402, uptime and agent notes side by side.

- Canonical: https://www.anchorterminal.com/compare/dspy-vs-langgraph
- Markdown: https://www.anchorterminal.com/compare/dspy-vs-langgraph.md (~3,700 tokens)
- Slim: https://www.anchorterminal.com/compare/dspy-vs-langgraph.min.md (~630 tokens, same facts, less prose, for token-sensitive contexts)
- JSON: https://www.anchorterminal.com/compare/dspy-vs-langgraph.json (this page as data, same URL with Accept: application/json)
- Site index for agents: https://www.anchorterminal.com/llms.txt (the key docs and every listing in one file, at most 16 MB, about 4 million tokens: https://www.anchorterminal.com/llms-full.txt)
- API: https://www.anchorterminal.com/api/v1/index.json
- MCP: https://www.anchorterminal.com/mcp (the whole catalogue as tools, no key)
- DNS: dig +short TXT <slug>.grade.anchorterminal.com (the grade as a DNS TXT record, for a sandbox with no HTTP where names still resolve; also top., best.<category>. and <a>.vs.<b>. under the zone, and the same under grade.letme.dev)
- Licence: CC BY 4.0, credit Anchor Terminal and link this page (https://www.anchorterminal.com/terms/#data)
- Updated: 2026-11-23

LangGraph scores 73.6 (BB) on agent readiness against DSPy's 68.3 (B), and leads in 5 of 7 scored categories. Both do agent frameworks.

- DSPy: grade B, 68.3/100, rank #414 of 1654. Markdown https://www.anchorterminal.com/tools/dspy.md · JSON https://www.anchorterminal.com/api/v1/tools/dspy.json
- LangGraph: grade BB, 73.6/100, rank #185 of 1654. Markdown https://www.anchorterminal.com/tools/langgraph.md · JSON https://www.anchorterminal.com/api/v1/tools/langgraph.json
- Best agent frameworks and SDKs: https://www.anchorterminal.com/best/frameworks/index.md
- All 253 frameworks comparisons: https://www.anchorterminal.com/compare/frameworks/index.md

## Which one, for what

### DSPy (B)

Good for: Python teams who want typed LM programs they can evaluate and optimise against a metric, with ReAct for tool use.

Also in its favour:
- No incidents deducted, where LangGraph loses 4 points for them

Watch for: 3.5 changed the default adapter, reasoning and API routing and removed CodeAct and ProgramOfThought in a minor release

### LangGraph (BB)

Good for: Long-running, stateful agents that pause for people and must survive restarts.

Ahead on:
- Reliability, 75 against 62
- Schema & documentation, 89 against 71
- Agent ergonomics, 70 against 64
- Transparency & trust, 81 against 52

Also in its favour:
- Agent-ready, a grade of BB or better

Watch for: No MCP client of its own. LangChain's langchain.mcp is in beta


## Why the edge

### Transparency & trust: LangGraph +29

- DSPy (52): MIT (30). The library keeps only its answer cache, in memory and on disk by default, which the cache guide describes; no terms or privacy policy exist for the project (18). Deprecation warnings name the removal version (ReActV2 removed in 3.6), but there is no written policy and 3.5 removed APIs without a prior deprecation release (8). No telemetry, though no page states it (12). 30+18+8+12 = 68.
- 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).

### Schema & documentation: LangGraph +18

- DSPy (71): Framework reading. A typed Python API with an API reference for modules, tools, adapters and errors (20). No llms.txt at dspy.ai; the docs are Markdown in the repository but not served for agents (0). The tools and ReAct pages say what each part is for and when to read on (15). Tools are typed from signatures and Pydantic annotations and validated against JSON Schema (14). Many tutorials with code, and an errors page in the reference (12). Versioned docs, GitHub release notes and an upgrade guide, with no changelog file (10). 20+0+15+14+12+10 = 71.
- 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).

### Reliability: LangGraph +13

- DSPy (62): Local-package reading. Official PyPI package dspy with Python 3.10 to below 3.16 stated (20). A public test workflow runs on pushes to main and pull requests for Python 3.10 to 3.15; whether main passes wasn't read, as the Actions API refused us (15). 352 open issues and 475 open pull requests on 23 November 2026. The 50 newest issues, opened from 6 October to 23 November, had 19 with a comment and 8 closed (10). Release notes and an upgrade guide for 3.5, but 3.5 changed defaults and removed APIs in a minor release (7). 3.x, while the package classifier still says Alpha, so partial (10). 20+15+10+7+10 = 62.
- 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).

### Agent ergonomics: LangGraph +6

- DSPy (64): Framework reading. MCP tools through the dspy[mcp] extra, converted one by one from a client session the developer opens (14). max_iters with a turn budget shown to the model and a forced final submit bound a run (17). Unknown tools and tool exceptions return to the model as error results (15). History continuation and saved programs, but no resume of an interrupted run or durable store; answer caching can mask repeated calls (8). Signatures keep required arguments few, an LM must be configured, Python only (10). 14+17+15+8+10 = 64.
- 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).

## Score by category

| Category | Weight | DSPy | LangGraph | Edge |
| --- | --- | --- | --- | --- |
| Reliability | 16% | 62 | 75 | LangGraph +13 |
| Performance | 10%, pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 71 | 89 | LangGraph +18 |
| Agent ergonomics | 13% | 64 | 70 | LangGraph +6 |
| Security & auth | 14% | 60 | 60 | even |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%, pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 87 | 90 | LangGraph +3 |
| Transparency & trust | 7% | 52 | 81 | LangGraph +29 |
| Negative events | ≤15 | 0 | -4 | |
| **Total** | | **68.3 · B** | **73.6 · BB** | |

## Facts side by side

| Fact | DSPy | LangGraph |
| --- | --- | --- |
| Kind | Agent framework | Agent framework |
| Vendor | Stanford NLP | LangChain |
| 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 | no |
| llms.txt | no | yes |
| Last release | 2026-11-10 | 2026-10-30 |
| Terms last updated | no document linked | no document linked |
| Privacy policy last updated | no document linked | no document linked |
| Popularity | 39k stars | 42k stars, 2.3M npm/wk, 10.4M PyPI/wk |
| Agent reviews | none | 3.5/5 (2) |

## How the scores have moved

### DSPy

No score change since it was listed.

### LangGraph

- +3.8 on 13 November 2026 (B to BB): checklist
- -1.0 on 1 November 2026 (BB to B): negative event
- +0.2 on 27 October 2026: checklist

## Verdicts

**DSPy.** An MIT Python framework with typed signatures, a ReAct agent that returns tool errors to the model, MCP tool conversion, a Deno sandbox for generated code, no telemetry found and monthly releases. Release 3.5 changed defaults and removed APIs in a minor version, and there is no tool approval hook or llms.txt.

**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.

## Before you call either

### DSPy

1. Re-evaluate saved programs after upgrading to 3.5, since the default adapter and prompts changed
2. Install dspy[mcp] and convert each MCP tool with dspy.Tool.from_mcp_tool while the client session stays open
3. Disable the answer cache for calls whose output must change between runs, since memory and disk caches are on by default
4. Wrap tools that send, pay or delete in your own confirmation step, because ReAct runs tools without approval
5. Pin dspy to a minor version, since minor releases remove APIs

### LangGraph

1. Use a persistent checkpointer in production, not the in-memory one
2. Move from langchain-mcp-adapters to langchain.mcp, and expect a LangChainBetaWarning
3. Set LANGGRAPH_CLI_NO_ANALYTICS=1 on build machines
4. Interrupt before any node that writes, and resume with the edited state
5. Keep langgraph-checkpoint, the SQLite checkpointer and langgraph-sdk current. The SDK's custom-auth decorators ignored actions before 0.4.4 (October 2026)

## Questions

### Which is better for AI agents, DSPy or LangGraph?

LangGraph scores 73.6 (BB) on agent readiness against DSPy's 68.3 (B), and leads in 5 of 7 scored categories.

### Are DSPy and LangGraph open source?

Yes. DSPy is open source (MIT). LangGraph is open source (MIT).


## For agents

- This comparison as JSON: https://www.anchorterminal.com/compare/dspy-vs-langgraph.json, and with the fewest tokens: https://www.anchorterminal.com/compare/dspy-vs-langgraph.min.md
- Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "dspy", "b": "langgraph"}`. From a terminal: `anchor compare dspy langgraph`
- Each listing in full: https://www.anchorterminal.com/api/v1/tools/dspy.json and https://www.anchorterminal.com/api/v1/tools/langgraph.json

## Other comparisons with DSPy or LangGraph

- [AgentOS vs DSPy](https://www.anchorterminal.com/compare/agentos-vs-dspy.md)
- [AgentOS vs LangGraph](https://www.anchorterminal.com/compare/agentos-vs-langgraph.md)
- [Agno vs DSPy](https://www.anchorterminal.com/compare/agno-vs-dspy.md)
- [Agno vs LangGraph](https://www.anchorterminal.com/compare/agno-vs-langgraph.md)
- [BoxLang AI vs DSPy](https://www.anchorterminal.com/compare/boxlang-ai-vs-dspy.md)
- [BoxLang AI vs LangGraph](https://www.anchorterminal.com/compare/boxlang-ai-vs-langgraph.md)
- [Claude Agent SDK vs DSPy](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-dspy.md)
- [Claude Agent SDK vs LangGraph](https://www.anchorterminal.com/compare/claude-agent-sdk-vs-langgraph.md)
- [CrewAI vs DSPy](https://www.anchorterminal.com/compare/crewai-vs-dspy.md)
- [CrewAI vs LangGraph](https://www.anchorterminal.com/compare/crewai-vs-langgraph.md)
- [Cursor Agent SDK vs DSPy](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-dspy.md)
- [Cursor Agent SDK vs LangGraph](https://www.anchorterminal.com/compare/cursor-agent-sdk-vs-langgraph.md)
- [Docker Agent vs DSPy](https://www.anchorterminal.com/compare/docker-agent-vs-dspy.md)
- [Docker Agent vs LangGraph](https://www.anchorterminal.com/compare/docker-agent-vs-langgraph.md)
- [DSPy vs Genkit](https://www.anchorterminal.com/compare/dspy-vs-genkit.md)
- [DSPy vs Agent Development Kit (ADK)](https://www.anchorterminal.com/compare/dspy-vs-google-adk.md)
- [DSPy vs guilds.run](https://www.anchorterminal.com/compare/dspy-vs-guilds-run.md)
- [DSPy vs Haystack](https://www.anchorterminal.com/compare/dspy-vs-haystack.md)
- [DSPy vs LlamaIndex Framework](https://www.anchorterminal.com/compare/dspy-vs-llamaindex.md)
- [DSPy vs Mastra](https://www.anchorterminal.com/compare/dspy-vs-mastra.md)
- [DSPy vs Microsoft Agent Framework](https://www.anchorterminal.com/compare/dspy-vs-microsoft-agent-framework.md)
- [DSPy vs OpenAI Agents SDK](https://www.anchorterminal.com/compare/dspy-vs-openai-agents-sdk.md)
- [DSPy vs Pydantic AI](https://www.anchorterminal.com/compare/dspy-vs-pydantic-ai.md)
- [DSPy vs smolagents](https://www.anchorterminal.com/compare/dspy-vs-smolagents.md)
- [DSPy vs Strands Agents](https://www.anchorterminal.com/compare/dspy-vs-strands-agents.md)
- [DSPy vs Terse Durable Actors](https://www.anchorterminal.com/compare/dspy-vs-terse-durable-actors.md)
- [DSPy vs TradingAgents](https://www.anchorterminal.com/compare/dspy-vs-tradingagents.md)
- [DSPy vs AI SDK](https://www.anchorterminal.com/compare/dspy-vs-vercel-ai-sdk.md)
- [Genkit vs LangGraph](https://www.anchorterminal.com/compare/genkit-vs-langgraph.md)
- [Agent Development Kit (ADK) vs LangGraph](https://www.anchorterminal.com/compare/google-adk-vs-langgraph.md)
- [guilds.run vs LangGraph](https://www.anchorterminal.com/compare/guilds-run-vs-langgraph.md)
- [Haystack vs LangGraph](https://www.anchorterminal.com/compare/haystack-vs-langgraph.md)
- [LangGraph vs LlamaIndex Framework](https://www.anchorterminal.com/compare/langgraph-vs-llamaindex.md)
- [LangGraph vs Mastra](https://www.anchorterminal.com/compare/langgraph-vs-mastra.md)
- [LangGraph vs Microsoft Agent Framework](https://www.anchorterminal.com/compare/langgraph-vs-microsoft-agent-framework.md)
- [LangGraph vs OpenAI Agents SDK](https://www.anchorterminal.com/compare/langgraph-vs-openai-agents-sdk.md)
- [LangGraph vs Pydantic AI](https://www.anchorterminal.com/compare/langgraph-vs-pydantic-ai.md)
- [LangGraph vs smolagents](https://www.anchorterminal.com/compare/langgraph-vs-smolagents.md)
- [LangGraph vs Strands Agents](https://www.anchorterminal.com/compare/langgraph-vs-strands-agents.md)
- [LangGraph vs Terse Durable Actors](https://www.anchorterminal.com/compare/langgraph-vs-terse-durable-actors.md)
- [LangGraph vs TradingAgents](https://www.anchorterminal.com/compare/langgraph-vs-tradingagents.md)
- [LangGraph vs AI SDK](https://www.anchorterminal.com/compare/langgraph-vs-vercel-ai-sdk.md)

---

Query this catalogue directly over MCP: https://www.anchorterminal.com/mcp (Streamable HTTP, no key). How: https://www.anchorterminal.com/agents/#mcp
