COMPARISONS · RAG FRAMEWORKS

Haystack vs LangChain vs LlamaIndex in 2026

AUTHOR · XERJ documentation team · REVIEWED BY · XERJ engineering team · PUBLISHED · 2026-11-27 · UPDATED · 2026-11-27
SHORT ANSWER · UPDATED 2026-11-27

Haystack vs LangChain vs LlamaIndex: pick Haystack when you want explicit, typed pipelines for production RAG and search. Pick LangChain when you want the largest set of integrations and a path to agents with LangGraph. Pick LlamaIndex when your work is mostly loading, parsing and indexing documents. All three are open source and free.

Key number: LangChain has 150,082 GitHub stars, LlamaIndex 53,025 and Haystack 27,120. Latest releases: langchain-core 1.8.5 (25 Nov 2026), LlamaIndex v0.14.26 (13 Nov 2026), Haystack v3.5.0 (10 Nov 2026).

Stars, licences and latest releases from the GitHub API on 27 Nov 2026. Features from each project README and docs.

TL;DR All three build RAG and agent apps in Python. Haystack by deepset wires components into pipelines you can read and test. LangChain has the widest set of model, vector store and tool integrations, with LangGraph for stateful agents. LlamaIndex is strongest on the data side: loaders, parsing, indexes and query engines over documents. Many teams mix them, and use a separate retrieval engine underneath.

TOOL · FILTER

Filter the frameworks by what your project needs

I need

Sort by

FrameworkCore ideaBest forLanguagesLatest releaseLicenceStars
HaystackComponents joined into pipelines for RAG, search and agentsProduction RAG and search pipelinesPythonv3.5.0, 10 Nov 2026Apache 2.027,120
LangChainBuilding blocks and integrations for LLM apps and agentsBroad integrations, fast prototypesPython, JavaScriptlangchain-core 1.8.5, 25 Nov 2026MIT150,082
LlamaIndexLoaders, indexes and query engines over your documentsDocument heavy RAGPython, TypeScriptv0.14.26, 13 Nov 2026MIT53,025
LangGraphStateful agents modelled as graphs, from the LangChain teamAgent control flow with loops and review stepsPython, JavaScriptcli 0.4.44, 25 Nov 2026MIT45,506
DSPyLM programs as modules, tuned by optimisersPrompts tuned against examplesPython3.5.0, 10 Nov 2026MIT39,260
XERJLocal search engine for agents over code, docs and files, with cited answersThe retrieval step under any of these frameworksAny, over CLI and MCPv1.0.0-rc.105, 23 Nov 2026Apache 2.021,817

Stars, licences and latest releases from the GitHub API on 27 Nov 2026. Tick boxes to keep only the frameworks that do all of them; sort by stars, newest release or name.
PASTE THIS TO YOUR AI AGENT. IT DOES THE REST Read https://xerj.org/compare/haystack-vs-langchain-vs-llamaindex.md. Ask me our language, what we build (RAG app, agent or search) and how much control we need over each step, then tell me whether Haystack, LangChain or LlamaIndex fits and sketch our first pipeline.

Pick one in ten seconds

Haystack vs LangChain vs LlamaIndex at a glance

The three frameworks overlap more each year, so the choice is mostly about style. Haystack asks you to declare a pipeline: retrievers, rankers, prompt builders and generators connected with typed inputs and outputs. LangChain gives you many small building blocks and integrations and leaves the wiring to you, with LangGraph for agents. LlamaIndex starts from your data: connectors, node parsers, indexes and query engines, plus workflows for agents.

When to choose Haystack

Choose Haystack when the app will run in production for a long time and you want each step visible and testable. Pipelines can be serialised, and components are easy to swap, which suits search and RAG teams that evaluate retrievers and rankers. It is Apache 2.0 licensed and maintained by deepset. For rankers, see best reranker models 2026.

When to choose LangChain

Choose LangChain when you want to try many models, vector stores and tools quickly; it has 150,082 GitHub stars and the largest integration list. For agents that need state and control flow, pair it with LangGraph. For a wider field, see LangChain alternatives 2026.

When to choose LlamaIndex

Choose LlamaIndex when most of the work is getting documents in: PDFs, wikis, tickets and databases, parsed into nodes and indexed for retrieval. It is MIT licensed and has a TypeScript version. For other options, see LlamaIndex alternatives 2026.

Where XERJ fits

A framework orchestrates the steps; the answer still depends on what retrieval finds. XERJ is a new way for AI to search for data: a local search engine for agents, with a neurosymbolic model inside, that indexes code, docs and files on your machine and returns cited answers over CLI and MCP. Call it as the retrieval step from Haystack, LangChain or LlamaIndex, or let a coding agent call it directly. See hybrid search for how keyword and vector results are combined.

How we checked

Stars, licences and the latest release of each project come from the GitHub API on 27 Nov 2026. For LangChain and LangGraph the latest release is the most recent package tag in the repository. Features come from each README and docs. We did not benchmark answer quality for this page.

Read next

FAQ

Is Haystack better than LangChain?

Haystack is better when you want explicit, testable pipelines for production RAG and search. LangChain is better when you want the most integrations and a quick prototype. Both are open source and free.

Is LlamaIndex better than LangChain for RAG?

LlamaIndex is stronger on the data side of RAG: loading, parsing and indexing documents. LangChain covers more integrations and agents. Many teams use parts of both.

Can I use Haystack, LangChain and LlamaIndex together?

Yes. They are Python libraries, so you can, for example, parse documents with LlamaIndex and run the app in a Haystack pipeline or a LangGraph agent. Keep one framework in charge of the control flow.

Which one works with JavaScript or TypeScript?

LangChain and LangGraph have JavaScript versions and LlamaIndex has a TypeScript version. Haystack is Python only.

Are they free?

Yes. Haystack is Apache 2.0 and LangChain and LlamaIndex are MIT licensed. You pay for the models and any hosted services you choose.

Evidence