> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agno.com/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.
</Warning>

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

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno lancedb openai pypdf
    ```
  </Step>

  <Step title="Export the API key">
    ```bash theme={null}
    export OPENAI_API_KEY=your_openai_api_key_here
    ```
  </Step>

  <Step title="Run the example">
    ```bash theme={null}
    python agent_with_knowledge.py
    ```
  </Step>
</Steps>

## 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](/knowledge/vector-stores/lancedb/usage/lance-db)                       |
| Call async Agno methods            | [Async LanceDB usage](/knowledge/vector-stores/lancedb/usage/async-lance-db)           |
| Configure hybrid search            | [LanceDB hybrid search](/knowledge/vector-stores/lancedb/usage/lance-db-hybrid-search) |

## Developer Resources

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