agents.base.universal_agent¶
Universal Agent - Simplified base class for all agent types.
This module provides a simplified Agent base class that maintains familiar naming while providing clear type-based capabilities and proper separation of concerns through agent types rather than complex inheritance hierarchies.
Classes¶
Universal base class for all agent types in the Haive framework. |
Functions¶
|
Get capabilities for agent type. |
|
Check if agent type orchestrates other agents. |
|
Check if agent type is for deterministic processing. |
|
Check if agent type has reasoning capabilities. |
Module Contents¶
- class agents.base.universal_agent.Agent(/, **data)¶
Bases:
pydantic.BaseModel
,abc.ABC
Universal base class for all agent types in the Haive framework.
All components that can be executed as graphs are “Agents” but have different types that determine their capabilities:
REASONING: LLM-based agents that can reason and use tools
RETRIEVER: Agents that retrieve information from data sources
LOADER: Agents that load data from various sources
PROCESSOR: Agents that transform and process data
PIPELINE: Agents that chain processing operations
WORKFLOW: Agents that orchestrate multiple other agents
CHAIN: Agents that execute other agents sequentially
The agent_type field determines what capabilities and methods are available to each agent instance.
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)
- async ainvoke(input_data, config=None)¶
Asynchronous invoke method.
- abstractmethod build_graph()¶
Build the graph representation for this agent.
This method must be implemented by all agent subclasses to define how the agent should be represented as a graph structure.
- Returns:
The graph representation of this agent
- Return type:
BaseGraph
- compile(**kwargs)¶
Compile this agent to an executable LangGraph instance.
- Parameters:
**kwargs – Additional compilation arguments
- Returns:
Executable LangGraph instance
- Return type:
CompiledGraph
- invoke(input_data, config=None)¶
Invoke the agent with input data.
- agents.base.universal_agent.get_agent_capabilities(agent_type)¶
Get capabilities for agent type.
- agents.base.universal_agent.is_orchestration_agent(agent_type)¶
Check if agent type orchestrates other agents.
- Parameters:
agent_type (haive.core.engine.base.agent_types.AgentType)
- Return type:
- agents.base.universal_agent.is_processing_agent(agent_type)¶
Check if agent type is for deterministic processing.
- Parameters:
agent_type (haive.core.engine.base.agent_types.AgentType)
- Return type: