Examples

Learn Hugin through working examples. Each example demonstrates specific features and patterns.

Getting Started

Example Description Key Concepts
basic_agent Simplest agent setup Config, Task, Templates, Tools

Start here to understand the basic structure.

Core Patterns

Example Description Key Concepts
tool_chaining Deterministic tool pipelines next_tool parameter
task_chaining Sequential task execution next_task parameter
task_sequences Multi-stage pipelines task_sequence, pass_result_as
plan_execute_agent Config-based state machines State transitions, mode switching
human_interaction Human-in-the-loop AskHuman, approval workflows

Advanced Features

Example Description Key Concepts
branching Parallel exploration Stack branching, isolation
artifacts Long-term memory save_insight, query_artifacts

Multi-Agent

Example Description Key Concepts
sub_agent Parent-child hierarchy Agent delegation
parallel_agents Concurrent execution Session management
agent_messaging Agent-to-agent communication Message passing
shared_state Shared data with access control Namespaces, permissions

Running Examples

# Clone the repository
git clone https://github.com/arnovich/gimle-hugin.git
cd gimle-hugin

# Install dependencies
uv sync --all-extras

# Run an example
uv run run-agent --task hello_world --task-path examples/basic_agent

# With parameters
uv run run-agent --task hello_world --task-path examples/basic_agent \
  --parameters '{"questions": "What is AI?"}'

# With monitoring
uv run run-agent --task hello_world --task-path examples/basic_agent \
  --storage-path ./data/demo

# In another terminal
uv run monitor-agents --storage-path ./data/demo

Production Apps

More complex applications in the apps/ directory:

App Description
data_analyst SQL queries, data transformation, analysis
financial_newspaper Multi-agent financial journalism workflow
rap_machine Multi-agent rap battles (fun demo)
the_hugins Autonomous 2D world simulation

See the apps README for details on running these.