Multi-Agent Systems in Production: Code Generation and Review at Scale
cognition · Tech · 2026 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)
Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.
Problem
Domain: AI software engineering
Cognition needed to scale AI-assisted software engineering while preserving coherence, controlling costs, and improving code quality across production coding assistants.
Constraints:
- Parallel writing agents can conflict through implicit code and style decisions.
- Large frontier models raise cost pressure.
- Review agents need fresh context to avoid the same attention failures as coding agents.
- Long-running tasks can span multiple pull requests and require delegation.
Architecture
Cognition uses multiple production multi-agent architectures: clean-context code-review loops, smart-friend escalation from smaller to larger models, and hierarchical delegation for week-long tasks, while keeping writes single-threaded so additional agents contribute intelligence instead of conflicting actions.
Diagram confidence: reconstructed (reconstructed from prose).
flowchart LR coding-agent["Coding Agent"] review-agent["Review Agent"] smart-friend-router["Smart Friend Router"] manager-agent["Manager Agent"] child-agents["Child Agents"] frontier-model["Frontier Model"] coding-agent --> review-agent coding-agent --> manager-agent review-agent --> coding-agent smart-friend-router --> coding-agent smart-friend-router --> frontier-model manager-agent --> child-agents manager-agent --> coding-agent child-agents --> manager-agent
Components
| Component | Role | Interacts with |
|---|---|---|
Coding Agent |
Implements code changes and produces pull-request work. | Review Agent, Manager Agent |
Review Agent |
Reviews code with clean context to catch bugs, edge cases, and security issues. | Coding Agent |
Smart Friend Router |
Pairs smaller fast models with larger expensive models for selective escalation. | Coding Agent, Frontier Model |
Manager Agent |
Coordinates child agents on larger, multi-PR tasks. | Child Agents, Coding Agent |
Child Agents |
Carry out delegated subtasks under a manager agent. | Manager Agent |
Data flow
A coding agent writes the change, a separate review agent inspects it with clean context, small models can escalate hard cases to larger models, and manager agents coordinate child agents for larger tasks while maintaining single-threaded writes.
Why this architecture
Cognition concluded multi-agent systems work best when extra agents add review, routing, or delegation intelligence while preserving one writer at a time. The approach also expresses their broader context-engineering principle.
Models used: Devin · Devin Review · Windsurf · frontier coding models · smaller fast models
Scale
- Devin usage grew about 8x over six months among conservative enterprise customers.“Cognition reports an approximately 8x explosion in Devin usage over the last 6 months even among their most conservative enterprise segment.”summary, stated
- Devin Review catches about two bugs per Devin-authored PR.“Devin Review catches an average of 2 bugs per PR written by Devin, with approximately 58% classified as severe”summary, stated
- Hierarchical systems handle week-long tasks spanning multiple pull requests.“live deployment of hierarchical multi-agent systems handling week-long tasks spanning multiple PRs”summary, stated
Alternatives considered (roads not taken)
Parallel writing agents
Rejected because: Multiple agents writing simultaneously can make conflicting implicit decisions about code style, patterns, and edge cases.
Share full implementation context with reviewers
Rejected because: Clean-context reviewers can reason backward from implementation and avoid context rot or spec bias.
Patterns
context-engineering (context)
Cognition treats context selection and sharing as the core design discipline for multi-agent coding systems.
eval-driven-development (quality)
Devin Review independently reviews Devin's code and often loops through multiple review cycles.
model-routing (architecture)
Smart-friend architectures route between smaller fast models and larger expensive models.
Tradeoffs
Single-thread writes
Chose One writer at a time with additional agents reviewing or advising over Multiple agents writing in parallel.
Rationale: This preserves code coherence while still adding multi-agent intelligence.
Clean-context review
Chose Reviewer agents that have not seen the writer's prior context over Reviewer agents primed with the same task context.
Rationale: Clean context helps reviewers challenge assumptions and inspect unexplored areas.
Gotchas (what bit them)
Multi-agent writing can corrupt coherence.
Root cause: Actions encode implicit decisions, so parallel writers can conflict.
Resolution: Keep writes single-threaded and let other agents contribute review or intelligence.
Review quality depends on avoiding context rot.
Root cause: Long or shared context can make models less attentive and more biased toward the original implementation.
Resolution: Use clean-context review agents that independently reason about the code.
Evaluation
The strongest reported evidence is Devin Review bug-finding on Devin-authored PRs, with severity classification.
Metrics: average bugs per PR · severe issue share · usage growth
Outcomes
- Cognition deployed code-review loops, smart-friend routing, and hierarchical multi-agent systems in production.
- Devin Review catches an average of two bugs per PR, with 58% severe.
- Hierarchical agents can handle week-long tasks spanning multiple PRs.
The case reports about 8x Devin usage growth over six months and production multi-agent deployments.