agents.rag.flare.agent¶
FLARE (Forward-Looking Active REtrieval) RAG Agents.
from typing import Any Implementation of FLARE RAG with forward-looking retrieval and iterative generation. Uses structured output models for planning and managing active retrieval decisions.
Classes¶
Agent that performs active retrieval based on FLARE plans. |
|
Confidence levels for generation. |
|
Forward-looking plan for active retrieval. |
|
Agent that creates FLARE plans for iterative generation and active retrieval. |
|
Complete FLARE RAG agent with forward-looking active retrieval. |
|
Results from FLARE processing. |
|
Decisions for active retrieval. |
Functions¶
|
Create callable function for active retrieval. |
|
Create callable function for FLARE planning. |
|
Create a FLARE RAG agent. |
Get I/O schema for FLARE RAG agents. |
Module Contents¶
- class agents.rag.flare.agent.ActiveRetrievalAgent¶
Bases:
haive.agents.base.agent.Agent
Agent that performs active retrieval based on FLARE plans.
- build_graph()¶
Build active retrieval graph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- class agents.rag.flare.agent.ConfidenceLevel¶
-
Confidence levels for generation.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.flare.agent.FLAREPlan(/, **data)¶
Bases:
pydantic.BaseModel
Forward-looking plan for active 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.
- Parameters:
data (Any)
- class agents.rag.flare.agent.FLAREPlannerAgent¶
Bases:
haive.agents.base.agent.Agent
Agent that creates FLARE plans for iterative generation and active retrieval.
- build_graph()¶
Build FLARE planning graph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- class agents.rag.flare.agent.FLARERAGAgent(config)¶
Bases:
haive.agents.multi.base.SequentialAgent
Complete FLARE RAG agent with forward-looking active retrieval.
Init .
- Parameters:
config (SequentialAgentConfig) – [TODO: Add description]
- classmethod from_documents(documents, llm_config=None, max_iterations=5, confidence_threshold=0.7, **kwargs)¶
Create FLARE RAG agent from documents.
- Parameters:
- Returns:
FLARERAGAgent instance
- class agents.rag.flare.agent.FLAREResult(/, **data)¶
Bases:
pydantic.BaseModel
Results from FLARE processing.
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.
- Parameters:
data (Any)
- class agents.rag.flare.agent.RetrievalDecision¶
-
Decisions for active retrieval.
Initialize self. See help(type(self)) for accurate signature.
- agents.rag.flare.agent.create_active_retrieval_callable(documents, embedding_model=None)¶
Create callable function for active retrieval.
- agents.rag.flare.agent.create_flare_planner_callable(llm_config)¶
Create callable function for FLARE planning.
- Parameters:
llm_config (haive.core.models.llm.base.LLMConfig)
- agents.rag.flare.agent.create_flare_rag_agent(documents, llm_config=None, flare_mode='adaptive', **kwargs)¶
Create a FLARE RAG agent.
- Parameters:
- Returns:
Configured FLARE RAG agent
- Return type: