The underlying vectorstore to use to store small chunks
and their embedding vectors
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation of abatch, which calls ainvoke N times.
Subclasses should override this method if they can batch more efficiently.
add_documents(documents: List[Document], ids: Optional[List[str]] = None, add_to_docstore: bool = True) → None[source]¶
Adds documents to the docstore and vectorstores.
Parameters
documents – List of documents to add
ids – Optional list of ids for documents. If provided should be the same
length as the list of documents. Can provided if parent documents
are already in the document store and you don’t want to re-add
to the docstore. If not provided, random UUIDs will be used as
ids.
add_to_docstore – Boolean of whether to add documents to docstore.
This can be false if and only if ids are provided. You may want
to set this to False if the documents are already in the docstore
and you don’t want to re-add them.
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
:param tags: Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retriever,