Configure LanceDB as your vector store for fast, file-based vector search with Cognee
LanceDB is a fast, file-based vector database that serves as Cognee’s default vector store. It requires no server setup and provides excellent performance for development and production workloads.
LanceDB is perfect for serverless deployments and local development, offering fast vector search without the complexity of managing a separate database server.
# LanceDB is included with Cognee by defaultpip install cognee
2
Configure Cognee
Copy
Ask AI
import osimport cognee# LanceDB is the default, but you can be explicitos.environ["VECTOR_DB_PROVIDER"] = "lancedb"os.environ["VECTOR_DB_PATH"] = "./lancedb_data"print("LanceDB configured successfully!")
3
Test Setup
Copy
Ask AI
import asyncioasync def test_lancedb(): # Add test data await cognee.add("LanceDB provides fast vector storage for Cognee.") await cognee.cognify() # Test vector search results = await cognee.search( "vector storage performance", query_type=SearchType.CHUNKS ) print(f"Found {len(results)} relevant chunks") print(f"Top result: {results[0][:100]}...")asyncio.run(test_lancedb())