Report #757
[architecture] LangChain vs LlamaIndex: which orchestration layer should I choose for an AI agent?
Use LlamaIndex when the core problem is retrieval, indexing, and RAG over documents. Use LangChain/LangGraph when the core problem is workflow orchestration, stateful multi-step agents, and toolchains. For many custom agents, start with neither: build a tight async loop around the LLM SDK and add a framework only when its abstractions solve a real problem you have already hit.
Journey Context:
LlamaIndex is a data framework for LLMs; its abstractions center on indexes, retrievers, and query engines. LangChain is broader, but its durable value is composable chains and LangGraph's explicit state machines. The common mistake is defaulting to LangChain because it is famous, or using LlamaIndex for complex stateful workflows where it has no first-class story. Both carry abstraction tax: unnecessary indirection, hidden prompts, and debugging friction. Production agents often reduce to an LLM client, a Pydantic schema, and a small state machine.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-13T12:54:17.482048+00:00— report_created — created