scatter
scatter is a three-phase map-reduce pattern: the map phase decides what to process in parallel, workers handle each item concurrently, and the reduce step synthesizes the results.
When to use it
Section titled “When to use it”- Research across multiple sources or angles simultaneously
- Batch processing where item count is determined at runtime
- Tasks that can be decomposed into independent parallel subtasks
AGENT.md
Section titled “AGENT.md”---name: deep-researchdescription: Researches a topic from multiple angles in parallel.version: "1.0.0"pattern: scatterworker: research-anglecall: model: role: thinker uses: - search-web---
You are a research coordinator. Given a topic:1. Identify 3-5 distinct research angles (e.g., technical, economic, historical, social)2. Call finish with key="parallel" and value as a JSON array of strings, one per angle
Example:finish(key="parallel", value='["technical feasibility", "economic impact", "regulatory landscape"]')reduce.md
Section titled “reduce.md”---call: model: role: thinker---
You have received research from multiple parallel workers covering different angles.Synthesize all findings into a comprehensive, well-structured report.
Integrate the perspectives, resolve any contradictions, and present unified conclusions.Call finish with key="done" and the full synthesized report.Required files
Section titled “Required files”reduce.md— system prompt for the reduce step
Scaffold
Section titled “Scaffold”tama add scatter my-agentHow it works
Section titled “How it works”Phase 1 — Map (react atom, AGENT.md body): start() → topic agent reasons about what to fan out finish(key="parallel", value='["angle-1", "angle-2", "angle-3"]')
Phase 2 — Parallel workers: worker agent runs 3 times, each with a different angle as input all workers run concurrently
Phase 3 — Reduce (react atom, reduce.md): start() → JSON map of { "angle-1": "...", "angle-2": "...", ... } synthesize results finish(key="done", value=<synthesis>)The parallel key
Section titled “The parallel key”The map phase controls whether fan-out happens:
finish(key="parallel", value='[...]')→ fan out, spawn one worker per itemfinish(key=anything_else, value=...)→ skip fan-out, return the value directly
This lets the map agent decide dynamically: if the input doesn’t need parallel processing, it can return a direct answer.
Worker agent
Section titled “Worker agent”The worker: field names the agent used for each parallel item. It’s a full agent — any pattern, any skills:
# agents/research-angle/AGENT.md---name: research-angledescription: Researches a single angle of a topic.version: "1.0.0"pattern: reactcall: model: role: thinker uses: - search-web---
Research the assigned angle thoroughly. Use search-web to find relevant sources.Provide a comprehensive summary with key findings and sources.Call finish with key="done" and your research summary.Example project structure
Section titled “Example project structure”agents/ deep-research/ AGENT.md ← pattern: scatter, worker: research-angle reduce.md ← synthesis prompt research-angle/ AGENT.md ← pattern: react, uses: [search-web]