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:

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
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

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.

“writes stay single-threaded but multiple agents contribute intelligence”summary, stated
“specifically through code-review loops between separate coding and review agents, "smart friend" architectures pairing smaller fast models with larger expensive ones for selective escalation”summary, stated

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.

“multi-agent systems work best when writes stay single-threaded and additional agents contribute intelligence rather than actions.”summary, stated
“A fundamental principle underlying Cognition's approach is what they call "context engineering" rather than "prompt engineering."”summary, stated

Models used: Devin · Devin Review · Windsurf · frontier coding models · smaller fast models

Scale

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.

“actions carry implicit decisions about style, code patterns, and edge case handling that can conflict when multiple agents write in parallel.”summary, stated

Share full implementation context with reviewers

Rejected because: Clean-context reviewers can reason backward from implementation and avoid context rot or spec bias.

“the coding and review agents intentionally do not share context beforehand.”summary, stated

Patterns

context-engineering (context)

Cognition treats context selection and sharing as the core design discipline for multi-agent coding systems.

“Their guiding principles for multi-agent context engineering include: sharing as much context as possible between agents”summary, stated

eval-driven-development (quality)

Devin Review independently reviews Devin's code and often loops through multiple review cycles.

“The system often loops through multiple code-review cycles, finding new bugs each iteration.”summary, stated

model-routing (architecture)

Smart-friend architectures route between smaller fast models and larger expensive models.

“"smart friend" architectures pairing smaller fast models with larger expensive ones for selective escalation”summary, stated

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.

“This second principle led to their key architectural insight: multi-agent systems work best when writes stay single-threaded”summary, stated

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.

“It's forced to reason backward from the implementation without the spec, allowing it to openly question things the original agent might have overlooked”summary, stated

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.

“writes stay single-threaded and additional agents contribute intelligence rather than actions.”summary, stated

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.

“The review agent having completely clean context enables it to go deeper into areas the original coding agent may not have fully explored.”summary, stated

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

“Devin Review catching an average of 2 bugs per PR with 58% being severe issues”summary, stated

Outcomes

The case reports about 8x Devin usage growth over six months and production multi-agent deployments.

“The company now operates multiple multi-agent architectures in production serving enterprise customers”summary, stated