Open SourcePythonTypeScript

LlamaIndex

by LlamaIndex Inc.Updated Jun 15, 2025

Document-centric agent framework built from industry-leading RAG foundations. LlamaIndex focuses on structured data ingestion, indexing, and agentic document workflows. Its agent abstraction combines reasoning with data retrieval, making it the go-to framework for knowledge-intensive applications that need to reason over private data.

Architecture Overview

LlamaIndex provides a layered architecture: data connectors ingest documents from various sources, indexes organize them for efficient retrieval (vector, keyword, knowledge graph), and query engines expose them to agents. The AgentRunner manages the agent loop, maintaining a TaskState and StepHistory. Agents use a ReAct-style loop with tool abstractions that wrap query engines, APIs, and other data sources. The Workflows API adds event-driven orchestration for complex pipelines.

When to Use LlamaIndex

  • Knowledge management and document Q&A systems
  • Agentic RAG with multi-step retrieval
  • Data-driven agents over private enterprise data
  • Multi-document analysis and comparison
  • Structured data extraction from unstructured sources

Strengths & Weaknesses

Strengths

  • Best-in-class RAG capabilities with multiple index types
  • Rich data connectors (LlamaHub) for 100+ data sources
  • Hybrid search combining vector, keyword, and knowledge graph
  • TypeScript support via LlamaIndex.TS
  • Production-ready with LlamaCloud managed service

Weaknesses

  • Document-focused design can feel heavy for non-RAG agents
  • Can be complex for simple agent use cases
  • Large dependency footprint for full feature set

Quick Start

python
from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI
from llama_index.core.tools import FunctionTool

def multiply(a: float, b: float) -> float:
    """Multiply two numbers and return the result."""
    return a * b

def add(a: float, b: float) -> float:
    """Add two numbers and return the result."""
    return a + b

# Wrap functions as tools
multiply_tool = FunctionTool.from_defaults(fn=multiply)
add_tool = FunctionTool.from_defaults(fn=add)

# Create a ReAct agent
llm = OpenAI(model="gpt-4o")
agent = ReActAgent.from_tools(
    [multiply_tool, add_tool],
    llm=llm,
    verbose=True,
)

response = agent.chat("What is (3 + 5) * 2?")
print(response)

Features at a Glance

DeveloperLlamaIndex Inc.
LanguagePython, TypeScript
LicenseMIT
GitHub Stars38k+
MCP SupportYes
Multi-AgentYes

Notable Users

UberDropboxNotionDatabricks

Resources

Explore Related Content