langchain_community.vectorstores.surrealdb.SurrealDBStore¶
class langchain_community.vectorstores.surrealdb.SurrealDBStore(embedding_function: Embeddings, **kwargs: Any)[source]¶
SurrealDB as Vector Store.
To use, you should have the surrealdb python package installed.
Parameters
embedding_function – Embedding function to use.
dburl – SurrealDB connection url
ns – surrealdb namespace for the vector store. (default: “langchain”)
db – surrealdb database for the vector store. (default: “database”)
collection – surrealdb collection for the vector store.
(default: “documents”)
db_pass ((optional) db_user and) – surrealdb credentials
Example
from langchain.vectorstores.surrealdb import SurrealDBStore
from langchain.embeddings import HuggingFaceEmbeddings
embedding_function = HuggingFaceEmbeddings()
dburl = "ws://localhost:8000/rpc"
ns = "langchain"
db = "docstore"
collection = "documents"
db_user = "root"
db_pass = "root"
sdb = SurrealDBStore.from_texts(
        texts=texts,
        embedding=embedding_function,
        dburl,
        ns, db, collection,
        db_user=db_user, db_pass=db_pass)
Attributes
embeddings
Access the query embedding object if available.
Methods
__init__(embedding_function, **kwargs)
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Add list of text along with embeddings to the vector store asynchronously
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.