Skip to main content
The LanceDBHandshake class provides seamless integration between Chonkie’s chunking system and LanceDB, a serverless vector database built on Apache Arrow. Embed and store your Chonkie chunks in LanceDB — locally or in the cloud — without ever leaving the Chonkie SDK.

Installation

Before using the LanceDB handshake, make sure to install the required dependencies:

Basic Usage

Initialization

Writing Chunks to LanceDB

Searching Chunks in LanceDB

You can retrieve the most similar chunks from your LanceDB table using the search method:

Parameters

connection
Optional[lancedb.DBConnection]
default:"None"
An existing LanceDB connection. If not provided, a new connection is created using uri.
uri
Union[str, os.PathLike]
default:"memory://"
URI of the LanceDB database. Use "memory://" for an ephemeral in-memory database, a local directory path for persistent storage, or a db:// URI for LanceDB Cloud.
table_name
Union[str, Literal['random']]
default:"random"
Name of the table to write chunks to. If "random", a unique name is auto-generated.
embedding_model
Union[str, BaseEmbeddings]
default:"minishlab/potion-retrieval-32M"
Embedding model to use. Can be a model name string or a BaseEmbeddings instance.