# run-llama/llama_index architecture

> Architecture diagram of the GitHub repository run-llama/llama_index, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/run-llama/llama_index
- Repository: https://github.com/run-llama/llama_index

## Overview

LlamaIndex OSS is a Python framework for grounding LLM applications in user data, with retrieval-augmented querying and agent orchestration as central capabilities. Its documented workflow is to connect and ingest data, structure it into indices or graphs, retrieve relevant context, and produce an answer; agents and chat engines provide higher-level application patterns. The query-engine, ingestion, storage, and tool edges are supported by sampled source; broader capability links reflect README descriptions and directory paths, not inspected implementations.

Main entry points: [`llama-index-core/llama_index/core/query_engine`](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/query_engine) (Query Engines), [`llama-index-core/llama_index/core/ingestion/pipeline.py`](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/ingestion/pipeline.py) (Ingestion Pipeline), [`llama-index-core/llama_index/core/indices`](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/indices) (Indices and Graphs), [`llama-index-core/llama_index/core/query_engine/citation_query_engine.py`](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/query_engine/citation_query_engine.py) (Citation Query)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Data Ingestion"]
  node_ingest_pipeline["Ingestion Pipeline<br/>[pipeline.py]"]
  node_parsers["Document Parsers"]
  node_extractors["Metadata Extractors"]
end

subgraph group_structure["Data Structures"]
  node_documents["Documents and Nodes<br/>[schema.py]"]
  node_indices["Indices and Graphs"]
  node_embeddings["Embeddings"]
end

subgraph group_query["Query and Retrieval"]
  node_retrievers["Retrievers<br/>[base_retriever.py]"]
  node_postprocessors["Node Postprocessors"]
  node_query_engine["Query Engines"]
  node_citation_engine["Citation Query"]
  node_synthesizers["Response Synthesis"]
end

subgraph group_apps["Agents and Apps"]
  node_tools["Query Engine Tools<br/>[query_engine.py]"]
  node_agents["Agent Workflows"]
  node_chat["Chat Engines"]
  node_evaluation["Evaluation"]
end

subgraph group_foundation["Core Services"]
  node_storage["Storage Context<br/>[storage_context.py]"]
  node_stores[("Document and Vector Stores")]
  node_callbacks["Callbacks and Instrumentation"]
end

node_developer(("Application Developer"))
node_sources(("Data Sources"))
node_llm(("LLM Providers"))
node_integrations(("Integrations"))

node_developer -->|"configures ingestion"| node_ingest_pipeline
node_sources -->|"provides data"| node_ingest_pipeline
node_ingest_pipeline -->|"transforms documents"| node_parsers
node_ingest_pipeline -->|"applies metadata"| node_extractors
node_ingest_pipeline -->|"produces nodes"| node_documents
node_documents -->|"structures data"| node_indices
node_indices -->|"uses embeddings"| node_embeddings
node_indices -->|"uses storage"| node_storage
node_storage -->|"persists data"| node_stores
node_query_engine -->|"retrieves context"| node_retrievers
node_query_engine -->|"processes nodes"| node_postprocessors
node_query_engine -->|"synthesizes response"| node_synthesizers
node_citation_engine -->|"retrieves nodes"| node_retrievers
node_citation_engine -->|"processes nodes"| node_postprocessors
node_citation_engine -->|"synthesizes answer"| node_synthesizers
node_tools -->|"runs query"| node_query_engine
node_agents -->|"dispatches tools"| node_tools
node_chat -->|"answers with context"| node_query_engine
node_query_engine -.->|"generates response"| node_llm
node_evaluation -->|"evaluates outputs"| node_query_engine
node_query_engine -->|"emits events"| node_callbacks
node_developer -.->|"selects plugins"| node_integrations
node_integrations -.->|"extends framework"| node_indices

