Head to head · Agent frameworks · October 2026 research run
DSPy vs AI SDK
AI SDK scores 93.6 (AA) on agent readiness against DSPy's 68.3 (B), and leads in 6 of 7 scored categories. Both do agent frameworks.
Best agent frameworks and SDKs · All 253 frameworks comparisons
Which one, for what
DSPy B
Best 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 key needed to call it
Watch for
3.5 changed the default adapter, reasoning and API routing and removed CodeAct and ProgramOfThought in a minor release
AI SDK AA
Best for TypeScript teams building agents and chat UIs who want one API across many providers and a short path to MCP.
Ahead on
- Reliability, 93 against 62
- Schema & documentation, 100 against 71
- Agent ergonomics, 95 against 64
- Security & auth, 90 against 60
- Maintenance & community, 97 against 87
- Transparency & trust, 89 against 52
Also in its favour
- Agent-ready, a grade of BB or better
Watch for
TypeScript only, and ai 7.x needs Node 22 or newer
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.
Transparency & trust AI SDK +37
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.
AI SDK 89
Apache 2.0 (30). The library stores nothing. The AI Gateway's ZDR page says it doesn't retain prompts or outputs and per-request ZDR is available on Pro and Enterprise, and Vercel's privacy notice is dated 1 June 2026, but we didn't read a DPA or subprocessor list (22). Deprecated APIs are removed only at majors with a migration guide, and 6.x and 5.x keep getting releases, without a written support window (14). Telemetry is opt-in and documented, with switches for inputs and outputs (20).
Reliability AI SDK +31
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.
AI SDK 93
Official npm packages, with ai 7.x requiring Node 22 or newer (20). A public CI workflow with lint, type checks, unit tests, Node-version tests, MCP tests on Windows and e2e tests runs on every push to main, and the newest completed CI runs on main passed on 6 November (25). 1,517 open issues and pull requests on 6 November from GitHub's API, with 1,059 issues opened in the 90 days to 3 November; 47 of the 50 newest had a comment and 32 were closed (18). A written versioning page with breaking changes only in majors, experimental_ prefixes for unstable APIs and a migration guide per major (15). 7.0.163 (15). 20+25+18+15+15 = 93, up from 73 on 6 October, when GitHub couldn't be read.
Agent ergonomics AI SDK +31
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.
AI SDK 95
An MCP client in a few lines with createMCPClient and client.tools(), and tool search with deferLoading keeps unused tool definitions out of the prompt (25). stopWhen with a default of 20 steps, and prepareStep to trim messages, switch models or limit active tools per step (20). 38 typed errors with isInstance guards, and MCP results with isError go back to the model (20). maxRetries on model calls, opt-in retries for transient MCP failures only, and WorkflowAgent for durable steps with automatic retries (20). Few required parameters, but TypeScript only, and a string model ID needs an AI Gateway key unless a default provider is set (10).
Security & auth AI SDK +30
DSPy 60
Framework reading (telemetry defaults, approvals, guardrails, sandboxing). No telemetry found, and the optional LiteLLM engine switches LiteLLM telemetry off (25). No tool approval hook; RLM runs generated code in a Deno and Pyodide sandbox with no filesystem or network access (10). No prompt-injection guidance found (5). MLflow tracing through OpenTelemetry and callbacks (12). SECURITY.md with GitHub private reporting and a maintainer address, but OSV lists CVE-2025-12695 for the PythonInterpreter sandbox with no fixed version (8). 25+10+5+12+8 = 60.
AI SDK 90
No telemetry until an OpenTelemetry integration is registered. String model IDs route to Vercel's AI Gateway by default, which is documented and needs a Vercel key, so it isn't silent (25). Per-tool approval, HMAC-signed approvals against forged client history, and Open Policy Agent rules in @ai-sdk/policy-opa, though sandboxes are experimental (20). ToolLoopAgent rejects system messages in prompts by default as an injection risk, URL fetches are checked against private addresses, and MCP HTTP transport refuses redirects by default, but there's no guardrail primitive (10). OpenTelemetry spans for every model and tool call to any backend, opt-in (15). HackerOne programme, a valid security.txt, SECURITY.md and two low-severity advisories published with fixed versions (20). Framework reading, so SOC 2 isn't scored.
Schema & documentation AI SDK +29
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.
AI SDK 100
Typed TypeScript API with a reference section for every function (25). llms.txt and a Markdown copy of each page (10). The docs say when to use each piece, such as a table of WorkflowAgent against ToolLoopAgent, a when-to-use section for subagents and harnesses, and HTTP over stdio for MCP in production (20). Tools take Zod or JSON Schema inputs (15). 38 error types documented in the reference, with error-handling guides and examples throughout (15). Versioning page and a changesets CHANGELOG per package (15).
Maintenance & community AI SDK +10
DSPy 87
3.5.0 tagged on 10 November 2026, 13 days before this check (30). Three releases in the 90 days to 23 November (3.4.0, 3.4.1, 3.5.0) (20). The 50 newest issues had 19 with a comment and 8 closed, with 352 issues and 475 pull requests open, while 213 commits from about 30 authors reached the repository in 90 days (12). The package is current (15). CI on six Python versions, Dependabot and actions pinned to commit SHAs (10). 30+20+12+15+10 = 87.
AI SDK 97
7.0.163 on 2026-11-05 (30). 226 stable npm releases of ai across the 7.x, 6.x and 5.x lines in the 90 days to 6 November, 70 of them since 6 October (20). 47 of the 50 newest issues commented and 32 closed, with triage automation and backport workflows (22). ai and the provider packages are current, and 6.x and 5.x still get patches (15). Dependabot configured and CI passing on main (10). 30+20+22+15+10 = 97.
Score by category
| Category | Weight | DSPy | AI SDK | Edge |
|---|---|---|---|---|
| Reliability | 16% | 62 | 93 | AI SDK +31 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 71 | 100 | AI SDK +29 |
| Agent ergonomics | 13% | 64 | 95 | AI SDK +31 |
| Security & auth | 14% | 60 | 90 | AI SDK +30 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 87 | 97 | AI SDK +10 |
| Transparency & trust | 7% | 52 | 89 | AI SDK +37 |
| Negative events | ≤15 | 0 | 0 | |
| Total | B 68.3/100 | AA 93.6/100 |
Facts side by side
| Fact | DSPy | AI SDK |
|---|---|---|
| Kind | Agent framework | Agent framework |
| Vendor | Stanford NLP | Vercel |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | ||
| Auth | None | API key |
| Pricing | Free | Free |
| x402 | no | no |
| Licence | MIT | Apache-2.0 |
| Read-only variant documented | no | no |
| llms.txt | no | yes |
| Last release | 2026-11-10 | 2026-11-05 |
| Terms last updated | no document linked | 2026-06-01 |
| Privacy policy last updated | no document linked | 2026-06-01 |
| Customer content may train models | not read yet | yes, with an opt-out |
| Terms restrict automated access | not read yet | not found in the text |
| Terms restrict benchmarking | not read yet | not found in the text |
| 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 | 39k stars | 28k stars, 44.9M npm/wk |
How the scores have moved
DSPy
No score change since it was listed.
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.
AI SDK
A TypeScript agent toolkit with ToolLoopAgent, a built-in MCP client, per-tool approvals that can be HMAC-signed, opt-in OpenTelemetry and durable runs through WorkflowAgent. It ships three major versions in 14 months (5.0, 6.0, 7.0), each with a migration guide, and plain string model IDs route through Vercel's AI Gateway unless another provider is set.
Before you call either
DSPy
- Re-evaluate saved programs after upgrading to 3.5, since the default adapter and prompts changed
- Install dspy[mcp] and convert each MCP tool with dspy.Tool.from_mcp_tool while the client session stays open
- Disable the answer cache for calls whose output must change between runs, since memory and disk caches are on by default
- Wrap tools that send, pay or delete in your own confirmation step, because ReAct runs tools without approval
- Pin dspy to a minor version, since minor releases remove APIs
AI SDK
- Pass a provider instance such as openai('model') if traffic shouldn't go through Vercel's AI Gateway
- Set toolApproval on tools that write, and experimental_toolApprovalSecret when approvals come back from a browser
- Raise or replace the default stop condition of 20 steps with stopWhen
- Close the MCP client after the run, and use HTTP transport outside local development
- Set recordInputs and recordOutputs to false when spans would carry secrets
Questions
Which is better for AI agents, DSPy or AI SDK?
AI SDK scores 93.6 (AA) on agent readiness against DSPy's 68.3 (B), and leads in 6 of 7 scored categories.
Are DSPy and AI SDK open source?
Yes. DSPy is open source (MIT). AI SDK is open source (Apache-2.0).
Other comparisons with DSPy or AI SDK
- AgentOS vs DSPy
- AgentOS vs AI SDK
- Agno vs DSPy
- Agno vs AI SDK
- BoxLang AI vs DSPy
- BoxLang AI vs AI SDK
- Claude Agent SDK vs DSPy
- Claude Agent SDK vs AI SDK
- CrewAI vs DSPy
- CrewAI vs AI SDK
- Cursor Agent SDK vs DSPy
- Cursor Agent SDK vs AI SDK
- Docker Agent vs DSPy
- Docker Agent vs AI SDK
- DSPy vs Genkit
- DSPy vs Agent Development Kit (ADK)
- DSPy vs guilds.run
- DSPy vs Haystack
- DSPy vs LangGraph
- DSPy vs LlamaIndex Framework
- DSPy vs Mastra
- DSPy vs Microsoft Agent Framework
- DSPy vs OpenAI Agents SDK
- DSPy vs Pydantic AI
- DSPy vs smolagents
- DSPy vs Strands Agents
- DSPy vs Terse Durable Actors
- DSPy vs TradingAgents
- Genkit vs AI SDK
- Agent Development Kit (ADK) vs AI SDK
- guilds.run vs AI SDK
- Haystack vs AI SDK
- LangGraph vs AI SDK
- LlamaIndex Framework vs AI SDK
- Mastra vs AI SDK
- Microsoft Agent Framework vs AI SDK
- OpenAI Agents SDK vs AI SDK
- Pydantic AI vs AI SDK
- smolagents vs AI SDK
- Strands Agents vs AI SDK
- TradingAgents vs AI SDK
- Terse Durable Actors vs AI SDK
Machine-readable
- This page as Markdown
/compare/dspy-vs-vercel-ai-sdk.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/dspy.json·/api/v1/tools/vercel-ai-sdk.json - From a terminal
anchor compare dspy vercel-ai-sdk(the CLI) - Over MCP
compare_tools {"a": "dspy", "b": "vercel-ai-sdk"}at/mcp, no key