haive.agents.rag.step_back.agent ================================ .. py:module:: haive.agents.rag.step_back.agent .. autoapi-nested-parse:: Step-Back Prompting RAG Agents. from typing import Any Implementation of step-back prompting for abstract reasoning. Generates broader conceptual queries for enhanced context retrieval. Classes ------- .. autoapisummary:: haive.agents.rag.step_back.agent.DualRetrievalAgent haive.agents.rag.step_back.agent.StepBackQuery haive.agents.rag.step_back.agent.StepBackQueryGeneratorAgent haive.agents.rag.step_back.agent.StepBackRAGAgent haive.agents.rag.step_back.agent.StepBackResult Functions --------- .. autoapisummary:: haive.agents.rag.step_back.agent.create_step_back_rag_agent haive.agents.rag.step_back.agent.get_step_back_rag_io_schema Module Contents --------------- .. py:class:: DualRetrievalAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that performs both original and step-back retrieval. .. py:method:: build_graph() Build dual retrieval graph. .. py:method:: model_post_init(__context) Initialize the mixin with state tracking attributes after Pydantic validation. .. py:class:: StepBackQuery(/, **data) Bases: :py:obj:`pydantic.BaseModel` Step-back query generation result. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:class:: StepBackQueryGeneratorAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that generates step-back queries for abstract reasoning. .. py:method:: build_graph() Build step-back query generation graph. .. py:class:: StepBackRAGAgent Bases: :py:obj:`haive.agents.multi.base.SequentialAgent` Complete Step-Back RAG agent with abstract reasoning. .. py:method:: from_documents(documents, llm_config = None, embedding_model = None, abstraction_level = 'moderate', max_docs_each = 5, **kwargs) :classmethod: Create Step-Back RAG agent from documents. :param documents: Documents to index :param llm_config: LLM configuration :param embedding_model: Embedding model for retrieval :param abstraction_level: Level of abstraction for step-back queries :param max_docs_each: Max docs to retrieve for each query type :param \*\*kwargs: Additional arguments :returns: StepBackRAGAgent instance .. py:class:: StepBackResult(/, **data) Bases: :py:obj:`pydantic.BaseModel` Combined results from step-back retrieval. Create a new model by parsing and validating input data from keyword arguments. Raises [`ValidationError`][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model. `self` is explicitly positional-only to allow `self` as a field name. .. py:function:: create_step_back_rag_agent(documents, llm_config = None, reasoning_depth = 'moderate', **kwargs) Create a Step-Back RAG agent. :param documents: Documents for retrieval :param llm_config: LLM configuration :param reasoning_depth: Depth of reasoning ("shallow", "moderate", "deep") :param \*\*kwargs: Additional arguments :returns: Configured Step-Back RAG agent .. py:function:: get_step_back_rag_io_schema() Get I/O schema for Step-Back RAG agents.