> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ceramic.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LlamaIndex

> Use Ceramic Search as a tool in LlamaIndex agents

LlamaIndex is a framework for building LLM-powered applications. This guide shows how to use the `llama-index-tools-ceramic` package to give a LlamaIndex agent access to Ceramic Search.

<Card title="Get your Ceramic API key" icon="key" href="https://platform.ceramic.ai/keys" arrow="true">
  Create a free account to get started.
</Card>

## Building agents

The `CeramicToolSpec` wraps Ceramic Search as a LlamaIndex tool. Pass it to any LlamaIndex agent and the agent will call it automatically when it needs to retrieve information.

### Set environment variables

```bash theme={null}
export CERAMIC_API_KEY=your_ceramic_api_key
export OPENAI_API_KEY=your_openai_api_key
```

### Install dependencies

```bash python theme={null}
pip install llama-index-tools-ceramic llama-index-llms-openai
```

### Full example

```python python theme={null}
import asyncio
import os
from llama_index.core.agent.workflow import FunctionAgent
from llama_index.llms.openai import OpenAI
from llama_index.tools.ceramic import CeramicToolSpec

ceramic_tool = CeramicToolSpec(api_key=os.environ["CERAMIC_API_KEY"])

agent = FunctionAgent(
    tools=ceramic_tool.to_tool_list(),
    llm=OpenAI(model="gpt-5.4"),
)

async def main():
    response = await agent.run("What are the latest California tenant protection laws?")
    print(response)

asyncio.run(main())
```

### Run the example

```bash python theme={null}
python llamaindex_agent.py
```

<Columns cols={2}>
  <Card title="GitHub" icon="github" href="https://github.com/CeramicTeam/ceramic-llama-index-tools" arrow="true">
    View source code
  </Card>

  <Card title="PyPI" icon="python" href="https://pypi.org/project/llama-index-tools-ceramic/" arrow="true">
    View package
  </Card>
</Columns>
