Head to head · Agent frameworks · October 2026 research run
DSPy vs Haystack
Haystack scores 77.8 (BB) 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.
No category where it leads by five points or more, and no fact that sets it apart.
Watch for
3.5 changed the default adapter, reasoning and API routing and removed CodeAct and ProgramOfThought in a minor release
Haystack BB
Best for Python teams building retrieval-heavy agents or pipelines who want explicit components, approval hooks and resumable runs.
Ahead on
- Reliability, 81 against 62
- Schema & documentation, 88 against 71
- Agent ergonomics, 75 against 64
- Maintenance & community, 95 against 87
- Transparency & trust, 74 against 52
Also in its favour
- Agent-ready, a grade of BB or better
Watch for
Anonymous telemetry to PostHog EU is on by default and includes the Agent's model and tool names
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 Haystack +22
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.
Haystack 74
Apache-2.0 (30). The library stores nothing itself, and the telemetry page lists what each event carries and what it never collects, though the company privacy policy doesn't mention it (20). A written deprecation policy with FutureWarning for one minor release, a yearly limit on majors and a migration guide (20). Telemetry disclosed with an environment-variable opt-out (20). 30+20+20+20 = 90.
Reliability Haystack +19
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.
Haystack 81
Local-package reading. Official PyPI package haystack-ai with Python 3.11 or newer stated (20). A public tests workflow runs unit tests on Ubuntu, Windows and macOS for pushes to main and pull requests, plus e2e, CodeQL and Scorecard workflows; whether main passes wasn't read, as the Actions API refused us (15). 106 open issues and 68 open pull requests on 23 November 2026. The 50 newest issues were opened from 11 to 23 November, and 24 had a comment and 19 were closed (20). Release notes for every release and a migration guide for 3.0, but the policy says versions don't follow semantic versioning and minors remove deprecated functionality (11). 3.x with a Production/Stable classifier (15). 20+15+20+11+15 = 81.
Schema & documentation Haystack +17
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.
Haystack 88
Framework reading. A typed Python API (py.typed) with a generated API reference (22). llms.txt holds the full documentation, 493 pages in one file (10). The agent pages say what each hook and component is for, with a table of which hook guards which risk (16). Tools are typed from function signatures and components (13). Tutorials, a cookbook and code on every page; error types such as PipelineRuntimeError and tool invocation errors are shown in the guides without a catalogue (12). Versioned docs and release notes per release (15). 22+10+16+13+12+15 = 88.
Agent ergonomics Haystack +11
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.
Haystack 75
Framework reading. MCPToolset loads an MCP server's tools with a tool_names filter, and SearchableToolset shows the model only matching tools, but MCP needs the separate mcp-haystack package (20). max_agent_steps, a step budget hook, streaming and ToolResultOffloadCompactor bound a run and its context (17). Tool failures go back to the model by default, or raise when raise_on_tool_invocation_failure is set (14). Failed pipelines raise with a snapshot of the last valid state and runs resume from it or from a breakpoint, with no built-in durable store (14). The Agent needs a chat generator passed in, so there is no silent default provider, and the framework is Python only (10). 20+17+14+14+10 = 75.
Maintenance & community Haystack +8
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.
Haystack 95
3.5.0 tagged on 10 November 2026, 13 days before this check (30). Six releases in the 90 days to 23 November (3.1.1, 3.2.0, 3.3.0, 3.4.0, 3.4.1, 3.5.0) and nightly dev builds on PyPI (20). The 50 newest issues, opened from 11 to 23 November, had 24 with a comment and 19 closed, with 106 issues open (20). The package and its integrations are current, with 3.6 in release candidate (15). CodeQL, Scorecard, Dependabot updates and actions pinned to commit SHAs (10). 30+20+20+15+10 = 95.
Score by category
| Category | Weight | DSPy | Haystack | Edge |
|---|---|---|---|---|
| Reliability | 16% | 62 | 81 | Haystack +19 |
| Performance | 10%pending | pending | pending | not scored in this run |
| Schema & documentation | 13% | 71 | 88 | Haystack +17 |
| Agent ergonomics | 13% | 64 | 75 | Haystack +11 |
| Security & auth | 14% | 60 | 63 | Haystack +3 |
| Payments & pricing | 10% | 90 | 90 | even |
| Task success | 10%pending | pending | pending | not scored in this run |
| Maintenance & community | 7% | 87 | 95 | Haystack +8 |
| Transparency & trust | 7% | 52 | 74 | Haystack +22 |
| Negative events | ≤15 | 0 | -2 | |
| Total | B 68.3/100 | BB 77.8/100 |
Facts side by side
| Fact | DSPy | Haystack |
|---|---|---|
| Kind | Agent framework | Agent framework |
| Vendor | Stanford NLP | deepset |
| Hosted endpoint | no (local only) | no (local only) |
| Transports | ||
| Auth | None | None |
| 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-10 |
| Terms last updated | no document linked | 2025-07-24 |
| Privacy policy last updated | no document linked | 2026-10-23 |
| 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 | 39k stars | 27k stars |
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.
Haystack
An Apache-2.0 Python framework with an Agent component, per-tool approval hooks, MCP tools, failure snapshots, a written deprecation policy and releases every few weeks. It sends anonymous usage telemetry to deepset's PostHog by default, including agent model and tool names, until HAYSTACK_TELEMETRY_ENABLED is set to False.
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
Haystack
- Set HAYSTACK_TELEMETRY_ENABLED=False before importing haystack if usage events must not leave the machine
- Add a ConfirmationHook before tools that send, pay or delete
- Pass tool_names to MCPToolset so only the needed tools from an MCP server load
- Load pipeline YAML and resume snapshots only from trusted sources, since deserialisation can run code
- Pin haystack-ai to a minor version and read the release notes before upgrading
Questions
Which is better for AI agents, DSPy or Haystack?
Haystack scores 77.8 (BB) on agent readiness against DSPy's 68.3 (B), and leads in 6 of 7 scored categories.
Are DSPy and Haystack open source?
Yes. DSPy is open source (MIT). Haystack is open source (Apache-2.0).
Other comparisons with DSPy or Haystack
- AgentOS vs DSPy
- AgentOS vs Haystack
- Agno vs DSPy
- Agno vs Haystack
- BoxLang AI vs DSPy
- BoxLang AI vs Haystack
- Claude Agent SDK vs DSPy
- Claude Agent SDK vs Haystack
- CrewAI vs DSPy
- CrewAI vs Haystack
- Cursor Agent SDK vs DSPy
- Cursor Agent SDK vs Haystack
- Docker Agent vs DSPy
- Docker Agent vs Haystack
- DSPy vs Genkit
- DSPy vs Agent Development Kit (ADK)
- DSPy vs guilds.run
- 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
- DSPy vs AI SDK
- Genkit vs Haystack
- Agent Development Kit (ADK) vs Haystack
- guilds.run vs Haystack
- Haystack vs LangGraph
- Haystack vs LlamaIndex Framework
- Haystack vs Mastra
- Haystack vs Microsoft Agent Framework
- Haystack vs OpenAI Agents SDK
- Haystack vs Pydantic AI
- Haystack vs smolagents
- Haystack vs Strands Agents
- Haystack vs Terse Durable Actors
- Haystack vs TradingAgents
- Haystack vs AI SDK
Machine-readable
- This page as Markdown
/compare/dspy-vs-haystack.md· slim.min.md· JSON.json(or sendAccept: text/markdown) - Each listing in full
/api/v1/tools/dspy.json·/api/v1/tools/haystack.json - From a terminal
anchor compare dspy haystack(the CLI) - Over MCP
compare_tools {"a": "dspy", "b": "haystack"}at/mcp, no key