Guide
LangChain vs LlamaIndex vs Haystack for Building AI Agents
LangChain, LlamaIndex, and Haystack compared from their AgentsUse profiles, verified 2026-10-15: recorded strengths, limits, licenses, packages, MCP support, tool pairings, and which job each framework fits.
2026-10-1715 min read
People search for these three names one at a time, usually after a project has already taken a shape: a pile of documents the agent must answer from, a set of tools it must call, or a pipeline that has to run the same way every day. LangChain, LlamaIndex, and Haystack all build agents in Python, all three are open source, and all three can call tools. That overlap is real, and it is also where the similarity mostly ends. Each framework centers a different part of the job, and the AgentsUse profiles record that difference plainly once you line the fields up side by side.
This guide does that lining up. Every claim about the three frameworks below comes from their published AgentsUse profiles, which are marked source_verified and were last verified on 2026-10-15. Where a profile does not record something, this guide does not fill the gap. The profiles record no head-to-head benchmark and no pricing for the frameworks themselves, so this guide makes no speed claim and no cost claim. What it does instead is match each framework to the job its own recorded description says it is built for, and show the recorded limits next to the recorded strengths.
Start with the job, not the name
Read the three recorded one-sentence pitches as job descriptions and the choice gets easier before any feature list enters the picture:
- LangChain, recorded pitch: Agent framework for Python and TypeScript that standardizes model, tool, and retrieval interfaces so teams can swap providers without rewriting the agent loop.
- LlamaIndex, recorded pitch: Python framework for ingestion, indexing, and retrieval that grounds agents and LLM applications in private data.
- Haystack, recorded pitch: Python orchestration framework for production LLM applications built from explicit, modular pipelines and agents.
Swap providers without rewriting. Ground an application in private data. Orchestrate a production application step by step. Those are three different centers of gravity: the interface layer, the data layer, and the pipeline layer. A team can use more than one of these frameworks on the same product, and the recorded descriptions leave room for that. The mistake to avoid is picking one as a general answer and then fighting its center of gravity for months. Pick the one whose center matches the part of your system that carries the most weight, and let the other parts stay simple.
LangChain: standard interfaces and a large integration catalog
The LangChain profile records a framework that chains interoperable components and third-party integrations behind common interfaces. The Python package connects models from providers such as OpenAI, Anthropic, and Google through a prebuilt agent architecture, so provider choice stays a configuration decision rather than a rewrite. Its recorded design centers on model interoperability, real-time data access through a large integration library, and rapid prototyping with modular components.
The same profile is clear about where LangChain stops and a sibling project starts. Projects that outgrow the prebuilt loop move to LangGraph for orchestration control; LangChain agents already run on LangGraph, which provides durable execution, streaming, human-in-the-loop review, and persistence. The wider ecosystem splits responsibilities in the same way: LangGraph for low-level orchestration, LangSmith for evaluation and observability, and deployment tooling for long-running stateful workflows. This record covers the Python package; the repository also references an equivalent JavaScript and TypeScript library, which makes LangChain the only one of the three with TypeScript recorded in its languages field.
What the profile records that LangChain does:
- Standard interfaces for chat models, embedding models, vector stores, retrievers, and tools.
- A prebuilt agent architecture on LangGraph, with durable execution, streaming, and persistence included.
- A large official integrations catalog spanning search, scraping, browser, and platform tools.
- Provider swapping through common abstractions, which keeps model experiments cheap.
- LangSmith integration for tracing, evaluation, observability, and debugging.
What the profile records that LangChain does not do:
- Search, scraping, and browser automation come from integration partners and their API keys. LangChain supplies the wiring, not the hosted service.
- Heavily custom or deterministic workflows belong in LangGraph. The docs route those users there directly.
- Provider credentials, tool permissions, and production monitoring still need separate configuration.
The setup example recorded on the profile installs the Python package, then initializes a chat model with a provider string:
uv add langchain
from langchain.chat_models import init_chat_model
model = init_chat_model("openai:gpt-5.5")
result = model.invoke("Hello, world!")LlamaIndex: ingestion, indexing, and retrieval first
The LlamaIndex profile records a framework assembled from a core package plus chosen integrations. Teams install either the starter llama-index package or llama-index-core with individual integration packages; the package page references over 300 integration packages. Data connectors ingest sources such as APIs, PDFs, docs, and SQL. Data is structured into indices and graphs, and a retrieval and query interface returns retrieved context with knowledge-augmented output. Lower-level APIs expose loaders, indices, retrievers, query engines, and reranking modules for customization.
Two recorded details shape how to read this framework. First, the company focus has shifted toward LlamaParse, an enterprise platform for agentic OCR, parsing, extraction, and indexing; the open source framework remains available as an open toolkit, and LlamaHub serves as the registry of prebuilt agent tools. Second, the profile names the boundary directly: general multi-agent orchestration is not the core shape here. The documented strength is data ingestion, indexing, and retrieval for LLM applications. A team whose hard problem is getting private data into a form an agent can use well is looking at the framework built around exactly that problem. A team whose hard problem is coordinating many agents should read that boundary line twice before committing.
What the profile records that LlamaIndex does:
- Connectors and readers for APIs, PDFs, documents, SQL, and other sources.
- Indices and graphs for structured data, with retrieval and query engines on top.
- Agents and workflows that accept prebuilt LlamaHub tool specs and custom tools.
- A large integration ecosystem for LLMs, embeddings, vector stores, and tools, delivered as separate packages.
- Optional LlamaParse services for document parsing, extraction, and indexing.
What the profile records that LlamaIndex does not do:
- General multi-agent orchestration is not the core shape here. The documented strength is data ingestion, indexing, and retrieval for LLM applications.
- LlamaParse is a separate account-based service. The OSS framework does not include hosted parsing.
- Individual LlamaHub tools still need their own service API keys and package installs.
The setup example recorded on the profile reads documents from a directory, builds a VectorStoreIndex, and queries it:
pip install llama-index
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader
documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()Haystack: explicit pipelines for production LLM applications
The Haystack profile records an open-source AI orchestration framework for production LLM applications in Python. Pipelines and agent workflows stay modular, with explicit control over retrieval, routing, memory, and generation at each step. The project centers on context engineering: scalable RAG systems, multimodal applications, semantic search, question answering, and autonomous agents in a transparent architecture. The profile also records production-built agents, native async support, and modular components for retrieval, indexing, tool calling, memory, and evaluation.
Haystack is recorded as model and vendor agnostic, with integrations for providers such as OpenAI, Mistral, Anthropic, Cohere, Hugging Face, Google, Azure OpenAI, and AWS Bedrock. One serving detail is worth separating from the core framework: Hayhooks serves Haystack pipelines and agents as REST APIs or MCP servers. The contrast with LangChain is instructive. LangChain's recorded center is a standard interface in front of many providers and integrations, with custom orchestration handed to LangGraph. Haystack's recorded center is the pipeline itself, kept explicit inside the one framework. Neither shape is a verdict on the other; they answer different questions about where a team wants control to live.
What the profile records that Haystack does:
- Modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation
- RAG, multimodal applications, semantic search, and question answering use cases
- Built-in components for retrieval, indexing, tool calling, memory, and evaluation, plus custom components
- Pipelines that run synchronously or asynchronously with streaming, and agents with concurrent tool calls
- Integrations across model providers and infrastructure components, without locking to one vendor
What the profile records that Haystack does not do:
- Hosted models sit outside the framework. Haystack orchestrates models and components you configure
- MCP serving runs through Hayhooks and integrations, not a single-purpose server builder
- The core project is Python. There is no TypeScript framework here
The setup example recorded on the profile installs Haystack, then connects an MCP server through MCPToolset, per the Haystack MCP docs:
pip install haystack-ai mcp-haystack from haystack_integrations.tools.mcp import MCPToolset, StdioServerInfo toolset = MCPToolset(server_info=StdioServerInfo(command="uvx", args=["mcp-server-time"]))
The full comparison, field by field
The table below uses the short fields recorded on all three profiles. Star and fork counts are the snapshot recorded on each profile with a metrics check date of 2026-10-15; treat them as a dated snapshot, not a live count and not a quality score for the software. The longer recorded fields follow the table as list rows, so nothing on the profiles is skipped.
Field | LangChain | LlamaIndex | Haystack Vendor | LangChain Inc | LlamaIndex | deepset Ecosystem recorded on profile | Python | Python | Python Languages | Python, TypeScript | Python | Python Open source | Yes | Yes | Yes License (SPDX) | MIT | MIT | Apache-2.0 Package name | langchain | llama-index | haystack-ai Package registry | PyPI | PyPI | PyPI Package version recorded on profile | 1.4.6 | 0.14.25 | 3.4.0 Homepage | langchain.com | llamaindex.ai | haystack.deepset.ai Documentation | docs.langchain.com | developers.llamaindex.ai/python/framework | docs.haystack.deepset.ai GitHub repository | github.com/langchain-ai/langchain | github.com/run-llama/llama_index | github.com/deepset-ai/haystack GitHub stars recorded 2026-10-15 | 147,878 | 52,512 | 26,744 GitHub forks recorded 2026-10-15 | 24,816 | 8,348 | 3,288 AgentsUse record status | published | published | published Verification status | source_verified | source_verified | source_verified Profile last verified | 2026-10-15 | 2026-10-15 | 2026-10-15 Profile first published | 2026-10-07 | 2026-10-07 | 2026-10-07 AgentsUse record quality score | 90 | 88 | 90 Setup example recorded on profile | Install LangChain and call a model | Install LlamaIndex and build a vector index | Install Haystack and run an MCP toolset agent Setup code language | python | python | python Env vars in recorded setup | OPENAI_API_KEY | OPENAI_API_KEY | OPENAI_API_KEY Sourced tool pairings in this catalog | 7 | 3 | 3 Sources recorded on profile | 3 | 3 | 4
- Profile description, first recorded line - LangChain: LangChain chains interoperable components and third-party integrations behind common interfaces. LlamaIndex: LlamaIndex is an open-source framework for agentic applications, assembled from a core package plus chosen integrations. Haystack: Haystack is an open-source AI orchestration framework for production LLM applications in Python.
- What it does (recorded list) - LangChain: 5 recorded items, listed in full in the LangChain section above. LlamaIndex: 5 recorded items, listed in full in the LlamaIndex section above. Haystack: 5 recorded items, listed in full in the Haystack section above.
- What it does not do (recorded list) - LangChain: 3 recorded limits, listed in full above, covering hosted services, custom workflows, and separate configuration. LlamaIndex: 3 recorded limits, listed in full above, covering multi-agent orchestration, hosted parsing, and tool keys. Haystack: 3 recorded limits, listed in full above, covering hosted models, MCP serving, and TypeScript.
- MCP support - LangChain: MCP tools load through langchain-mcp-adapters, which converts MCP server tools into LangChain tools for LangChain and LangGraph agents. LlamaIndex: MCP tools convert into agent tools through McpToolSpec with a BasicMCPClient. Haystack: MCPToolset dynamically discovers and loads tools from any MCP-compliant server over Streamable HTTP, SSE (deprecated), or StdIO, and Hayhooks can also expose pipelines and agents as MCP servers.
Tool pairings recorded in this catalog
Compatibility on AgentsUse is a sourced fact, recorded per pairing with the evidence page that proves it, never inferred from a shared category. Counting those records gives a narrow, checkable picture of how much verified tool wiring each profile carries on this site today. The LangChain record carries 7 sourced pairings: Tavily, Exa, Firecrawl, Apify, Playwright, and Composio as official adapters, plus LangSmith as a native pairing. The LlamaIndex record carries 3: Tavily, Exa, and the Brave Search API, all as official adapters. The Haystack record carries 3: Tavily, the Brave Search API, and Firecrawl, all as official adapters.
Read that count for what it is. It measures how much pairing evidence this catalog has verified and published, on the records checked on 2026-10-15. It does not measure how many tools each framework can connect to in total; each profile separately records a large integration ecosystem or catalog of its own. If a specific tool matters to your project, check its pairing on the framework profile before you assume it works, and treat an absent pairing as unverified here rather than as proof of incompatibility.
A decision path you can run in five minutes
Work down this list and stop at the first row that describes your project. Each recommendation cites the recorded reason behind it, so you can argue with the reason instead of arguing with a ranking.
- If your job is swapping model providers, or wiring search, scraping, browser, and platform tools into an agent loop through standard interfaces, start with LangChain, because its recorded pitch centers on standardizing model, tool, and retrieval interfaces so teams can swap providers without rewriting the agent loop, and its profile records a large official integrations catalog.
- If your job is grounding an agent or LLM application in private data held in APIs, PDFs, documents, or SQL, start with LlamaIndex, because ingestion, indexing, and retrieval are its recorded core, with connectors, indices, and query engines recorded as the main shape of the framework.
- If your job is a production LLM application, such as a RAG system, semantic search, or question answering, where retrieval, routing, memory, and generation each need explicit control, start with Haystack, because its recorded design centers on modular pipelines and agent workflows with explicit control at each step.
- If your job must be built in TypeScript, start with LangChain, because it is the only one of the three whose profile records TypeScript in its languages; the LlamaIndex profile records Python only, and the Haystack profile records that the core project is Python with no TypeScript framework.
- If your job is general multi-agent orchestration as the main shape of the system, do not force a pick from this page, because the LlamaIndex profile records that shape as outside its core, and the other two profiles center interfaces and pipelines instead. Compare the wider set of published frameworks on the framework comparison page before you decide.
- If license review is part of your process, note the recorded licenses before the trial starts: LangChain MIT, LlamaIndex MIT, Haystack Apache-2.0. All three profiles record open source as yes.
What these profiles do not tell you
Three gaps are worth naming because comparison pages usually hide them. First, pricing: all three profiles record open source software with a license, and none records a price for the framework itself. Each profile does record paid or account-based pieces sitting next to the framework: LlamaParse is recorded as a separate account-based service on the LlamaIndex record, and integration partners supply their own hosted services and API keys on the LangChain record. Budget questions belong to those services, not to this comparison. Second, performance: no profile records a benchmark against the other two, so any speed claim you read elsewhere did not come from this data. Third, freshness: package versions, star counts, and pairing counts in this guide are the values recorded when the profiles were checked on 2026-10-15. Frameworks release often; the profile pages carry the last verified date so you can judge how current a figure is before you rely on it.
Test the shortlist on your own job before you commit
A framework trial works when it is boring. Take one real task from your own backlog, small enough to finish in a day and real enough to expose the data and tool problems your production version will meet. Build it once in the framework the decision path pointed to, using the setup example recorded on its profile as the starting point, and write down three things: how the task's data entered the system, how each tool call was wired, and which step you would least want to debug at night. If the trial fights you, build the same task in the second candidate and compare the two sets of notes, not the two demos. The recorded limits sections on the profiles predict most of the friction in advance: a trial that needs hosted parsing, deterministic custom orchestration, or TypeScript will hit the exact boundary its profile already names.
Keep the trial artifacts either way. The notes on data entry, tool wiring, and the painful step stay useful after the choice is made, because they describe your workload rather than a framework's marketing page. When the workload changes shape, run the decision path again instead of defending the original pick out of habit.
Where to go next on this site
The three profiles linked throughout this guide carry the full records behind every row above, including sources, setup sources, and health metrics with their check dates. The guides hub collects the rest of the operating guides, including the earlier general guide to comparing agent frameworks on control, observability, and cost. For tools rather than frameworks, the category archives group the catalog by job, and the framework profiles link onward to the sourced tool pairings recorded for each framework.
Sources and further reading
- LangChain framework profile on AgentsUse (agentsuse.com/frameworks/langchain): pitch, description, capabilities, limits, setup, MCP support, and health metrics recorded from the GitHub repository and PyPI package pages listed on the profile. Last verified 2026-10-15.
- LlamaIndex framework profile on AgentsUse (agentsuse.com/frameworks/llama-index): pitch, description, capabilities, limits, setup, MCP support, and health metrics recorded from the GitHub repository and PyPI package pages listed on the profile. Last verified 2026-10-15.
- Haystack framework profile on AgentsUse (agentsuse.com/frameworks/haystack): pitch, description, capabilities, limits, setup, MCP support, and health metrics recorded from the GitHub repository, MCPToolset documentation, WebSearch documentation, and PyPI pages listed on the profile. Last verified 2026-10-15.
From the AgentsUse catalog
Published profiles for the tools and frameworks this guide discusses, with setup, limits, and maintenance signals checked against primary sources.
Frequently asked questions
Is LangChain the same thing as LangGraph?
No. The LangChain profile records LangGraph as the low-level orchestration piece of the same ecosystem: LangChain agents already run on LangGraph, and projects that outgrow the prebuilt loop move to LangGraph for orchestration control, durable execution, streaming, human-in-the-loop review, and persistence.
Can LlamaIndex build agents, or does it only handle private data?
Both parts are on the record, with a clear center. The profile records agents and workflows that accept prebuilt LlamaHub tool specs and custom tools. It also records that general multi-agent orchestration is not the core shape, and that the documented strength is data ingestion, indexing, and retrieval for LLM applications.
Is Haystack only for RAG?
No. The Haystack profile records RAG alongside multimodal applications, semantic search, question answering, and autonomous agents, inside modular pipelines and agent workflows with explicit control over retrieval, routing, memory, and generation.
Which of the three frameworks works in TypeScript?
LangChain, on the recorded data. Its profile lists Python and TypeScript as languages and notes an equivalent JavaScript and TypeScript library. The LlamaIndex profile lists Python only, and the Haystack profile records that the core project is Python and there is no TypeScript framework there.
Do all three frameworks support MCP tools?
Yes, each through a different recorded mechanism. LangChain loads MCP tools through langchain-mcp-adapters. LlamaIndex converts MCP tools into agent tools through McpToolSpec with a BasicMCPClient. Haystack loads tools through MCPToolset over Streamable HTTP, SSE, or StdIO, and Hayhooks can also expose Haystack pipelines and agents as MCP servers.
Are LangChain, LlamaIndex, and Haystack all open source?
Yes, per their AgentsUse profiles, all last verified on 2026-10-15. The recorded licenses are MIT for LangChain, MIT for LlamaIndex, and Apache-2.0 for Haystack.
Keep reading
Guide
Comparing AI Agent Frameworks
Framework marketing converges on the same claims. The dimensions that matter for choosing: control, observability, tooling, deployment, cost, and team fit, plus a 30-day evaluation plan and the build-versus-buy math.
2026-09-29
Guide
How to Choose an AI Agent for a Specific Task
A job-first framework for choosing an agent for one specific task. Write the job down, score candidates on five criteria, run a same-task test on your own inputs, and cost the winner before it touches real work.
2026-10-04
Guide
How AI Agents Actually Use Tools: Function Calling and MCP
A builder's guide to agent tool calling: JSON tool schemas, the reason-call-observe loop, and the MCP standard with transports and security.
2026-10-10
Accounts and the planned features are not open yet. See what is planned. The catalog and the browser workspace are free and need no account.