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

# LanceDB

> Store and search Knowledge embeddings in a local or remote LanceDB table.

`LanceDb` supports vector, full-text, and hybrid search. A filesystem path creates a local database. A `db://` URI connects to LanceDB Cloud and requires `api_key=` or `LANCEDB_API_KEY`.

> [!WARNING]
>
> In Agno v2.7.2, dictionary filters are applied after LanceDB returns the limited candidates, and filter-expression lists are ignored. Filtered searches can return fewer documents than requested. Search results also omit the stored LanceDB row ID.

```python agent_with_knowledge.py theme={null}
from agno.agent import Agent
from agno.knowledge.knowledge import Knowledge
from agno.vectordb.lancedb import LanceDb

knowledge = Knowledge(
    vector_db=LanceDb(
        table_name="recipes",
        uri="tmp/lancedb",
    )
)
agent = Agent(knowledge=knowledge, search_knowledge=True)

if __name__ == "__main__":
    knowledge.insert(
        url="https://agno-public.s3.amazonaws.com/recipes/ThaiRecipes.pdf"
    )
    agent.print_response("How do I make pad thai?", markdown=True)
```

## Run the Example

<Snippet file="create-venv-step.mdx" />

**1. Install dependencies**

```bash theme={null}
uv pip install -U agno lancedb openai pypdf
```

**2. Export the API key**

```bash theme={null}
export OPENAI_API_KEY=your_openai_api_key_here
```

**3. Run the example**

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

## Search Modes

| `search_type` | Behavior |
| - | - |
| `SearchType.vector` | Searches by embedding similarity |
| `SearchType.keyword` | Uses LanceDB native full-text search |
| `SearchType.hybrid` | Runs LanceDB hybrid vector and full-text search |

## Parameters

<Snippet file="vectordb_lancedb_params.mdx" />

## Next Steps

| Task | Guide |
| - | - |
| Insert, search, and delete content | [LanceDB usage](https://agno-v2.mintlify.site/knowledge/vector-stores/lancedb/usage/lance-db.md) |
| Call async Agno methods | [Async LanceDB usage](https://agno-v2.mintlify.site/knowledge/vector-stores/lancedb/usage/async-lance-db.md) |
| Configure hybrid search | [LanceDB hybrid search](https://agno-v2.mintlify.site/knowledge/vector-stores/lancedb/usage/lance-db-hybrid-search.md) |

## Developer Resources

* [LanceDB Python SDK](https://lancedb.github.io/lancedb/python/python/)


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