Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to query.
async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs most similar to query.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → None[source]¶
Delete by IDs.
Parameters
ids – List of ids to delete.
delete_cluster() → None[source]¶
Delete the cluster.
classmethod from_documents(documents: List[Document], embedding: Optional[Embeddings] = None, ids: Optional[List[str]] = None, cluster_name: str = 'langchain', client_settings: Optional[bagel.config.Settings] = None, client: Optional[bagel.Client] = None, cluster_metadata: Optional[Dict] = None, **kwargs: Any) → Bagel[source]¶
Create a Bagel vectorstore from a list of documents.
Parameters
documents (List[Document]) – List of Document objects to add to the
Bagel vectorstore.
embedding (Optional[List[float]]) – List of embedding.
ids (Optional[List[str]]) – List of IDs. Defaults to None.
cluster_name (str) – The name of the BagelDB cluster.
client_settings (Optional[bagel.config.Settings]) – Client settings.
client (Optional[bagel.Client]) – Bagel client instance.
cluster_metadata (Optional[Dict]) – Metadata associated with the