fabricatio_lancedb.rust
Classes
Represents a document that has been searched and retrieved from the vector store. |
|
A service for managing vector stores using LanceDB. |
|
Package Contents
- class fabricatio_lancedb.rust.SearchedDocument
Represents a document that has been searched and retrieved from the vector store.
This structure contains the core information of a searched document including its unique identifier, content, timestamp of creation/modification, and any associated metadata stored as JSON string.
- class fabricatio_lancedb.rust.StoreDocument
- class fabricatio_lancedb.rust.VectorStoreService
A service for managing vector stores using LanceDB.
This service provides methods for connecting to a LanceDB instance, creating tables, opening existing tables, and creating or opening tables. It acts as a high-level interface for vector store operations.
- create_table(table_name: str, ndim: int) Awaitable[VectorStoreTable]
Create a table.
- open_table(table_name: str) Awaitable[VectorStoreTable]
Open a table.
- create_or_open_table(table_name: str, ndim: int) Awaitable[VectorStoreTable]
Create or open a table.
- class fabricatio_lancedb.rust.VectorStoreTable
- add_documents(documents: list[StoreDocument], rebuild_index: bool = True) Awaitable[list[str]]
Adds multiple documents to the vector store.
- Parameters:
documents – A list of StoreDocument objects to be added to the store.
rebuild_index – If True (default), rebuild the vector index after adding. Set to False for bulk inserts.
- Returns:
An awaitable that resolves to a list of document IDs.
- rebuild_index() Awaitable[None]
Rebuilds the vector index on the table.
Useful after bulk inserts with
rebuild_index=False. No-op if the table has fewer than 256 rows (minimum for PQ training).
- search_document(embedding: Sequence[float], limit: int) Awaitable[list[SearchedDocument]]
Searches for documents similar to the given embedding vector.
- Parameters:
embedding – A vector representing the query embedding for similarity search.
limit – The maximum number of similar documents to return.
- Returns:
An awaitable that resolves to a list of SearchedDocument objects.