Multi-Agent System Patterns

Explore runnable templates for orchestrating multiple agents with the GL AIP.

circle-check

Use these examples to compare architectures (sequential, parallel, router, hierarchical, aggregator) and understand when to apply each one.

Prerequisites

  • Python 3.10+

  • This repository cloned locally:

    git clone git@github.com:GDP-ADMIN/glaip-sdk.git
  • Environment variables defined in .env (see .env.example):

    AIP_API_KEY=your-api-key-here
    AIP_API_URL=https://your-platform.com/api

Getting Started

From glaip-sdk/python/glaip-sdk:

poetry install
cp .env.example .env  # then edit with your credentials

Run any pattern example with Poetry, for example the sequential workflow:

Example Structure

1

Overview of when the pattern works best

A short description of the pattern and the scenarios it fits.

2

Demo scenario you can run immediately

A runnable script or example input that demonstrates the pattern.

3

Diagram showing agent relationships

A diagram (or link to a diagram) illustrating how agents interact.

4

Implementation steps with code snippets

Step-by-step instructions and example code for implementing the pattern.

5

Run commands and required environment variables

Commands to run the demo and the environment variables needed (e.g., API keys).

6

Sample output for validation

Expected output examples to verify the pattern is running correctly.

7

Additional considerations, caveats, and links to deeper docs.

Pattern Library

Pattern
When to use
Example directory

Combine specialist insights into one briefing.

examples/multi-agent-system-patterns/aggregator/

Delegate tasks through supervisors for complex workflows.

examples/multi-agent-system-patterns/hierarchical/

Execute independent tasks simultaneously or compare variants.

examples/multi-agent-system-patterns/parallel/

Direct each request to the right specialist.

examples/multi-agent-system-patterns/router/

Refine answers step-by-step with predictable stages.

examples/multi-agent-system-patterns/sequential/

Looking for iterative loops? Explore examples/multi-agent-system-patterns/loop/ for an experimental variant.

Last updated