mastra vs haystack
Two of the top projects in Agent frameworks and SDKs, side by side: who leads on each score part and who each one suits, then setup, license, activity and what each review found.
mastra
TypeScript framework for building AI agents, workflows and MCP servers
haystack
Python framework for building RAG pipelines and agents from modular components
Verdict
mastra ranks higher, 92 to 89. Of the 4 score parts we measure for both, mastra leads on 3, haystack on none and 1 is even.
- Adoptionmastra leads by 2 points, 84 to 82: close to even.
- FreshnessEven at 100.
- Maintenancemastra leads by 1 point, 94 to 93: close to even.
- Agent-readymastra leads by 15 points, 85 to 70: a wide gap.
Pick mastra if you are
TypeScript developers building production agents and workflows
- Graph workflow engine with .then(), .branch() and .parallel() control flow
- Suspend and resume agents or workflows, with execution state kept in storage
Pick haystack if you are
Python developers building production RAG systems and agents
- Pipelines support loops, branches and conditional routing, so context flow is explicit and traceable
- Agent hooks (before_llm, before_tool, on_exit) plus step_count and token_usage tracking
| What we compare | mastra | haystack |
|---|---|---|
| Score parts, out of 100 | ||
| Adoption | 84, widely used | 82, widely used |
| Freshness | 100, active | 100, active |
| Maintenance | 94, healthy | 93, healthy |
| Agent-ready | 85, ready | 70, partly |
| Facts from GitHub and the README | ||
| Stars | 29.5k | 27k |
| License | custom license (read the license) | Apache-2.0 (permissive) |
| Last commit | Nov 2026 | Nov 2026 |
| Last release | Nov 2026 | Nov 2026 |
| Language | TypeScript | Python |
| Docker | No | Yes |
| GPU | Not needed | Optional |
| arm64 or Apple Silicon | Not stated | Not stated |
mastra
Mastra is a TypeScript framework for building agents and graph-based workflows, with model routing across 40+ providers. It adds suspend/resume with stored state, memory, RAG, evals and observability, and runs inside React, Next.js or Node apps or as a standalone server. A local Studio on port 4111 is used to build and test agents, workflows and tools.
Who it is for: TypeScript developers building production agents and workflows
Strengths
- Graph workflow engine with .then(), .branch() and .parallel() control flow
- Suspend and resume agents or workflows, with execution state kept in storage
- Built-in evals, observability, memory and RAG alongside agents
- Can author MCP servers exposing agents and tools
Weaknesses
- TypeScript only; no other language SDKs mentioned
- Code in ee/ directories needs an enterprise license for production use
- Pull requests limited to collaborators
- No Docker or compose files in the repo
- no GPU
- Needs Node.js, LLM provider API key
- Models: OpenAI, Anthropic, Gemini, xAI, 40+ providers via model router
- port 4111
haystack
Haystack is a Python framework for composing LLM applications as pipelines of components covering retrieval, routing, memory, tool calling and generation. One Pipeline runs sync or async and streams tokens, and the Agent class supports lifecycle hooks and concurrent tool calls. It integrates with OpenAI, Anthropic, Mistral, Cohere, Hugging Face, Google, Azure OpenAI, AWS Bedrock and local models.
Who it is for: Python developers building production RAG systems and agents
Strengths
- Pipelines support loops, branches and conditional routing, so context flow is explicit and traceable
- Agent hooks (before_llm, before_tool, on_exit) plus step_count and token_usage tracking
- Model-agnostic: many hosted providers and local models, swappable without rewriting pipelines
- Installs with pip install haystack-ai; Apache-2.0 licensed
Weaknesses
- Collects anonymous component-usage telemetry by default; opt-out is documented separately
- Serving as REST or MCP needs the separate Hayhooks project
- Governance, access controls and managed observability are in the paid Enterprise Platform
- Many integrations live in a separate haystack-core-integrations repo
- GPU optional
- Docker
- Needs Python, LLM provider or local model
- Models: OpenAI, Anthropic, Mistral, Cohere, Hugging Face
More in Agent frameworks and SDKs
Building with these?
We help teams pick an open-source AI stack and run it in production. Client work never changes a rank.