LlamaIndex
Type: full-code · Vendor: LlamaIndex Inc. · Language: Python, TypeScript · License: MIT · Status: active · Status in practice: mature · First released: 2022-11-02
Provide an open-source Python/TypeScript framework for context-augmented LLM and agent applications combining RAG primitives (data connectors, indexes, query engines, retrievers, rerankers) with an event-driven Workflow runtime and a multi-agent AgentWorkflow orchestrator over FunctionAgent / ReActAgent / CodeActAgent prebuilts.
Description. LlamaIndex began as the leading data framework for retrieval-augmented LLM applications and has, since 2024, grown an explicit agent layer on top of that retrieval substrate. Today LlamaIndex Inc. ships LlamaIndex OSS (MIT, Python and TypeScript) as 'an open-source framework to build agentic applications' with Workflows as the underlying event-driven runtime and AgentWorkflow as a multi-agent orchestrator. The framework positions RAG as one tool an agent can call rather than the whole application: 'LlamaIndex provides a framework for building agents including the ability to use RAG pipelines as one of many tools to complete a task'.
Agent loop shape. Event-driven Workflow: steps decorated with @step are triggered by typed Events and emit further Events. On top, prebuilt agents FunctionAgent (native tool calling) and ReActAgent (prompted ReAct) plus the multi-agent AgentWorkflow orchestrator routing via can_handoff_to and a root_agent.
Primary use cases
- agentic RAG with multiple retrievers and rerankers
- event-driven Workflow orchestration
- multi-agent topologies via AgentWorkflow with handoff
- graph-RAG via PropertyGraphIndex
Key concepts
- Workflow → event-driven-agent (docs) — Event-driven, step-based execution runtime.
- @step + Event (docs) — Pydantic events trigger @step-decorated methods; events flow between steps to drive control.
- FunctionAgent → tool-use (docs) — Native function-calling agent that uses provider tool/function APIs.
- ReActAgent → react (docs) — Reason+Act prompted agent for models without native tool calling.
- AgentWorkflow → orchestrator-workers (docs) — Orchestrator for one or more agents with can_handoff_to routing and a designated root_agent.
- Index / QueryEngine → agentic-rag (docs) — RAG building blocks; VectorStoreIndex, PropertyGraphIndex, etc.
Patterns this full-code implements —
- ★★Agentic RAG
RAG pipelines are exposed as tools the agent decides to call.
- ★★Cross-Encoder Reranking
SentenceTransformerRerank + CohereRerank as node post-processors.
- ★★Event-Driven Agent
Workflow IS the event-driven runtime; @step methods are triggered by Events and emit further Events.
- ★GraphRAG
PropertyGraphIndex with built-in graph retrievers (TextToCypher, CypherTemplate, LLMSynonym, VectorContext).
- ★★Hybrid Search
QueryFusionRetriever combines vector retrieval with BM25; Relative Score Fusion applies a MinMax scaler per result set and produces a weighted sum.
- ★★Model Context Protocol
get_tools_from_mcp_url returns FunctionTools from an MCP server; BasicMCPClient supports HTTP/SSE/stdio; workflow_as_mcp exposes Workflows as MCP servers.
- ★★Naive RAG
Canonical 5-line example: SimpleDirectoryReader + VectorStoreIndex.from_documents + as_query_engine.
- ★★Orchestrator-Workers
Orchestrator pattern: expose each agent's run as a tool and give those tools to a new top-level FunctionAgent.
- ★★ReAct
ReActAgent works with any LLM regardless of whether it supports function calling; reasoning is step-by-step over tools.
- ★★Step Budget
BaseWorkflowAgent sets DEFAULT_MAX_ITERATIONS = 20; agent run accepts max_iterations and triggers an early-stopping branch once num_iterations >= max_iterations.
- ★★Structured Output
Pydantic models drive both JSON-schema generation and coercion of LLM output.
- ★★Supervisor
The Orchestrator pattern + root_agent designation is the supervisor shape.
- ★★Tool Use
Tool has __call + metadata; FunctionTool wraps any callable; QueryEngineTool wraps a query engine.
- ★Contextual Retrieval
Cookbook recipe composing Claude + chunk enrichment with LlamaIndex primitives; not a core API.
- ★★Session Isolation
Context is per-run and serializable across sessions; AgentWorkflow is stateless between runs by default. Downgraded from first-class — closer to per-run isolation than thread-scoped session memory.
- ★★Agent Resumption
WorkflowCheckpointer.run() wraps Workflow.run() and injects checkpoint callbacks; resume via run_from(). No automatic per-step checkpointing.
- ★CRAG
CRAG ships as a workflow example/pack, not a top-level API; the pack uses an LLM to grade retrieved-node relevance before generation.
- ★Self-RAG
Self-RAG is shipped as a LlamaPack — SelfRAGQueryEngine is the official module name. Not a core framework primitive.
Neighbourhood
Click any neighbour to follow the lineage. Scroll to zoom, drag to pan.