# LlamaIndex: features, protocols, quickstart

## TL;DR

LlamaIndex is an open-source Python framework from the company LlamaIndex for building RAG and agent applications over your own data. Its AgentWorkflow lets agents hand off to each other on top of event-driven Workflows with serializable state. The company now focuses on its paid LlamaParse platform. It suits document-heavy agent projects in Python.

## Key facts

| Field | Value |
| --- | --- |
| Type | Framework |
| Languages / SDKs | Python |
| License | MIT |
| Pricing model | [Open core](https://www.llamaindex.ai/pricing) |
| Orchestration pattern | Handoff |
| GitHub stars | 52,368 (as of 2026-09-30) |
| GitHub forks | 8,253 |
| Last push | 2026-09-29 |
| Latest release | v0.14.25 |
| Repository | [run-llama/llama_index](https://github.com/run-llama/llama_index) |
| Website | [developers.llamaindex.ai](https://developers.llamaindex.ai) |
| Documentation | [developers.llamaindex.ai](https://developers.llamaindex.ai/python/framework/) |
| Last verified | 2026-09-30 |

## Key features

- AgentWorkflow runs a set of FunctionAgent or ReActAgent instances, starting at a root agent and letting agents hand off via can_handoff_to. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/multi_agent/))
- Orchestrator pattern: a top-level agent calls sub-agents exposed to it as tools; a custom-planner pattern is also documented. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/multi_agent/))
- Workflows: event-driven steps that emit and receive events, the layer AgentWorkflow is built on. ([source](https://developers.llamaindex.ai/python/llamaagents/workflows/))
- Workflow Context holds state within and between runs and serializes with to_dict / from_dict. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/state/))
- Memory class combining a token-limited short-term queue with optional long-term memory blocks. ([source](https://developers.llamaindex.ai/python/framework/module_guides/deploying/agents/memory/))
- Human input through InputRequiredEvent and HumanResponseEvent with ctx.wait_for_event inside tools. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/human_in_the_loop/))
- Use tools from existing MCP servers (llama-index-tools-mcp) and serve LlamaIndex workflows as MCP servers. ([source](https://developers.llamaindex.ai/python/framework/module_guides/mcp/))
- llama-index-protocols-ag-ui package creates a FastAPI router that speaks the AG-UI protocol to frontends such as CopilotKit. ([source](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/protocols/llama-index-protocols-ag-ui/README.md))

## Architecture and orchestration pattern

Pattern: Handoff.

The base layer is Workflows: steps are async functions that receive and emit typed events, and a run is the event flow between them. Agents (`FunctionAgent`, `ReActAgent`) and `AgentWorkflow` are pre-built workflows that handle tool calling and streaming.

For multiple agents, `AgentWorkflow` takes a list of agents and a root agent. The active agent calls tools and may hand control to another agent listed in its `can_handoff_to`, until one returns a final answer or hands back to the user. The docs also describe an orchestrator agent that calls sub-agents as tools, and a custom planner written by hand.

Run state lives in a `Context` object that can carry values between runs and be serialized to JSON or pickle for later resumption. Conversation memory is a `Memory` object: recent messages up to a token limit, with older messages flushed into optional long-term memory blocks. Retrieval over documents (indexes, retrievers, query engines) is the framework's original core and can be exposed to agents as tools.

### Human in the loop

A tool can pause for a person by calling `ctx.wait_for_event(HumanResponseEvent, waiter_event=InputRequiredEvent(...))`. The caller sees the `InputRequiredEvent` in the event stream, collects input (the docs use keyboard input), and sends a `HumanResponseEvent` back with `handler.ctx.send_event`; the tool then continues or aborts based on the reply. In `AgentWorkflow` the active agent can also return control to the user. Because `Context` serializes, a paused run's state can be saved and restored.

## Protocols

| Protocol | Support | Evidence | Note |
| --- | --- | --- | --- |
| MCP | Yes (checked 2026-09-30) | [link](https://developers.llamaindex.ai/python/framework/module_guides/mcp/llamaindex_mcp/) | Client: BasicMCPClient and McpToolSpec (llama-index-tools-mcp) turn MCP server tools into LlamaIndex tools over SSE, Streamable HTTP or stdio; the MCP module guide also covers serving workflows as MCP servers. |
| A2A | Unknown (checked 2026-09-30) | — | Searched README, developers.llamaindex.ai llms.txt and docs grep API, GitHub code search in run-llama/llama_index (hits were unrelated strings) and issues for a2a / agent2agent; nothing official found. |
| AG-UI | Yes (checked 2026-09-30) | [link](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/protocols/llama-index-protocols-ag-ui/README.md) | Server adapter: the first-party llama-index-protocols-ag-ui package exposes a workflow agent through an AG-UI FastAPI router; the AG-UI README also lists LlamaIndex as 1st-party. |

## Best for

- Agents that answer from large document collections using LlamaIndex retrieval and indexing.
- Multi-agent flows where specialists hand work to each other in a defined order.
- Backends for chat UIs that speak AG-UI, such as CopilotKit frontends.
- Local setups with Ollama models and Hugging Face embeddings.

## Not for

- TypeScript projects: LlamaIndex.TS is deprecated and archived.
- Teams that want a framework whose vendor's primary focus is the open-source agent toolkit.
- Supervisor-style orchestration with built-in approval gates on every tool call.

## Quickstart

```sh
pip install llama-index
```

Install not yet verified by this site.

```python
import asyncio
from llama_index.core.agent.workflow import AgentWorkflow, FunctionAgent
from llama_index.llms.openai import OpenAI

llm = OpenAI(model="gpt-4o-mini")
def word_count(text: str) -> int:
    """Count the words in a piece of text."""
    return len(text.split())

drafter = FunctionAgent(name="Drafter", description="Writes a first draft.", llm=llm, tools=[],
                        system_prompt="Write a two-sentence draft, then hand off to Editor.", can_handoff_to=["Editor"])
editor = FunctionAgent(name="Editor", description="Tightens drafts.", llm=llm, tools=[word_count],
                       system_prompt="Shorten the draft and report its word count.")

workflow = AgentWorkflow(agents=[drafter, editor], root_agent="Drafter")

async def main():
    print(await workflow.run(user_msg="Announce our new office hours: Mondays 9-11."))

asyncio.run(main())
```

### Common pitfalls

- `pip install llama-index` is a starter bundle (core, OpenAI LLM and embeddings, file readers); other providers need separate integration packages such as `llama-index-llms-ollama`.
- The OpenAI defaults need `OPENAI_API_KEY`; the installation page says the default models are `gpt-3.5-turbo` and `text-embedding-ada-002` unless you pass a model explicitly.
- Imports containing `core` come from `llama-index-core`; imports without it come from integration packages that must be installed separately.
- MCP tools need `pip install llama-index-tools-mcp`; AG-UI needs `llama-index-protocols-ag-ui`.

Official quickstart: https://developers.llamaindex.ai/python/framework/getting_started/installation/

## Pros

- Large integration catalog (the README counts over 300 packages) installed piecemeal on top of llama-index-core. ([source](https://github.com/run-llama/llama_index))
- Three multi-agent patterns are documented with trade-offs: handoff workflow, orchestrator with agents as tools, and custom planner. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/multi_agent/))
- Serializable Context lets a run's state be stored and restored later. ([source](https://developers.llamaindex.ai/python/framework/understanding/agent/state/))
- MCP in both directions: consume MCP servers as tools and publish workflows as MCP servers. ([source](https://developers.llamaindex.ai/python/framework/module_guides/mcp/))
- First-party AG-UI adapter for connecting agents to AG-UI frontends. ([source](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/protocols/llama-index-protocols-ag-ui/README.md))

## Cons

- The README says the company's primary focus has shifted to LlamaParse; the framework remains available as an open toolkit. ([source](https://github.com/run-llama/llama_index))
- The TypeScript port, LlamaIndex.TS, is deprecated, no longer maintained and archived. ([source](https://github.com/run-llama/LlamaIndexTS))
- An open bug reports ReActAgent handoffs leaving stale reasoning in ctx.store that leaks into the next turn. ([source](https://github.com/run-llama/llama_index/issues/23243))
- An open bug reports the agent's state prompt going stale after tools update workflow state. ([source](https://github.com/run-llama/llama_index/issues/22248))
- The installation docs list gpt-3.5-turbo and text-embedding-ada-002 as default models, so models should be set explicitly. ([source](https://developers.llamaindex.ai/python/framework/getting_started/installation/))

## Alternatives

- [Haystack](https://multiagentguide.top/tools/haystack.md)
- [LangGraph](https://multiagentguide.top/tools/langgraph.md)
- [LangChain](https://multiagentguide.top/tools/langchain.md)
- [OpenAI Agents SDK (Python)](https://multiagentguide.top/tools/openai-agents-sdk.md)
- [Pydantic AI](https://multiagentguide.top/tools/pydantic-ai.md)

## FAQ

### Does LlamaIndex support MCP?

Yes. The llama-index-tools-mcp package loads tools from MCP servers (SSE, Streamable HTTP or stdio), and the docs show converting LlamaIndex workflows into MCP servers.

### Does LlamaIndex support AG-UI?

Yes. The first-party llama-index-protocols-ag-ui package creates a FastAPI router that speaks AG-UI, and the AG-UI project lists LlamaIndex as a 1st-party integration. A2A support was not found.

### Is LlamaIndex free?

The framework is MIT-licensed. The company's paid product is LlamaParse (document parsing, extraction and indexing), priced separately on its pricing page.

### How do LlamaIndex agents hand off work?

In AgentWorkflow, each FunctionAgent lists the agents it may hand off to in can_handoff_to; the workflow starts at the root agent and switches when an agent hands off.

### Is there a TypeScript version?

LlamaIndex.TS existed, but its repository now carries a deprecation notice and is archived, so this record lists Python only.

## Sources

- [run-llama/llama_index repository (README)](https://github.com/run-llama/llama_index)
- [LlamaIndex framework documentation](https://developers.llamaindex.ai/python/framework/)
- [Multi-agent patterns](https://developers.llamaindex.ai/python/framework/understanding/agent/multi_agent/)
- [Human in the loop](https://developers.llamaindex.ai/python/framework/understanding/agent/human_in_the_loop/)
- [Maintaining state](https://developers.llamaindex.ai/python/framework/understanding/agent/state/)
- [Memory](https://developers.llamaindex.ai/python/framework/module_guides/deploying/agents/memory/)
- [Model Context Protocol (MCP)](https://developers.llamaindex.ai/python/framework/module_guides/mcp/)
- [Using MCP tools with LlamaIndex](https://developers.llamaindex.ai/python/framework/module_guides/mcp/llamaindex_mcp/)
- [Installation and setup](https://developers.llamaindex.ai/python/framework/getting_started/installation/)
- [Starter example](https://developers.llamaindex.ai/python/framework/getting_started/starter_example/)
- [Workflows](https://developers.llamaindex.ai/python/llamaagents/workflows/)
- [llama-index-protocols-ag-ui README](https://github.com/run-llama/llama_index/blob/main/llama-index-integrations/protocols/llama-index-protocols-ag-ui/README.md)
- [LlamaIndex.TS repository (deprecated)](https://github.com/run-llama/LlamaIndexTS)
- [Issue #23243: stale reasoning after ReActAgent handoff](https://github.com/run-llama/llama_index/issues/23243)
- [Issue #22248: stale agent state prompt](https://github.com/run-llama/llama_index/issues/22248)
- [LlamaParse pricing](https://www.llamaindex.ai/pricing)

## Unknown fields

protocols.a2a is unknown: README, developers.llamaindex.ai llms.txt and its grep API, GitHub code search in run-llama/llama_index (matches were unrelated strings) and issue search found no official A2A support.

---

Data as of 2026-09-30. Not affiliated with listed projects. HTML version: https://multiagentguide.top/tools/llamaindex
