The LanceDB adapter is one of Cognee’s core vector adapters, along with PGVector.Documentation Index
Fetch the complete documentation index at: https://docs.cognee.ai/llms.txt
Use this file to discover all available pages before exploring further.
Installation
LanceDB is part of Cognee’s core dependencies, so no extra installation steps are required.Setup and Usage
Since LanceDB is a file-based database, and its handler is registered in Cognee by default, all that needs to be set is the information about the provider, and to let Cognee know which handler you are using:Schema Migrations
When you upgrade Cognee and the LanceDB payload schema changes,run_startup_migrations() migrates existing collections to the new schema. In multi-user mode this runs for every dataset database automatically.
Migration behavior for existing rows:
- If all existing rows can be backfilled to the new schema (including required fields that have defaults or types that admit a safe fallback), the migration completes and the collection is updated in place.
- If any existing row cannot be backfilled — for example because a newly added field is required and has no default — the migration aborts with a
RuntimeErrorand leaves the collection unchanged.
- Add an explicit default value to the new required field in your DataPoint model, or
- Make the new field
Optional[YourType](which defaults toNone).
run_startup_migrations().
If a dataset database migration fails, Cognee logs the error and continues migrating the remaining dataset databases. The failed dataset is left in its original state and can be retried after you fix the schema.
Vector Stores
Details About Cognee’s Vector Stores
Multi-User Overview
More Details About Multi-User Mode