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

Agent

Universal base class for all agent types in the Haive framework.

Functions

get_agent_capabilities(agent_type)

Get capabilities for agent type.

is_orchestration_agent(agent_type)

Check if agent type orchestrates other agents.

is_processing_agent(agent_type)

Check if agent type is for deterministic processing.

is_reasoning_agent(agent_type)

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.

Parameters:
  • input_data (Any) – Input data for the agent

  • config (dict[str, Any] | None) – Optional configuration for execution

Returns:

Agent execution result

Return type:

Any

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

can_orchestrate()

Check if agent can orchestrate other agents.

Return type:

bool

can_process_batch()

Check if agent supports batch processing.

Return type:

bool

can_reason()

Check if agent can perform reasoning operations.

Return type:

bool

compile(**kwargs)

Compile this agent to an executable LangGraph instance.

Parameters:

**kwargs – Additional compilation arguments

Returns:

Executable LangGraph instance

Return type:

CompiledGraph

get_capabilities()

Get capabilities available to this agent.

Return type:

dict[str, bool]

invoke(input_data, config=None)

Invoke the agent with input data.

Parameters:
  • input_data (Any) – Input data for the agent

  • config (dict[str, Any] | None) – Optional configuration for execution

Returns:

Agent execution result

Return type:

Any

is_orchestration_agent()

Check if this agent orchestrates other agents.

Return type:

bool

is_processing_agent()

Check if this agent is for deterministic processing.

Return type:

bool

is_reasoning_agent()

Check if this agent has reasoning capabilities.

Return type:

bool

agents.base.universal_agent.get_agent_capabilities(agent_type)

Get capabilities for agent type.

Parameters:

agent_type (haive.core.engine.base.agent_types.AgentType)

Return type:

dict[str, bool]

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:

bool

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:

bool

agents.base.universal_agent.is_reasoning_agent(agent_type)

Check if agent type has reasoning capabilities.

Parameters:

agent_type (haive.core.engine.base.agent_types.AgentType)

Return type:

bool