> ## 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] [Get your Ceramic API key](https://platform.ceramic.ai/keys)
>
> Create a free account to get started.

## 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
```

> [card] [GitHub](https://github.com/CeramicTeam/ceramic-llama-index-tools)
>
> View source code

> [card] [PyPI](https://pypi.org/project/llama-index-tools-ceramic/)
>
> View package


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.