langchain.vectorstores.nucliadb.NucliaDB¶
class langchain.vectorstores.nucliadb.NucliaDB(knowledge_box: str, local: bool, api_key: Optional[str] = None, backend: Optional[str] = None)[source]¶
NucliaDB vector store.
Initialize the NucliaDB client.
Parameters
knowledge_box – the Knowledge Box id.
local – Whether to use a local NucliaDB instance or Nuclia Cloud
api_key – A contributor API key for the kb (needed when local is False)
backend – The backend url to use when local is True, defaults to
http – //localhost:8080
Attributes
embeddings
Access the query embedding object if available.
is_local
kb_url
Methods
__init__(knowledge_box, local[, api_key, ...])
Initialize the NucliaDB client.
aadd_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
aadd_texts(texts[, metadatas])
Run more texts through the embeddings and add to the vectorstore.
add_documents(documents, **kwargs)
Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas])
Upload texts to NucliaDB
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents and embeddings.
afrom_texts(texts, embedding[, metadatas])
Return VectorStore initialized from texts and embeddings.
amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)