aadd_documents() — langchain Function Reference
Architecture documentation for the aadd_documents() function in time_weighted_retriever.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 60f8ad70_73fc_0bd8_e1d1_cd3d2d1ad6b1["aadd_documents()"] 57cc5b02_6622_339b_0806_ef06db1bc8c7["TimeWeightedVectorStoreRetriever"] 60f8ad70_73fc_0bd8_e1d1_cd3d2d1ad6b1 -->|defined in| 57cc5b02_6622_339b_0806_ef06db1bc8c7 style 60f8ad70_73fc_0bd8_e1d1_cd3d2d1ad6b1 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/retrievers/time_weighted_retriever.py lines 180–198
async def aadd_documents(
self,
documents: list[Document],
**kwargs: Any,
) -> list[str]:
"""Add documents to vectorstore."""
current_time = kwargs.get("current_time")
if current_time is None:
current_time = datetime.datetime.now()
# Avoid mutating input documents
dup_docs = [deepcopy(d) for d in documents]
for i, doc in enumerate(dup_docs):
if "last_accessed_at" not in doc.metadata:
doc.metadata["last_accessed_at"] = current_time
if "created_at" not in doc.metadata:
doc.metadata["created_at"] = current_time
doc.metadata["buffer_idx"] = len(self.memory_stream) + i
self.memory_stream.extend(dup_docs)
return await self.vectorstore.aadd_documents(dup_docs, **kwargs)
Domain
Subdomains
Source
Frequently Asked Questions
What does aadd_documents() do?
aadd_documents() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/retrievers/time_weighted_retriever.py.
Where is aadd_documents() defined?
aadd_documents() is defined in libs/langchain/langchain_classic/retrievers/time_weighted_retriever.py at line 180.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free