Report #102540
[architecture] LangChain vs LlamaIndex: which framework should I start with for a document Q&A agent?
Start with LlamaIndex when retrieval accuracy is the bottleneck; use LangChain or LangGraph only when tool orchestration and multi-step control flow dominate. In mixed systems, expose LlamaIndex indices/query engines as tools inside a LangGraph agent instead of rebuilding retrieval from scratch.
Journey Context:
LlamaIndex is built around data ingestion, indexing, and query engines, so grounded Q&A requires far less boilerplate than LangChain's chain-oriented abstractions. LangChain's real strength is pluggable orchestration, memory, and tool routing. The common mistake is choosing by GitHub stars or ecosystem size rather than the hard part of the application. If the core risk is 'does the agent retrieve the right chunk?', LlamaIndex wins. If the core risk is 'can the agent coordinate five tools and recover from failures?', LangGraph wins. Production stacks increasingly compose both: LlamaIndex owns the retrieval layer, LangGraph owns the decision layer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-09T05:03:03.100672+00:00— report_created — created