
RAG Orchestration Frameworks: LangChain vs LlamaIndex vs Haystack (2026)
LangGraph 1.0 shipped its first stable release in late 2025, and LangChain hit 143,060 GitHub stars by July 2026. Those two facts bookend the decision you're making. The best RAG framework in 2026 depends on one question: do you actually need one? For a single-corpus Q&A app on one provider, a provider SDK plus a vector client is enough. For multi-source ingestion or agentic retrieval, pick LangChain/LangGraph or LlamaIndex.
This comparison owns the orchestration-layer decision only. It deliberately excludes vector databases, rerankers, and evaluation products; those belong in our broader RAG tools ranking.
Key Takeaways
- Default pick: LangChain 1.0 + LangGraph for production apps needing multi-step orchestration.
- Single corpus, one provider? Skip the framework. Provider SDK + vector client ships faster.
- Framework overhead sits under 10% of total RAG latency. Retrieval strategy matters more.
- Check
pushed_at, not stars. A live repo beats a starred corpse every time.
Every RAG orchestration framework in 2026, compared
Eight orchestration frameworks and one no-framework option, scored on what an engineering lead actually checks before committing. This table covers the orchestration layer only. For the full RAG stack, including vector databases and rerankers, that's a separate decision.
Last verified: 2026-07-31
| Framework | Best for | Language | Licence | Self-host | Managed option | Verdict |
|---|---|---|---|---|---|---|
| LangChain / LangGraph | Multi-step agentic pipelines | Python, JS | MIT | Yes | LangSmith | Default pick for production |
| LlamaIndex | Document-heavy ingestion | Python, TS | MIT | Yes | LlamaCloud | Best parsing out of the box |
| Haystack | Enterprise NLP, EU teams | Python | Apache-2.0 | Yes | deepset Cloud | Strongest typed-pipeline story |
| DSPy | Prompt optimization at scale | Python | MIT | Yes | None | Research-grade, steep curve |
| RAGFlow | PDF/document parsing | Python | Apache-2.0 | Yes | None | Best free doc-parsing engine |
| Dify | No-code/low-code teams | Python | Apache-2.0 (modified) | Yes | Dify Cloud | Fastest prototype, least control |
| txtai | Lightweight single-file apps | Python | Apache-2.0 | Yes | None | Smallest footprint, limited scope |
| Semantic Kernel | .NET / enterprise Microsoft | C#, Python, Java | MIT | Yes | Azure AI | The .NET answer, period |
| No framework | Single corpus, one provider | Any | N/A | N/A | N/A | Fastest to ship, hardest to extend |
The verdicts above are starting points, not final answers. The next section tells you whether you need any of these at all. If you do, the code comparison in H2 #3 shows what living in each one actually looks like.
Do you actually need a RAG framework in 2026?
Maybe not. A retrieval-augmented generation (RAG) framework earns its place when your pipeline has genuine orchestration complexity. For a straightforward question-answering app on a single corpus, one LLM provider, and a standard chunking strategy, a provider SDK plus a vector client is genuinely enough. You'll ship in days, not weeks.
Three branches, stated plainly:
Branch 1: Single corpus, one provider, straightforward Q&A. Use the provider SDK directly. OpenAI's embeddings endpoint plus Qdrant, Chroma, or pgvector as your vector store gets you a working pipeline in under 50 lines. No abstraction tax. No framework upgrades to track. If you need the pipeline concepts before choosing, build a RAG pipeline end to end first.
Branch 2: Multi-source ingestion, dozens of document formats, parsing pain. A framework earns its keep here. LlamaIndex's readers handle 160+ file formats. Haystack's converters and RAGFlow's deep PDF parsing save you weeks of custom loader code. The orchestration overhead is real but small next to the ingestion work.
Branch 3: Agentic, multi-step retrieval. Use a framework or you'll rebuild LangGraph badly and without tests. Conditional routing, human-in-the-loop checkpoints, and stateful multi-turn retrieval are exactly what LangGraph 1.0 was built for.
The counter-narrative is real and documented. Octomind ran LangChain in production for over 12 months from early 2023, then removed it in 2024. Their stated reason: the abstractions made lower-level changes hard or impossible, and modular building blocks simplified the codebase. The Hacker News discussion drew hundreds of comments from engineers with similar stories.
What changed on the vendor side: provider SDKs absorbed much of what frameworks used to abstract. Native tool use, streaming tool calls, and prompt caching are now first-class in the OpenAI and Anthropic SDKs. The abstraction gap that justified a framework in 2023 narrowed considerably by 2026.
Most teams overestimate the orchestration complexity they'll face and underestimate the cost of a framework they don't need.
The same RAG pipeline, written four ways
The fastest way to judge a framework is to read the same task written in it. Below: ingest two documents, index them, answer a question. Same inputs, same output shape. Four implementations.
LangChain (18 lines):
from langchain_community.document_loaders import TextLoader
from langchain_openai import OpenAIEmbeddings, ChatOpenAI
from langchain_community.vectorstores import InMemoryVectorStore
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough
from langchain_core.output_parsers import StrOutputParser
docs = TextLoader("docs/guide.txt").load() + TextLoader("docs/faq.txt").load()
vectorstore = InMemoryVectorStore.from_documents(docs, OpenAIEmbeddings())
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
prompt = ChatPromptTemplate.from_template(
"Answer from context:\n{context}\n\nQuestion: {question}"
)
chain = (
{"context": retriever, "question": RunnablePassthrough()}
| prompt
| ChatOpenAI(model="gpt-4o")
| StrOutputParser()
)
print(chain.invoke("What is the return policy?"))Observation: 18 lines, readable, but the import list alone tells you the dependency surface you're signing up for.
LlamaIndex (12 lines):
from llama_index.core import VectorStoreIndex, SimpleDirectoryReader, Settings
from llama_index.llms.openai import OpenAI
from llama_index.embeddings.openai import OpenAIEmbedding
Settings.llm = OpenAI(model="gpt-4o")
Settings.embed_model = OpenAIEmbedding()
documents = SimpleDirectoryReader("docs/").load_data()
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine(similarity_top_k=4)
print(query_engine.query("What is the return policy?"))Observation: 12 lines. The shortest path from folder to answer. Which embedding model you feed it matters more than the framework wrapping it.
Haystack (16 lines):
from haystack import Pipeline
from haystack.components.converters import TextFileToDocument
from haystack.components.writers import DocumentWriter
from haystack.components.embedders import OpenAITextEmbedder, OpenAIDocumentEmbedder
from haystack.components.retrievers import InMemoryEmbeddingRetriever
from haystack.components.generators import OpenAIGenerator
from haystack.document_stores.in_memory import InMemoryDocumentStore
store = InMemoryDocumentStore()
indexing = Pipeline()
indexing.add_component("converter", TextFileToDocument())
indexing.add_component("embedder", OpenAIDocumentEmbedder())
indexing.add_component("writer", DocumentWriter(document_store=store))
indexing.connect("converter", "embedder")
indexing.connect("embedder", "writer")
indexing.run({"converter": {"sources": ["docs/guide.txt", "docs/faq.txt"]}})
query = Pipeline()
query.add_component("embedder", OpenAITextEmbedder())
query.add_component("retriever", InMemoryEmbeddingRetriever(document_store=store, top_k=4))
query.add_component("generator", OpenAIGenerator(model="gpt-4o"))
query.connect("embedder", "retriever")
query.connect("retriever", "generator")
print(query.run({"embedder": {"text": "What is the return policy?"}}))Observation: 16 lines but the most explicit wiring. Every connection is visible. That verbosity pays off at 40+ components.
No framework (14 lines):
from openai import OpenAI
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams, PointStruct
client = OpenAI()
qdrant = QdrantClient(url="http://localhost:6333")
qdrant.create_collection("docs", VectorParams(size=1536, distance=Distance.COSINE))
texts = [open("docs/guide.txt").read(), open("docs/faq.txt").read()]
embeddings = client.embeddings.create(input=texts, model="text-embedding-3-small")
points = [PointStruct(id=i, vector=e.embedding, payload={"text": t})
for i, (e, t) in enumerate(zip(embeddings.data, texts))]
qdrant.upsert("docs", points)
query_emb = client.embeddings.create(input=["return policy"], model="text-embedding-3-small")
hits = qdrant.query_points("docs", query_emb.data[0].embedding, limit=4).points
context = "\n".join(h.payload["text"] for h in hits)
answer = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": f"Answer from context:\n{context}\n\nQuestion: What is the return policy?"}]
)
print(answer.choices[0].message.content)Observation: 14 lines, zero framework dependencies, the vector database underneath is the only infrastructure choice. Hardest to extend past 3 document types.
The 8 RAG frameworks worth knowing in 2026
The right framework is the one whose abstractions match your actual bottleneck. Parsing pain points to LlamaIndex or RAGFlow. Orchestration complexity points to LangGraph. Enterprise compliance points to Haystack or Semantic Kernel. Here's the full field.
1. LangChain / LangGraph, best for multi-step agentic pipelines
The largest ecosystem in the space, now stabilised under a 1.0 LTS release. LangChain 1.0 introduced create_agent and a middleware system; LangGraph 1.0 reached GA with durable state and human-in-the-loop checkpoints. The honest limit: the abstraction surface is large, and teams that only need simple retrieval carry weight they'll never use. LangGraph is under-used by the field despite being the strongest stateful-orchestration option available. For the agent-loop angle specifically, see how LangGraph compares to CrewAI and the OpenAI Agents SDK.
Pick this if you need conditional routing, multi-turn retrieval, or human approval gates in production.
2. LlamaIndex, best for document-heavy ingestion
160+ data connectors, the strongest out-of-box parsing for PDFs, tables, and structured documents. Workflows 1.0 added a lightweight event-driven layer for agentic patterns without the full LangGraph weight. The limit: if your bottleneck is orchestration rather than ingestion, LlamaIndex's query engine abstractions start fighting you. The TypeScript port trails Python by a few releases.
Pick this if your corpus is messy (scanned PDFs, tables, mixed formats) and parsing is where you lose time.
3. Haystack, best for enterprise NLP and EU teams
Apache-2.0 licensed, typed pipeline components, and a strong story for regulated industries. Haystack 3.0 (released July 2026) cleaned up the component API further. deepset offers a managed cloud option for teams that don't want to self-host. The limit: smaller community than LangChain or LlamaIndex, fewer third-party integrations, and the 1.x-to-2.x migration was a near-complete rewrite that burned early adopters.
Pick this if you're in a regulated EU industry and need Apache-2.0 licensing with typed, auditable pipelines.
4. RAGFlow, best for free, deep document parsing
An Apache-2.0 engine from InfiniFlow that does template-based PDF parsing (tables, figures, formulas) better than anything else in the open-source field. 86,478 stars and active weekly releases. The limit: it's more of a parsing-and-retrieval engine than a general orchestration framework. You'll still need something else for agentic routing or multi-provider failover.
Pick this if document parsing accuracy is your single biggest bottleneck and you want it free.
5. DSPy, best for prompt optimization at scale
Stanford's framework treats prompts as programs you compile, not strings you write. You define signatures and metrics; DSPy optimizes the prompts and few-shot examples automatically. The limit: the learning curve is steep, the abstractions are academic, and production deployment patterns are still maturing. Version 3.2.1 shipped in May 2026.
Pick this if you have evaluation data, want systematic prompt optimization, and have the patience for a research-grade tool.
6. Dify, best for no-code prototyping
A visual builder that gets a working RAG app running in an afternoon. 150,858 stars, the most-starred project in this list. The limit: it's a platform, not a library. You trade code-level control for speed. Custom retrieval logic beyond the visual editor gets awkward fast. The licence is a modified Apache-2.0 with additional commercial terms for multi-tenant deployments.
Pick this if you need a working demo this week and your retrieval logic is standard.
7. txtai, best for lightweight single-file applications
An all-in-one embeddings database, retrieval engine, and LLM pipeline in a single Python package. 12,769 stars, Apache-2.0, and genuinely the lightest option here. The limit: it's designed for small-to-medium workloads. Multi-node scaling, complex routing, and enterprise features aren't the goal.
Pick this if you want the smallest possible dependency footprint and your corpus fits in one process.
8. Semantic Kernel, best for .NET and enterprise Microsoft shops
Microsoft's SDK for integrating LLMs into C#, Python, and Java applications. Native Azure AI integration, enterprise-grade telemetry, and the only real answer for teams locked into the Microsoft stack. The limit: outside Azure, the integration story thins out. The Python SDK trails the C# one in feature velocity.
Pick this if your team writes C# or Java and your infrastructure is already Azure.
Pathway deserves a mention as a streaming-index option for continuously updated corpora, but it's a data-processing framework rather than a RAG orchestration layer, so it doesn't get a ranked slot.
Which RAG frameworks are still actively maintained?
Stars tell you what was popular. Last-commit date tells you what is alive. Every framework below had a commit within 48 hours of this writing, which is healthier than the field looked 12 months ago.
Pulled from the GitHub REST API on 2026-07-31. Method: GET /repos/{owner}/{repo} for stars and pushed_at, GET /repos/{owner}/{repo}/releases/latest for the release tag.
| Framework | Repo | Stars | Last commit | Latest release | Licence |
|---|---|---|---|---|---|
| LangChain | langchain-ai/langchain | 143,060 | 2026-07-30 | langchain-core 1.5.3 | MIT |
| LlamaIndex | run-llama/llama_index | 51,251 | 2026-07-30 | v0.14.23 | MIT |
| Haystack | deepset-ai/haystack | 26,070 | 2026-07-31 | v3.0.0 | Apache-2.0 |
| DSPy | stanfordnlp/dspy | 36,484 | 2026-07-30 | 3.2.1 | MIT |
| RAGFlow | infiniflow/ragflow | 86,478 | 2026-07-31 | v0.26.4 | Apache-2.0 |
| Dify | langgenius/dify | 150,858 | 2026-07-31 | 1.16.1 | Apache-2.0 (modified) |
| txtai | neuml/txtai | 12,769 | 2026-07-30 | v9.12.0 | Apache-2.0 |
| Semantic Kernel | microsoft/semantic-kernel | 28,394 | 2026-07-30 | dotnet-1.78.0 | MIT |
The pushed_at column is the one nobody else prints. A framework with 90K stars and no commits in four months is a liability, not an asset. All eight repos here are actively maintained as of this writing. Re-run the query yourself before committing; the numbers move weekly.
Does your RAG framework affect latency?
Barely. Framework overhead is the smallest term in your total response time. Retrieval strategy and LLM generation dominate, and teams that pick a framework on benchmark milliseconds are optimising the wrong variable.
The strongest evidence comes from the July 2026 arXiv scaling study, BM25 Wins at Scale. The researchers measured 28 nested corpus tiers across a 450x scale range. Their finding: BM25 overtakes agentic search at roughly 10 million corpus tokens and leads every larger tier, with a margin approaching 20 points at full scale. Retrieval strategy, not orchestration plumbing, determines whether your answers are good.
Here's a derived latency budget for one typical RAG response. Every value except orchestration overhead comes from a published source loaded during writing:
| Stage | Median latency | Source |
|---|---|---|
| Query embedding | ~50 ms | OpenAI embeddings API docs (text-embedding-3-small, single input) |
| Vector search (top-4) | ~15 ms | Qdrant published benchmarks, 1M vectors, p50 |
| Reranking (4 docs) | ~80 ms | Cohere Rerank API docs, English, 4 passages |
| LLM generation (300 tokens) | ~1,200 ms | OpenAI gpt-4o, 300 output tokens, no streaming |
| Orchestration overhead | ~50 ms (generous upper bound) | Not reproducibly published; see note below |
Assumptions: single-user query, warm connections, no network retries. The generation stage alone is 86% of the total.
"Where one RAG response spends its time (illustrative budget, July 2026)"
Data table
| "Pipeline stage" | "Median latency (ms)" |
|---|---|
| "Query embedding" | 50 |
| "Vector search" | 15 |
| "Reranking" | 80 |
| "LLM generation" | 1200 |
| "Framework overhead" | 50 |
The honest hole: nobody publishes a reproducible measurement of framework overhead. One figure circulating online (15-40 ms, attributed to a content site in April 2026) sits behind a page that returned HTTP 403 on both 2026-07-30 and 2026-07-31, so we cannot cite it. Even granting a generous 50 ms of orchestration overhead, that's under 4% of a 1,395 ms total response.
Our reading of those numbers: framework choice is not a latency decision. Retrieval strategy and generation are. If your RAG app feels slow, profile the LLM call and the retrieval step before you blame the orchestration layer.
What we wouldn't start a new project on in 2026
Three items, each backed by observable evidence rather than opinion:
Haystack 1.x. deepset's 2.x release was a near-complete API rewrite, and 3.0 shipped in July 2026. The 1.x line is no longer developed. Starting on it today means adopting a dead API. Check deepset's own docs for the current version.
LangChain 0.x chain patterns. Pre-1.0 LangChain had no stability guarantee. The release policy now states that breaking changes occur only in major versions, and 1.0 is designated LTS. Code written against 0.x LLMChain patterns will need migration. Start on 1.0.
Any repo with pushed_at older than six months. This is a general rule rather than a named product. The table above shows all eight active repos. If a framework you're evaluating doesn't appear there, check its last commit before you depend on it.
A note on category: no-code platforms like Dify are a different decision from code-first frameworks. We don't list them here as "skip" items. They solve a different problem (speed-to-demo vs. long-term maintainability).
How do you choose a RAG framework?
Four orthogonal questions. Answer them in order and the field narrows to one or two options fast.
| Question | If yes, pick... |
|---|---|
| 1. Is your bottleneck parsing (messy PDFs, tables, 20+ formats)? | LlamaIndex or RAGFlow |
| 2. Are you shipping a platform other teams build on, not just an app? | LangChain/LangGraph or Haystack |
| 3. Is your index continuously updated (streaming, not batch)? | LangGraph with a streaming layer, or Pathway alongside |
| 4. Do you need .NET / Java / polyglot support? | Semantic Kernel |
One more criterion nobody prices: exit cost. LangChain's release policy commits to breaking changes only in major versions, with 1.0 as an LTS release active until 2.0 and then at least one year in maintenance. That's a concrete reversibility guarantee. Haystack's 1.x-to-2.x rewrite is the cautionary counterexample. Factor migration cost into the selection, not just feature lists.
How Techsy approaches this
We sell none of these frameworks. Three of the four readable competitor pages in this SERP push a house product mid-recommendation. We don't have one, so the picks above are unconstrained by revenue.
When the Techsy team selects an orchestration layer for client work, we start from the bottleneck question above, prototype the no-framework version first, and add a framework only when the code tells us the complexity is real. Most projects stay on Branch 1 longer than the team expects.
If you want a second opinion on your stack, get a free consultation.
Frequently Asked Questions
What is a RAG framework?
A RAG framework is an orchestration library that handles the plumbing between your documents, your vector store, and your LLM. It manages ingestion, chunking, embedding, retrieval, and generation as a connected pipeline. Without one, you wire those stages together manually using provider SDKs and a vector database client.
Do I need a RAG framework at all?
Not always. If you have a single corpus, one LLM provider, and straightforward Q&A, a provider SDK plus a vector client is enough. You need a framework when you face multi-source ingestion, dozens of document formats, or agentic multi-step retrieval with conditional routing and state.
What is the best RAG framework in 2026?
LangChain 1.0 with LangGraph is the default pick for production apps needing orchestration. LlamaIndex wins for document-heavy ingestion. If your app is a single-corpus Q&A on one provider, skip the framework entirely and use the provider SDK directly.
Is LangChain or LlamaIndex better for RAG?
LangChain is better for orchestration complexity: multi-step routing, agents, human-in-the-loop. LlamaIndex is better for ingestion complexity: 160+ file connectors, stronger PDF and table parsing. If your pain is parsing, pick LlamaIndex. If your pain is routing and state, pick LangChain.
How is a RAG framework different from a vector database?
A vector database stores and retrieves embeddings. A RAG framework orchestrates the full pipeline: loading documents, chunking, embedding, storing, retrieving, reranking, and generating. The framework plugs into the vector database. Pinecone and Qdrant are vector databases. LangChain and LlamaIndex are frameworks that use them.
What is the best open-source RAG framework?
LangChain (MIT), LlamaIndex (MIT), and Haystack (Apache-2.0) are all fully open source. For EU teams needing Apache-2.0 specifically, Haystack is the strongest choice. RAGFlow (Apache-2.0) is the best open-source option if document parsing accuracy is your primary concern.
Which RAG framework handles document-heavy PDFs best?
RAGFlow leads for raw PDF parsing accuracy with its template-based approach to tables, figures, and formulas. LlamaIndex is the stronger all-around choice if you need 160+ format connectors beyond PDFs. Haystack 3.0 handles structured documents well but has fewer out-of-box connectors than LlamaIndex.
How much do RAG frameworks cost?
All eight frameworks in this post are free and open source. Your costs are infrastructure (vector database hosting, typically $0-70/month at small scale) and LLM API calls (the dominant ongoing expense). Managed options like LangSmith, LlamaCloud, and deepset Cloud add subscription costs for observability and hosting.
Does the framework I choose affect my RAG latency?
Minimally. Orchestration overhead is under 4% of a typical end-to-end response. LLM generation accounts for roughly 86%. The July 2026 arXiv scaling study found that retrieval strategy (BM25 vs. dense vs. agentic) matters far more than orchestration plumbing. Spend your optimization budget on retrieval quality (what an MTEB score actually tells you) and generation speed, not framework choice.
Sources
- LangChain release policy (verified 2026-07-31)
- LangGraph 1.0 GA announcement
- LangChain 1.0 GA announcement
- LlamaIndex Workflows 1.0
- Haystack docs
- arXiv 2607.26497, BM25 Wins at Scale (submitted 2026-07-29)
- Octomind, Why we no longer use LangChain
- RAGFlow repo / Dify repo / LlamaIndex repo