How does LlamaIndex Document to Node to Index pipeline differ from LangChain Runnable model?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
LlamaIndex is a data-shaped LLM framework whose primitives line up on an ingestion to query path: Document → Node → Index → QueryEngine.
Picture a research librarian's workflow. A messy stack of papers arrives. That is a Document. The librarian cuts each paper into labelled note cards. Those are Nodes. The cards go into a filing cabinet with a clever lookup system. That is the Index. When a reader asks a question, the librarian's lookup and summarise routine pulls the right cards, trims them, and reads back an answer. That is the QueryEngine. LlamaIndex builds this whole library for you. LangChain, by contrast, gives you a kit of generic pipes for connecting any step to any other step, and you decide how to play librarian yourself.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
8 min: the four data-shaped primitives, the ingestion to query path, contrasts with LangChain's composition model, when to pair LlamaIndex retrieval with LangGraph control.
from llama_index.core import (
SimpleDirectoryReader,
VectorStoreIndex,
Settings,
)
from llama_index.core.node_parser import SentenceSplitter
Settings.node_parser = SentenceSplitter(chunk_size=512, chunk_overlap=64)
docs = SimpleDirectoryReader("./papers").load_data() # Documents
index = VectorStoreIndex.from_documents(docs) # Documents -> Nodes -> Index
query_engine = index.as_query_engine(similarity_top_k=5)
response = query_engine.query("Summarise the methodology section.")
print(response)
| Aspect | LlamaIndex (data-shaped) | LangChain (composition-shaped) |
|---|---|---|
| Core unit | Document → Node → Index → QueryEngine | Runnable composed via LCEL |
| RAG ergonomics | First-class. The framework IS a RAG pipeline | Assembled from generic Runnable pieces |
| Agent surface | AgentRunner / AgentWorker split | AgentExecutor (deprecated path) → LangGraph |
| Best fit workload | Retrieval-heavy, data-centric apps | Mixed composition, multi-step orchestration |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Calling LlamaIndex 'a RAG library' and stopping there. The same primitives also power agent and workflow surfaces, and the data-shaped framing is the durable insight.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.