Parallel
A concurrent workflow where multiple agents process the same input simultaneously, ideal for comparative analysis, multi-model testing, or distributed checks.
Multiple agents tackle independent subtasks simultaneously to reduce overall latency.
Overview
Use this pattern when subtasks do not depend on each other and you want faster responses by running them side by side. The outputs can be displayed separately or merged downstream.
Demo Scenario: Trip Planning with Specialized Agents
Two travel specialists work in parallel on the same user request:
Logistics agent โ focuses on flights, hotels, and transportation
Activities agent โ curates attractions, food, and experiences
The demo runs both agents at the same time and then prints a combined plan.
Diagram
Implementation Steps
Create two focused agents
Run both agents simultaneously and collect their outputs
Clean up demo agents
How to Run
From the repository root glaip-sdk/python/glaip-sdk:
Ensure your .env contains:
Output
Notes
Use additional workers in the thread pool (or asyncio) to scale outward for more specialists.
Combine this pattern with an aggregator if you want a single unified artifact.
For long-running tasks, monitor usage stats returned by each agent run to detect bottlenecks.
Related Documentation
Agents guide โ Configure instructions and streaming renderers.
Automation & scripting โ Capture transcripts or usage metrics in CI workflows.
Security & privacy โ Apply tool-output and memory policies when sharing results downstream.
Last updated