LlamaIndex: Introduction

If LangChain starts with chains and agents, LlamaIndex starts with your data. It's the data framework for LLMs — built to ingest, index, and query your documents so a model can answer from them. For RAG, it's the most opinionated and concise option out there: a working pipeline in about five lines.

💡 In one line: LlamaIndex is an open-source data framework that ingests, indexes, and queries your documents so LLMs can answer from them — the RAG-first framework.

What is LlamaIndex?

LlamaIndex is an open-source (MIT) data framework for building LLM applications over your own data. It began as "GPT Index" in late 2022 and became the go-to framework for RAG. Where other frameworks abstract chains and agents, LlamaIndex's primitives are ingestion, indexing, retrieval, and synthesis — the data pipeline.

The Data-First Philosophy

Every LlamaIndex abstraction answers one question: "how do I get the right context to the LLM?" That focus is why its retrieval defaults tend to work well out of the box, and why a RAG pipeline takes noticeably less code here than elsewhere.

The Core Stages

LlamaIndex organises RAG into five stages — which map to the rest of this topic:

  • Loading — pull data in via LlamaHub connectors.
  • Indexing — chunk, embed, and structure it.
  • Storing — persist the index.
  • Querying — retrieve and synthesise an answer.
  • Evaluating — measure quality.

Key Building Blocks

  • Documents & Nodes — a Document is a source; a Node is a chunk (LlamaIndex's core unit).
  • Indexes — VectorStoreIndex, summary, tree, knowledge/property graph.
  • Retrievers — fetch relevant nodes.
  • Query Engines — retrieve + synthesise an answer.
  • Agents & Workflows — tool-using and event-driven orchestration.
  • LlamaHub — 150–200+ data connectors (PDF, Notion, Slack, SQL, S3, Drive).

The Basic Flow

Whiteboard
Whiteboard diagram


Code Example (the Famous Five Lines)


Load → index → query. That brevity is LlamaIndex's signature.

Beyond Basic RAG

LlamaIndex ships advanced retrieval as first-class features: hierarchical indexing, recursive retrieval, sub-question decomposition, hybrid search, reranking, query routing, and knowledge/property graphs. Workflows (event-driven step composition) is the recommended way to build non-trivial apps, and agents are built on top of it.

LlamaIndex vs. LangChain

LlamaIndexLangChain
Starts fromData (ingest → index → query)Chains & agents
Strongest atRAG / retrievalAgent orchestration (LangGraph)
Code for RAGLess, more opinionatedMore, more flexible
Managed layerLlamaCloud / LlamaParseLangSmith

Both are MIT and have converged — LlamaIndex now ships agents; LangChain ships strong retrievers. Many production teams use both: LlamaIndex for the data pipeline, LangGraph for orchestration.

LlamaCloud & LlamaParse

LlamaParse is a hosted parser for messy enterprise documents (complex PDFs, tables, scanned forms) — a genuine differentiator over generic parsers. LlamaCloud adds managed parsing, indexing, and retrieval (free tier + credit-based paid plans).

Trade-offs

  • Abstractions can be opaque when debugging.
  • The agent/orchestration story is younger than LangGraph's.
  • TypeScript isn't at feature parity with Python.
  • Overkill for a single source and one retriever — it earns its weight with many sources and complex retrieval.

A Note on Currency

As of mid-2026, LlamaIndex is on the 0.14.x line, Workflows is the recommended orchestration path (Query Pipelines are deprecated), and the company has pushed into agentic document processing (LlamaParse/LlamaCloud). Check docs.llamaindex.ai for current APIs.

Summary

  • LlamaIndex is the data-first, RAG-first framework — ingest, index, query.
  • Its stages: Load → Index → Store → Query → Evaluate.
  • Core blocks: Documents/Nodes, indexes, retrievers, query engines, agents/workflows, and LlamaHub.
  • It's more concise for RAG; LangGraph is stronger for agent orchestration — many teams use both.
  • LlamaParse/LlamaCloud handle messy enterprise documents as a managed layer.Â