haive.core.graph.node.meta_agent_node¶

Meta agent node for executing embedded agents from meta state.

This module provides MetaAgentNodeConfig, a specialized node configuration for executing agents that are embedded within MetaStateSchema instances. This enables sophisticated agent composition patterns and nested execution.

The meta agent node can: - Extract agents from meta state - Prepare input data for embedded agent execution - Execute the embedded agent with proper configuration - Handle agent output and update meta state - Manage execution context and error handling

Examples

from haive.core.graph.node.meta_agent_node import MetaAgentNodeConfig from haive.core.schema.prebuilt.meta_state import MetaStateSchema from haive.agents.simple.agent import SimpleAgent

# Create a meta agent node meta_node = MetaAgentNodeConfig(

name=”execute_embedded_agent”, input_preparation=”auto”, # Automatically prepare input output_handling=”merge”, # Merge output back to meta state error_handling=”capture” # Capture errors in meta state

)

# Use in a graph with meta state # The node will automatically execute the embedded agent

Classes¶

MetaAgentNodeConfig

Specialized node for executing agents embedded in meta state.

Module Contents¶

class haive.core.graph.node.meta_agent_node.MetaAgentNodeConfig(/, **data)¶

Bases: haive.core.graph.node.base_config.NodeConfig

Specialized node for executing agents embedded in meta state.

This node configuration is designed to work with MetaStateSchema instances that contain embedded agents. It handles the complete lifecycle of embedded agent execution including input preparation, execution, output handling, and error management.

Key Features:
  • Automatic agent extraction from meta state

  • Flexible input preparation strategies

  • Multiple output handling modes

  • Comprehensive error handling and logging

  • Execution context management

  • State synchronization between meta and embedded agents

Input Preparation Modes:
  • “auto”: Automatically prepare input from meta state

  • “agent_input”: Use only the agent_input field

  • “messages”: Use only messages from meta state

  • “full_state”: Use the entire meta state as input

  • “custom”: Use custom input preparation logic

Output Handling Modes:
  • “merge”: Merge agent output back to meta state

  • “replace”: Replace agent_output field with new output

  • “append”: Append output to execution history only

  • “custom”: Use custom output handling logic

Error Handling Modes:
  • “capture”: Capture errors in meta state error_info

  • “raise”: Re-raise errors after capturing

  • “ignore”: Log errors but continue execution

  • “custom”: Use custom error handling logic

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)