Sequential
A linear workflow where each agent processes the output from the previous agent, ideal for intent refinement, multi-step validation, or staged content creation.
Overview
Sequential compositions shine when work must pass through clearly defined stages. Each agent can tighten the scope, enrich the data, or validate the previous step before passing the baton.
Demo Scenario: Refine Then Answer
Two lightweight agents collaborate on a user question:
Intent refiner – rewrites the user's short prompt into a clear question
Answerer – provides the final response using the refined question
Diagram
Implementation Steps
Create two agents
Run the agents sequentially
Clean up the demo agents
How to Run
From glaip-sdk/python/glaip-sdk:
Set the usual environment variables in .env:
Output
Notes
Extend the pipeline with additional stages (validation, formatting) by adding new agents and invoking them in order.
Persist intermediate outputs when debugging by saving run transcripts.
Combine with the router pattern so only certain requests enter the sequential flow.
Related Documentation
Agents guide — Configure instructions and streaming renderers.
Automation & scripting — Capture transcripts inside CI pipelines.
Security & privacy — Apply memory and PII policies between stages.
Last updated