A document retriever that supports indexing operations.
This indexing interface is designed to be a generic abstraction for storing and querying documents that has an ID and metadata associated with it.
The interface is designed to be agnostic to the underlying implementation of the indexing system.
The interface is designed to support the following operations:
Upsert documents into the index.
The upsert functionality should utilize the ID field of the content object if it is provided. If the ID is not provided, the upsert method is free to generate an ID for the content.
When an ID is specified and the content already exists in the VectorStore,
the upsert method should update the content with the new data. If the content
does not exist, the upsert method should add the item to the VectorStore.
Add or update documents in the VectorStore. Async version of upsert.
The upsert functionality should utilize the ID field of the item if it is provided. If the ID is not provided, the upsert method is free to generate an ID for the item.
When an ID is specified and the item already exists in the VectorStore,
the upsert method should update the item with the new data. If the item
does not exist, the upsert method should add the item to the VectorStore.
Delete by IDs or other criteria.
Calling delete without any input parameters should raise a ValueError!
Delete by IDs or other criteria. Async variant.
Calling adelete without any input parameters should raise a ValueError!
Get documents by id.
Fewer documents may be returned than requested if some IDs are not found or if there are duplicated IDs.
Users should not assume that the order of the returned documents matches the order of the input IDs. Instead, users should rely on the ID field of the returned documents.
This method should NOT raise exceptions if no documents are found for some IDs.
Get documents by id.
Fewer documents may be returned than requested if some IDs are not found or if there are duplicated IDs.
Users should not assume that the order of the returned documents matches the order of the input IDs. Instead, users should rely on the ID field of the returned documents.
This method should NOT raise exceptions if no documents are found for some IDs.
Return True as this class is serializable.
Get the namespace of the LangChain object.
Return a unique identifier for this class for serialization purposes.
Convert the graph to a JSON-serializable format.
Serialize a "not implemented" object.
Get a JSON schema that represents the input to the Runnable.
Get a JSON schema that represents the output of the Runnable.
The type of config this Runnable accepts specified as a Pydantic model.
Get a JSON schema that represents the config of the Runnable.
Return a list of prompts used by this Runnable.
Pipe Runnable objects.
Pick keys from the output dict of this Runnable.
Merge the Dict input with the output produced by the mapping argument.
Invoke the retriever to get relevant documents.
Asynchronously invoke the retriever to get relevant documents.
Run invoke in parallel on a list of inputs.
Run ainvoke in parallel on a list of inputs.
Stream all output from a Runnable, as reported to the callback system.
Generate a stream of events.
Bind arguments to a Runnable, returning a new Runnable.
Bind lifecycle listeners to a Runnable, returning a new Runnable.
Bind async lifecycle listeners to a Runnable.
Bind input and output types to a Runnable, returning a new Runnable.
Create a new Runnable that retries the original Runnable on exceptions.
Map a function to multiple iterables.
Add fallbacks to a Runnable, returning a new Runnable.
Create a BaseTool from a Runnable.