DEV Community

Valentin Backofen
Valentin Backofen

Posted on Edited on Originally published at vevmesteren.com

The Delegation Flow: Three Profiles, One Pipeline

The Delegation Flow: Three Profiles, One Pipeline

I run three AI agent profiles in a pipeline. They don't share state, don't share memory, don't run on the same model. They communicate through structured handoffs. JSON files in a shared inbox.

Here's how it works:

graph TB
    subgraph P1["Orchestrator"]
        O["Frames work<br/>Writes spec<br/>Own model, own cron"]
    end
    subgraph P2["Research Profile"]
        R["Investigates<br/>Synthesizes<br/>Own model, own cron"]
    end
    subgraph P3["Build Agent"]
        B["Ships code<br/>Tests, deploys<br/>Own model, own cron"]
    end

    Inbox[("Shared Inbox<br/>JSON handoffs")]

    O -->|spec| Inbox
    Inbox -->|spec| R
    R -->|findings| Inbox
    Inbox -->|findings| B
    B -->|completion| Inbox
    Inbox -->|completion| O

    O -.->|no shared state| R
    R -.->|no shared state| B

The Three Profiles

The orchestrator takes a vague human intent and turns it into a spec. What's the problem? What does good look like? What's the scope? The spec is a JSON file. It's the handoff contract.

The research profile investigates. It gets the spec, not the conversation that produced it. It doesn't know what the orchestrator was thinking. It researches from multiple angles, each sealed off, then synthesizes and hands back.

The build agent ships. It gets the research findings, not the research process. It builds from the output, not the reasoning. Ships code, writes tests, deploys.

Three profiles. Three models. Three sets of skills. Zero shared state.

The Handoff Schema

{
  "id": "task-042",
  "type": "research",
  "question": "Should we adopt a queue-based architecture?",
  "scope": "architecture decision, not implementation",
  "deadline": "2026-11-20"
}
Enter fullscreen mode Exit fullscreen mode

The research profile reads it, investigates, and hands back:

{
  "id": "task-042",
  "status": "complete",
  "findings": "Queue-based architecture reduces coupling...",
  "confidence": "proven-in-test",
  "gaps": ["did not benchmark under load"]
}
Enter fullscreen mode Exit fullscreen mode

No agent ever sees another agent's context window. No agent inherits another's reasoning. The JSON is the only bridge.

Why Not One Agent

Anthropic ran 30 coding agents on the same task. Eighteen independently created a git branch with the exact same name. Same model, same fine-tuning, same reach for the same pattern.

If 18 of 30 converge on a branch name, how many converge on the same architecture? The same test strategy? The same misreading of a requirement?

The fix is structural. The agent that designs is never the agent that reviews. Different session, different context, often a different model family. The reviewer sees the output cold.

The Latency Is Load-Bearing

Each handoff is a serialization cycle. Five minutes between steps. If you come from microservices, that sounds insane.

But the latency forces intentionality. You don't pass context casually when it costs you a cycle. You write down what matters and skip what doesn't. The five-minute poll is the budget. Everything that survives it is worth the cost. Everything that doesn't wasn't.

What Doesn't Work

Three honest gaps:

Handoffs are lossy. A JSON file drops nuance. The spec said "architecture decision, not implementation." The build agent built anyway. That's a boundary violation caught in review. The spec needed to be more explicit about what "not implementation" means.

Failure cascades silently. When the research profile goes down, the build agent sits idle. The orchestrator doesn't know. The handoff just doesn't arrive. The fix: a heartbeat. Each profile pings a status endpoint every minute. If it stops, the orchestrator escalates.

The schema is too loose. A field that says "findings" can contain anything. A stricter schema with typed fields and validation would have caught the misinterpretation before it reached the build agent. The boundary should be enforced at the code level, not the convention level.

What I'll Build Next

The heartbeat before the first handoff. I lost two hours to a silent failure because nobody was watching. The boundary that makes the system strong (no shared state) is the same boundary that makes failures invisible. You need a channel that carries only presence, not content.

A stricter handoff schema. Validation at the boundary. Reject handoffs that don't conform. The spec should be a contract, not a suggestion.

The boundaries matter more than the agents. A well-bounded agent with a narrow job outperforms a generalist that tries to do everything. Structured handoffs are more reliable than any API call, because they force every interaction to be intentional.

Three profiles. Three models. Zero shared state. That's the delegation flow.

Top comments (0)