{"id":23982,"library":"llama-index-vector-stores-lancedb","title":"LlamaIndex Vector Store - LanceDB","description":"LanceDB vector store integration for LlamaIndex. Current version 0.5.0. Provides a LanceDBVectorStore class for storing and querying vector embeddings. Release cadence is irregular; follows LlamaIndex package structure. Supports hybrid search and column filtering in LanceDB.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/vector_stores/llama-index-vector-stores-lancedb","tags":["llamaindex","vector-store","lancedb","rag","embedding"],"install":[{"cmd":"pip install llama-index-vector-stores-lancedb","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core LlamaIndex abstractions (BaseNode, VectorStoreQuery)","package":"llama-index-core","optional":false},{"reason":"LanceDB Python SDK","package":"lancedb","optional":false}],"imports":[{"note":"Older versions used a submodule path; current canonical import is from the package directly.","wrong":"from llama_index.vector_stores.lancedb.base import LanceDBVectorStore","symbol":"LanceDBVectorStore","correct":"from llama_index.vector_stores.lancedb import LanceDBVectorStore"},{"note":"Correct import path.","wrong":"","symbol":"LanceDBVectorStore","correct":"from llama_index.vector_stores.lancedb import LanceDBVectorStore"}],"quickstart":{"code":"import lancedb\nfrom llama_index.core import SimpleDirectoryReader, StorageContext, VectorStoreIndex\nfrom llama_index.vector_stores.lancedb import LanceDBVectorStore\n\n# Create LanceDB connection and table\nuri = \"data/sample-lancedb\"\ndb = lancedb.connect(uri)\ntable_name = \"my_table\"\ntable = db.create_table(table_name, data=[{\"vector\": [0.0]*768, \"text\": \"placeholder\"}], mode=\"overwrite\")\n\n# Initialize vector store\nvector_store = LanceDBVectorStore(uri=uri, table_name=table_name)\n\n# Create storage context\nstorage_context = StorageContext.from_defaults(vector_store=vector_store)\n\n# Load documents and build index\ndocuments = SimpleDirectoryReader(\"data\").load_data()\nindex = VectorStoreIndex.from_documents(documents, storage_context=storage_context)\n\n# Query\nquery_engine = index.as_query_engine()\nresponse = query_engine.query(\"What is LanceDB?\")\nprint(response)","lang":"python","description":"Minimal working example: connect to LanceDB, create a vector store, build an index, and query."},"warnings":[{"fix":"Replace `LanceDBVectorStore(connection=db)` with `LanceDBVectorStore(uri=uri, table_name=table_name)`.","message":"LanceDBVectorStore no longer accepts 'connection' parameter; use 'uri' instead. As of v0.4.0, the constructor requires 'uri' and 'table_name' directly.","severity":"breaking","affected_versions":">=0.4.0"},{"fix":"Ensure embedding dimension passed to LanceDBVectorStore matches your embedding model's dimension. Default is 1536 for OpenAI but can be set via 'dim' parameter.","message":"The vector dimension must match the embedding model dimension. LanceDB does not automatically validate dimensions; mismatches cause runtime errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Create the table explicitly using the LanceDB Python API before using the vector store.","message":"Table must exist before using LanceDBVectorStore; the store does not automatically create tables. Use lancedb.connect(uri).create_table(table_name, data) first.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install the package: pip install llama-index-vector-stores-lancedb. For versions older than 0.4.0, use: from llama_index.vector_stores.lancedb.base import LanceDBVectorStore","cause":"Package not installed correctly or import path is wrong for version < 0.4.0.","error":"ModuleNotFoundError: No module named 'llama_index.vector_stores.lancedb'"},{"fix":"Change to: LanceDBVectorStore(uri='your_uri', table_name='your_table')","cause":"The 'connection' parameter was removed in v0.4.0; constructor now expects 'uri' and 'table_name'.","error":"TypeError: LanceDBVectorStore.__init__() got an unexpected keyword argument 'connection'"},{"fix":"Set the dimension explicitly when creating the vector store or table: LanceDBVectorStore(uri=uri, table_name=table_name, dim=1536)","cause":"Embedding dimension provided to LanceDB table does not match the dimension of the vectors being inserted.","error":"lancedb.error.LanceError: Invalid argument: Dimension mismatch: expected 768 but got 1536"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}