Skip to content

The agent engineering platform.

adding add_documents and aadd_documents to class RedisVectorStoreRetriever (#3419)

Vincent9e36d7b82c48
diff --git a/langchain/vectorstores/redis.py b/langchain/vectorstores/redis.py
index 986ee877b6..a015bba9b5 100644
--- a/langchain/vectorstores/redis.py
+++ b/langchain/vectorstores/redis.py
@@ -461,3 +461,13 @@ class RedisVectorStoreRetriever(BaseRetriever, BaseModel):
async def aget_relevant_documents(self, query: str) -> List[Document]:
raise NotImplementedError("RedisVectorStoreRetriever does not support async")
+
+ def add_documents(self, documents: List[Document], **kwargs: Any) -> List[str]:
+ """Add documents to vectorstore."""
+ return self.vectorstore.add_documents(documents, **kwargs)
+
+ async def aadd_documents(
+ self, documents: List[Document], **kwargs: Any
+ ) -> List[str]:
+ """Add documents to vectorstore."""
+ return await self.vectorstore.aadd_documents(documents, **kwargs)