LanceDBVectorStore#

class llama_index.vector_stores.LanceDBVectorStore(uri: str, table_name: str = 'vectors', vector_column_name: str = 'vector', nprobes: int = 20, refine_factor: Optional[int] = None, text_key: str = 'text', doc_id_key: str = 'doc_id', **kwargs: Any)#

Bases: VectorStore

The LanceDB Vector Store.

Stores text and embeddings in LanceDB. The vector store will open an existing

LanceDB dataset or create the dataset if it does not exist.

Parameters
  • uri (str, required) – Location where LanceDB will store its files.

  • table_name (str, optional) – The table name where the embeddings will be stored. Defaults to “vectors”.

  • vector_column_name (str, optional) – The vector column name in the table if different from default. Defaults to “vector”, in keeping with lancedb convention.

  • nprobes (int, optional) – The number of probes used. A higher number makes search more accurate but also slower. Defaults to 20.

  • refine_factor – (int, optional): Refine the results by reading extra elements and re-ranking them in memory. Defaults to None

Raises

ImportError – Unable to import lancedb.

Returns

VectorStore that supports creating LanceDB datasets and

querying it.

Return type

LanceDBVectorStore

Attributes Summary

Methods Summary

add(nodes, **add_kwargs)

Add nodes with embedding to vector store.

delete(ref_doc_id, **delete_kwargs)

Delete nodes using with ref_doc_id.

query(query, **kwargs)

Query index for top k most similar nodes.

Attributes Documentation

client#

Get client.

flat_metadata: bool = True#
stores_text: bool = True#

Methods Documentation

add(nodes: List[BaseNode], **add_kwargs: Any) List[str]#

Add nodes with embedding to vector store.

delete(ref_doc_id: str, **delete_kwargs: Any) None#

Delete nodes using with ref_doc_id.

Parameters

ref_doc_id (str) – The doc_id of the document to delete.

query(query: VectorStoreQuery, **kwargs: Any) VectorStoreQueryResult#

Query index for top k most similar nodes.