> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-service-account.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# LlamaIndex Vector Database

> Search an existing LlamaIndex index from your Knowledge Base through a retriever.

## Setup

```shell theme={null}
uv pip install -U agno llama-index-core llama-index-readers-file llama-index-embeddings-openai openai
```

## Example

```python agent_with_knowledge.py theme={null}
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.llamaindex import LlamaIndexVectorDb
from llama_index.core import SimpleDirectoryReader, StorageContext, VectorStoreIndex
from llama_index.core.node_parser import SentenceSplitter
from llama_index.core.retrievers import VectorIndexRetriever

# Build a LlamaIndex index over your documents
documents = SimpleDirectoryReader("data/paul_graham").load_data()
splitter = SentenceSplitter(chunk_size=1024)
nodes = splitter.get_nodes_from_documents(documents)
storage_context = StorageContext.from_defaults()
index = VectorStoreIndex(nodes=nodes, storage_context=storage_context)

# Point Agno at the index through a retriever
knowledge = Knowledge(
    vector_db=LlamaIndexVectorDb(knowledge_retriever=VectorIndexRetriever(index))
)

agent = Agent(
    knowledge=knowledge,
    search_knowledge=True,
)
agent.print_response(
    "Explain what this text means: low end eats the high end", markdown=True
)
```

`LlamaIndexVectorDb` wraps a LlamaIndex retriever. Searches call `knowledge_retriever.retrieve()` and convert the returned nodes to Agno documents.

<Note>
  `LlamaIndexVectorDb` is search-only. `insert()` and `upsert()` raise `NotImplementedError`. Load and index documents through LlamaIndex, then wire the retriever to Agno. Search filters are not supported.
</Note>

## LlamaIndexVectorDb Params

<Snippet file="vectordb_llamaindexdb_params.mdx" />
