Sequential Pipeline
A multi-agent pipeline that chains two sub-agents: a researcher and a writer.
schema_version: "1.0.0"
metadata:
id: "research-pipeline"
name: "Research Pipeline"
version: "1.0.0"
description: "A sequential multi-agent pipeline"
interface:
input:
type: object
properties:
query:
type: string
required: [query]
output:
type: object
properties:
result:
type: string
required: [result]
execution_policy:
id: agf.sequential
config:
steps:
- agent: researcher
input_mapping:
query: "parent.input.query"
- agent: writer
input_mapping:
research: "researcher.output.result"
query: "parent.input.query"
output_from: "last"
action_space:
local_agents:
- alias: researcher
source: "./agents/researcher.agf.yaml"
description: "Researches the topic"
- alias: writer
source: "./agents/writer.agf.yaml"
description: "Writes the final response"
Key Concepts
Sequential Policy
The agf.sequential policy runs sub-agents in order. Each step completes before the next begins.
execution_policy:
id: agf.sequential
config:
steps:
- agent: researcher
input_mapping:
query: "parent.input.query"
- agent: writer
input_mapping:
research: "researcher.output.result"
query: "parent.input.query"
output_from: "last"
| Field | Description |
|---|---|
steps[].agent | Alias of the sub-agent (must match a local_agents entry) |
steps[].input_mapping | Maps data from parent input or previous agent outputs |
output_from | Which step's output becomes the pipeline output ("last" or a step alias) |
Input Mapping Expressions
Input mappings use dot-notation paths:
| Expression | Meaning |
|---|---|
parent.input.query | The pipeline's own input field query |
researcher.output.result | The result field from the researcher's output |
This lets you wire data between agents without code.
Local Agents
action_space:
local_agents:
- alias: researcher
source: "./agents/researcher.agf.yaml"
description: "Researches the topic"
Each sub-agent is defined in its own .agf.yaml file and referenced by relative path. The agf graph command visualizes these relationships:
info
The agf CLI will be publicly available soon. See the CLI Reference for the command reference. You can validate this example now using the Playground.
agf graph research-pipeline.agf.yaml
# research-pipeline
# ├── researcher (./agents/researcher.agf.yaml)
# └── writer (./agents/writer.agf.yaml)
Other Orchestration Policies
Agent Format supports several orchestration patterns beyond sequential:
| Policy | Description |
|---|---|
agf.sequential | Run steps in order |
agf.parallel | Run branches concurrently, merge results |
agf.loop | Repeat until a condition is met |
agf.batch | Apply the same agent to each item in a list |
agf.conditional | Route to different agents based on conditions |