LlamaIndex

Build RAG-first ReAct agents with LlamaIndex for data-heavy applications.

Language:PythonProviders:OpenAI, Anthropic, Google

Quick start

1

Create the project

npx agentvoy create my-project --framework llamaindex --provider openai --model gpt-4o --yes
2

Install and run

cd my-project-agent
pip install -r requirements.txt
cp .env.example .env
# Add your API key
python run.py

What gets generated

from llama_index.core.agent import ReActAgent
from llama_index.llms.openai import OpenAI

llm = OpenAI(model=os.environ.get("DEFAULT_MODEL", "gpt-4o"))

def create_agent():
    tools = get_tools()
    agent = ReActAgent.from_tools(
        tools, llm=llm, verbose=True,
        system_prompt="You are a helpful AI assistant...",
    )
    return agent

Provider support

ProviderLlamaIndex classGuide
OpenAIllama_index.llms.openai.OpenAIGet key
Anthropicllama_index.llms.anthropic.AnthropicGet key
Googlellama_index.llms.gemini.GeminiGet key

When to use LlamaIndex

  • You're building RAG (Retrieval-Augmented Generation) applications
  • Your agent needs to search and reason over large document collections
  • You want built-in indexing and retrieval tools