Skip to content

retriever_agent

langroid/agent/special/retriever_agent.py

Deprecated: use DocChatAgent instead, with DocChatAgentConfig.retrieve_only=True, and if you want to retrieve FULL relevant doc-contents rather than just extracts, then set DocChatAgentConfig.extraction_granularity=-1

This is an agent to retrieve relevant extracts from a vector store, where the LLM is used to filter for "true" relevance after retrieval from the vector store. This is essentially the same as DocChatAgent, except that instead of generating final summary answer based on relevant extracts, it just returns those extracts. See test_retriever_agent.py for example usage.

RetrieverAgent(config)

Bases: DocChatAgent

Agent for just retrieving chunks/docs/extracts matching a query

Source code in langroid/agent/special/retriever_agent.py
def __init__(self, config: DocChatAgentConfig):
    super().__init__(config)
    self.config: DocChatAgentConfig = config
    logger.warning(
        """
    `RetrieverAgent` is deprecated. Use `DocChatAgent` instead, with
    `DocChatAgentConfig.retrieve_only=True`, and if you want to retrieve
    FULL relevant doc-contents rather than just extracts, then set
    `DocChatAgentConfig.extraction_granularity=-1`
    """
    )