click node_ingest_pipeline "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/ingestion/pipeline.py"
click node_parsers "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/node_parser"
click node_extractors "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/extractors"
click node_documents "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/schema.py"
click node_indices "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/indices"
click node_embeddings "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/embeddings"
click node_storage "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/storage/storage_context.py"
click node_stores "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/storage"
click node_retrievers "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/base/base_retriever.py"
click node_postprocessors "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/postprocessor"
click node_query_engine "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/query_engine"
click node_citation_engine "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/query_engine/citation_query_engine.py"
click node_synthesizers "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/response_synthesizers"
click node_tools "https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/tools/query_engine.py"
click node_agents "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/agent/workflow"
click node_chat "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/chat_engine"
click node_evaluation "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/evaluation"
click node_callbacks "https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/callbacks"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ingest_pipeline,node_parsers,node_extractors toneBlue
class node_documents,node_indices,node_embeddings toneAmber
class node_retrievers,node_postprocessors,node_query_engine,node_citation_engine,node_synthesizers toneMint
class node_tools,node_agents,node_chat,node_evaluation toneRose
class node_storage,node_stores,node_callbacks,node_developer,node_sources,node_llm,node_integrations toneIndigo
```

## Components

### Data Ingestion

- [Ingestion Pipeline](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/ingestion/pipeline.py): `llama-index-core/llama_index/core/ingestion/pipeline.py`
- [Document Parsers](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/node_parser): `llama-index-core/llama_index/core/node_parser`
- [Metadata Extractors](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/extractors): `llama-index-core/llama_index/core/extractors`

### Data Structures

- [Documents and Nodes](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/schema.py): `llama-index-core/llama_index/core/schema.py`
- [Indices and Graphs](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/indices): `llama-index-core/llama_index/core/indices`
- [Embeddings](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/embeddings): `llama-index-core/llama_index/core/embeddings`

### Query and Retrieval

- [Retrievers](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/base/base_retriever.py): `llama-index-core/llama_index/core/base/base_retriever.py`
- [Node Postprocessors](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/postprocessor): `llama-index-core/llama_index/core/postprocessor`
- [Query Engines](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/query_engine): `llama-index-core/llama_index/core/query_engine`
- [Citation Query](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/query_engine/citation_query_engine.py): `llama-index-core/llama_index/core/query_engine/citation_query_engine.py`
- [Response Synthesis](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/response_synthesizers): `llama-index-core/llama_index/core/response_synthesizers`

### Agents and Apps

- [Query Engine Tools](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/tools/query_engine.py): `llama-index-core/llama_index/core/tools/query_engine.py`
- [Agent Workflows](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/agent/workflow): `llama-index-core/llama_index/core/agent/workflow`
- [Chat Engines](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/chat_engine): `llama-index-core/llama_index/core/chat_engine`
- [Evaluation](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/evaluation): `llama-index-core/llama_index/core/evaluation`

### Core Services

- [Storage Context](https://github.com/run-llama/llama_index/blob/main/llama-index-core/llama_index/core/storage/storage_context.py): `llama-index-core/llama_index/core/storage/storage_context.py`
- [Document and Vector Stores](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/storage): `llama-index-core/llama_index/core/storage`
- [Callbacks and Instrumentation](https://github.com/run-llama/llama_index/tree/main/llama-index-core/llama_index/core/callbacks): `llama-index-core/llama_index/core/callbacks`

### Other components

- **Application Developer**
- **Data Sources**
- **LLM Providers**
- **Integrations**

## Connections

- Application Developer → Ingestion Pipeline: configures ingestion
- Data Sources → Ingestion Pipeline: provides data
- Ingestion Pipeline → Document Parsers: transforms documents
- Ingestion Pipeline → Metadata Extractors: applies metadata
- Ingestion Pipeline → Documents and Nodes: produces nodes
- Documents and Nodes → Indices and Graphs: structures data
- Indices and Graphs → Embeddings: uses embeddings
- Indices and Graphs → Storage Context: uses storage
- Storage Context → Document and Vector Stores: persists data
- Query Engines → Retrievers: retrieves context
- Query Engines → Node Postprocessors: processes nodes
- Query Engines → Response Synthesis: synthesizes response
- Citation Query → Retrievers: retrieves nodes
- Citation Query → Node Postprocessors: processes nodes
- Citation Query → Response Synthesis: synthesizes answer
- Query Engine Tools → Query Engines: runs query
- Agent Workflows → Query Engine Tools: dispatches tools
- Chat Engines → Query Engines: answers with context
- Query Engines → LLM Providers: generates response
- Evaluation → Query Engines: evaluates outputs
- Query Engines → Callbacks and Instrumentation: emits events
- Application Developer → Integrations: selects plugins
- Integrations → Indices and Graphs: extends framework
