Content Pipeline
A simple 3-agent pipeline for researching, writing, and reviewing content with detailed explanations
Content Pipeline
This is the simplest practical topology — three agents that research a topic, write a draft, and review it. It is a great starting point for understanding how AgenTopology works.
The Complete Topology
topology content-pipeline : [pipeline] {
meta {
version: "1.0.0"
description: "Research, write, and review content"
}
orchestrator {
model: sonnet
handles: [intake, done]
}
agent researcher {
role: researcher
model: sonnet
phase: 1
tools: [Read, Grep, Glob, WebSearch]
writes: ["workspace/research.md"]
prompt {
"You are a thorough researcher. Given a topic, search the web and
local files to gather comprehensive background information. Write
your findings to workspace/research.md with clear sections and
source citations."
}
}
agent writer {
role: writer
model: sonnet
phase: 2
tools: [Read, Write, Glob]
reads: ["workspace/research.md"]
writes: ["workspace/draft.md"]
outputs: { confidence: high | medium | low }
prompt {
"You are a skilled writer. Read the research document and produce
a well-structured draft. Match the tone and style to the target
audience. Report your confidence level in the output."
}
}
agent reviewer {
role: reviewer
model: opus
phase: 3
tools: [Read, Grep, Glob]
reads: ["workspace/draft.md", "workspace/research.md"]
outputs: { verdict: approve | revise | reject }
prompt {
"You are a critical reviewer. Compare the draft against the research.
Check for accuracy, clarity, and completeness. Provide specific
feedback and a verdict."
}
}
flow {
intake -> researcher
researcher -> writer
writer -> reviewer
reviewer -> writer [when reviewer.verdict == revise, max 2]
reviewer -> researcher [when reviewer.verdict == reject, max 1]
reviewer -> done [when reviewer.verdict == approve]
}
}Walkthrough
Topology Declaration
topology content-pipeline : [pipeline] {The name content-pipeline identifies this topology across all CLI commands. The single pattern [pipeline] tells AgenTopology this is a sequential workflow.
Orchestrator
orchestrator {
model: sonnet
handles: [intake, done]
}The orchestrator is the entry and exit point. It receives the initial request at intake (for example, "write an article about distributed systems") and collects the final result at done.
The handles list defines the orchestrator's responsibilities. Every flow must start at an intake point and end at a completion point that the orchestrator handles.
Agent: Researcher (Phase 1)
agent researcher {
role: researcher
model: sonnet
phase: 1
tools: [Read, Grep, Glob, WebSearch]
writes: ["workspace/research.md"]
}The researcher runs first. Key properties:
| Property | Value | Purpose |
|---|---|---|
role | researcher | Semantic label for the agent's function |
model | sonnet | Balanced model for research tasks |
phase | 1 | Runs first in the pipeline |
tools | Read, Grep, Glob, WebSearch | File reading and web search capabilities |
writes | workspace/research.md | Declares the file this agent produces |
The writes property is important — it tells downstream agents and the validator exactly what files this agent creates. The writer knows to look for workspace/research.md because the researcher declares it here.
Agent: Writer (Phase 2)
agent writer {
role: writer
model: sonnet
phase: 2
tools: [Read, Write, Glob]
reads: ["workspace/research.md"]
writes: ["workspace/draft.md"]
outputs: { confidence: high | medium | low }
}The writer reads the researcher's output and produces a draft. The outputs block declares structured data that the writer must produce alongside its file output. The confidence value can be used in flow conditions if needed.
Agent: Reviewer (Phase 3)
agent reviewer {
role: reviewer
model: opus
phase: 3
tools: [Read, Grep, Glob]
reads: ["workspace/draft.md", "workspace/research.md"]
outputs: { verdict: approve | revise | reject }
}The reviewer uses opus — the most capable model — because critical evaluation requires the strongest reasoning. It reads both the draft and the original research to check accuracy.
The verdict output drives the flow logic:
- approve — the draft is good, send to
done - revise — the draft needs work, send back to the writer
- reject — the research was insufficient, send back to the researcher
Flow: Linear Path with Feedback Loops
flow {
intake -> researcher
researcher -> writer
writer -> reviewer
reviewer -> writer [when reviewer.verdict == revise, max 2]
reviewer -> researcher [when reviewer.verdict == reject, max 1]
reviewer -> done [when reviewer.verdict == approve]
}The happy path is linear: intake -> researcher -> writer -> reviewer -> done.
Two feedback loops handle quality issues:
Revision loop (reviewer -> writer): If the reviewer says revise, the writer gets another chance to improve the draft. The max 2 modifier means the writer gets at most 2 revision attempts. After 2 failed revisions, the flow falls through to the next matching edge.
Rejection loop (reviewer -> researcher): If the reviewer says reject, the researcher starts over with improved research. The max 1 modifier allows only one re-research cycle to prevent infinite loops.
Flow Diagram
intake -> researcher -> writer -> reviewer -> done
^ ^ |
| |__________| (revise, max 2)
|_______________________| (reject, max 1)Prompt Blocks
Each agent includes a prompt block with specific instructions:
agent researcher {
prompt {
"You are a thorough researcher. Given a topic, search the web and
local files to gather comprehensive background information."
}
}Prompts define the agent's behavior in natural language. They are included in the system prompt when the topology is scaffolded to a platform. Keep prompts focused on the agent's specific role — the topology handles coordination.
Adapting This Example
- Add a human gate — require approval after the reviewer before publishing
- Add an editor agent — insert a phase between writer and reviewer for style editing
- Fan-out the research — split into a
web-researcherand alocal-researcherrunning in parallel - Add metering — set a budget to control costs for web search API calls
- Add triggers — define a command like
/write <TOPIC>to kick off the pipeline