# Haystack vs LlamaIndex

## TL;DR

Both are Python frameworks that grew from retrieval into agents. Haystack builds everything from typed components wired into pipelines, with an `Agent` component and coordinator-plus-specialist multi-agent setups. LlamaIndex builds agents on event-driven Workflows, with `AgentWorkflow` handoffs between agents. Haystack favors explicit data flow; LlamaIndex favors handoff-style agent teams and a large integration catalog.

## Facts side by side

|  | [Haystack](https://multiagentguide.top/tools/haystack.md) | [LlamaIndex](https://multiagentguide.top/tools/llamaindex.md) |
| --- | --- | --- |
| Type | Framework | Framework |
| Languages / SDKs | Python | Python |
| License | Apache-2.0 | MIT |
| Pricing model | [Open core](https://www.deepset.ai/pricing) | [Open core](https://www.llamaindex.ai/pricing) |
| Orchestration pattern | Supervisor | Handoff |
| GitHub stars | 26,647 (as of 2026-10-04) | 52,398 (as of 2026-10-04) |
| GitHub forks | 3,228 | 8,274 |
| Last push | 2026-10-02 | 2026-10-01 |
| Latest release | v3.3.0 | v0.14.25 |
| Repository | [deepset-ai/haystack](https://github.com/deepset-ai/haystack) | [run-llama/llama_index](https://github.com/run-llama/llama_index) |
| Website | [haystack.deepset.ai](https://haystack.deepset.ai) | [developers.llamaindex.ai](https://developers.llamaindex.ai) |
| Documentation | [docs.haystack.deepset.ai](https://docs.haystack.deepset.ai/docs/intro) | [developers.llamaindex.ai](https://developers.llamaindex.ai/python/framework/) |
| Last verified | 2026-09-30 | 2026-09-30 |
| MCP support | [Yes (checked 2026-09-30)](https://docs.haystack.deepset.ai/docs/mcptool) | [Yes (checked 2026-09-30)](https://developers.llamaindex.ai/python/framework/module_guides/mcp/llamaindex_mcp/) |
| A2A support | Unknown (checked 2026-09-30) | Unknown (checked 2026-09-30) |
| AG-UI support | Unknown (checked 2026-09-30) | [Yes (checked 2026-09-30)](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/protocols/llama-index-protocols-ag-ui/README.md) |
| Install verified | Not yet | 2026-09-30 |

## Choose Haystack if

- You want explicit, inspectable pipelines where retrieval, routing and generation are separate components, serializable to YAML.
- You need tool-level human review with confirm, reject and modify (`ConfirmationHook`).
- You want to serve pipelines as REST, OpenAI-compatible or MCP endpoints with Hayhooks.

## Choose LlamaIndex if

- You want agents that hand off to each other (`AgentWorkflow` with `can_handoff_to`).
- You need AG-UI: LlamaIndex ships a first-party `llama-index-protocols-ag-ui` package; no AG-UI evidence was found for Haystack.
- You want run state in a serializable `Context` that can be stored and restored between runs.

## Migration notes

A Haystack `Agent` with tools maps to a LlamaIndex `FunctionAgent`. Haystack's coordinator pattern (specialists wrapped with `AgentTool`) maps to LlamaIndex's orchestrator pattern (sub-agents as tools); LlamaIndex handoffs have no direct Haystack equivalent. Haystack pipelines map to LlamaIndex Workflows, but the model differs: typed component sockets versus events passed between async steps. Human review moves between `ConfirmationHook` on `before_tool` and `ctx.wait_for_event(HumanResponseEvent, ...)` inside a tool. Points to check: Haystack 3.0 removed agent-level breakpoints and several legacy classes; LlamaIndex's README says the company's primary focus has shifted to LlamaParse, and LlamaIndex.TS is deprecated and archived. Both need separate packages for MCP (`mcp-haystack`, `llama-index-tools-mcp`).

## FAQ

### Which is better for RAG plus agents?

Both cover it. Haystack expresses RAG as explicit pipelines that an agent can sit inside; LlamaIndex has a large catalog of data integrations (the README counts over 300 packages) and agents built on Workflows.

### Do both support MCP?

Yes, in both directions: each can consume MCP servers as tools and publish pipelines or workflows as MCP servers.

### Is there a TypeScript version?

Not currently maintained for either: Haystack is Python only, and LlamaIndex.TS is deprecated and archived.

---

Data as of 2026-10-04. Not affiliated with listed projects. HTML version: https://multiagentguide.top/compare/haystack-vs-llamaindex-agents
