Hierarchical

Agents are organized in a tree-like structure, with higher-level agents (supervisors) coordinating specialist agents.

Overview

Hierarchies shine when you need structured decision flows, explicit quality checks, and clear ownership of each step. Supervisors break work into pieces, delegate to the right specialists, and assemble the final answer.

Demo Scenario: Multi-Level Research System

This runnable example builds a three-layer hierarchy to research a topic:

  1. Coordinator โ€“ orchestrates the workflow and talks to the user

  2. Research agent โ€“ performs web searches using the platform's search tool

  3. Information compiler โ€“ formats raw findings into a polished summary

The coordinator delegates research to the specialist, forwards those notes to the compiler, then delivers the final write-up.

Diagram

Hierarchical pattern diagram showing coordinator and specialist agents.

Implementation Steps

  1. Create the research and information compiler agents

  2. Create the coordinator with sub-agents and workflow instructions

  3. Run the hierarchy on a topic and perform cleanup

How to Run

From the repository root glaip-sdk/python/glaip-sdk:

Ensure your .env contains:

Output

Notes

  • Add reviewers or domain specialists as additional hierarchy levels for more rigorous validation.

  • Swap the web_search tool for a custom integration if your platform exposes a different search capability.

  • Monitor each delegated run with the CLI --verbose flag or renderer callbacks to debug coordination steps.

Last updated