_aget_relevant_documents() — langchain Function Reference
Architecture documentation for the _aget_relevant_documents() function in multi_query.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD 437f73d9_6841_a790_7045_3311a114243f["_aget_relevant_documents()"] cc26ec3b_70dc_5b02_e974_582867b22f34["MultiQueryRetriever"] 437f73d9_6841_a790_7045_3311a114243f -->|defined in| cc26ec3b_70dc_5b02_e974_582867b22f34 1b6d98c6_de11_daac_c877_e735a1432e2b["agenerate_queries()"] 437f73d9_6841_a790_7045_3311a114243f -->|calls| 1b6d98c6_de11_daac_c877_e735a1432e2b b1e3c34e_3ed6_3dee_9d90_294b4ca567cb["aretrieve_documents()"] 437f73d9_6841_a790_7045_3311a114243f -->|calls| b1e3c34e_3ed6_3dee_9d90_294b4ca567cb 4b4d59ff_8151_861f_adb3_b94cde534dac["unique_union()"] 437f73d9_6841_a790_7045_3311a114243f -->|calls| 4b4d59ff_8151_861f_adb3_b94cde534dac style 437f73d9_6841_a790_7045_3311a114243f fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
libs/langchain/langchain_classic/retrievers/multi_query.py lines 95–114
async def _aget_relevant_documents(
self,
query: str,
*,
run_manager: AsyncCallbackManagerForRetrieverRun,
) -> list[Document]:
"""Get relevant documents given a user query.
Args:
query: user query
run_manager: the callback handler to use.
Returns:
Unique union of relevant documents from all generated queries
"""
queries = await self.agenerate_queries(query, run_manager)
if self.include_original:
queries.append(query)
documents = await self.aretrieve_documents(queries, run_manager)
return self.unique_union(documents)
Domain
Subdomains
Source
Frequently Asked Questions
What does _aget_relevant_documents() do?
_aget_relevant_documents() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/retrievers/multi_query.py.
Where is _aget_relevant_documents() defined?
_aget_relevant_documents() is defined in libs/langchain/langchain_classic/retrievers/multi_query.py at line 95.
What does _aget_relevant_documents() call?
_aget_relevant_documents() calls 3 function(s): agenerate_queries, aretrieve_documents, unique_union.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free