Home / Function/ _aget_relevant_documents() — langchain Function Reference

_aget_relevant_documents() — langchain Function Reference

Architecture documentation for the _aget_relevant_documents() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  59078602_294c_8293_a58c_2df8b4e9e2ba["_aget_relevant_documents()"]
  714ad545_01d2_22ce_704e_4b6490f7b443["SelfQueryRetriever"]
  59078602_294c_8293_a58c_2df8b4e9e2ba -->|defined in| 714ad545_01d2_22ce_704e_4b6490f7b443
  2a26f59b_9df1_ea18_bd4b_419d13fe08ec["_prepare_query()"]
  59078602_294c_8293_a58c_2df8b4e9e2ba -->|calls| 2a26f59b_9df1_ea18_bd4b_419d13fe08ec
  f40e46a5_6c7a_2f97_f3be_ba9413f51830["_aget_docs_with_query()"]
  59078602_294c_8293_a58c_2df8b4e9e2ba -->|calls| f40e46a5_6c7a_2f97_f3be_ba9413f51830
  style 59078602_294c_8293_a58c_2df8b4e9e2ba fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/retrievers/self_query/base.py lines 326–339

    async def _aget_relevant_documents(
        self,
        query: str,
        *,
        run_manager: AsyncCallbackManagerForRetrieverRun,
    ) -> list[Document]:
        structured_query = await self.query_constructor.ainvoke(
            {"query": query},
            config={"callbacks": run_manager.get_child()},
        )
        if self.verbose:
            logger.info("Generated Query: %s", structured_query)
        new_query, search_kwargs = self._prepare_query(query, structured_query)
        return await self._aget_docs_with_query(new_query, search_kwargs)

Domain

Subdomains

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/self_query/base.py.
Where is _aget_relevant_documents() defined?
_aget_relevant_documents() is defined in libs/langchain/langchain_classic/retrievers/self_query/base.py at line 326.
What does _aget_relevant_documents() call?
_aget_relevant_documents() calls 2 function(s): _aget_docs_with_query, _prepare_query.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free