Returns
List of Tuples of (doc, similarity_score)
similarity_search_with_score(query: str, k: int = 5, where: Optional[Dict[str, str]] = None, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run a similarity search with BagelDB and return documents with their
corresponding similarity scores.
Parameters
query (str) – The query text to search for similar documents.
k (int) – The number of results to return.
where (Optional[Dict[str, str]]) – Filter using metadata.
Returns
List of tuples, each containing a
Document object representing a similar document and its
corresponding similarity score.
Return type
List[Tuple[Document, float]]
update_document(document_id: str, document: Document) → None[source]¶
Update a document in the cluster.
Parameters
document_id (str) – ID of the document to update.
document (Document) – Document to update.
Examples using Bagel¶
BagelDB