Returns
List of Documents most similar to the query
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run similarity search asynchronously and return relevance scores
Parameters
query (str) – Query
k (int) – Number of results to return. Defaults to 4.
Returns
List of Documents most similar along with relevance scores
async asimilarity_search_with_score(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]][source]¶
Run similarity search asynchronously and return distance scores
Parameters
query (str) – Query
k (int) – Number of results to return. Defaults to 4.
Returns
List of Documents most similar along with relevance distance scores
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶
Delete by document ID.
Parameters
ids – List of ids to delete.
**kwargs – Other keyword arguments that subclasses might use.
Returns
True if deletion is successful,
False otherwise.
Return type
Optional[bool]
classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → SurrealDBStore[source]¶
Create SurrealDBStore from list of text
Parameters
texts (List[str]) – list of text to vectorize and store
embedding (Optional[Embeddings]) – Embedding function.
dburl (str) – SurrealDB connection url
ns (str) – surrealdb namespace for the vector store.