DANYLO PRAVDA
ALL NOTES

Agent ops & production — 2026-06-18PUBLIC

Multi-agent orchestration in production: orchestration patterns, memory architecture, evaluation, and observability

How production multi-agent systems actually survive: orchestration patterns (Orchestrator, Hierarchical, Swarm), three-tier memory that lives on disk, schema-validated handoff contracts, tiered model routing, four-pillar evaluation, OpenTelemetry observability, and security hardening — drawn from practitioners shipping agents at scale.

21 min read

Multi-agent orchestration in production: orchestration patterns, memory architecture, evaluation, and observability

A student pushed a Gemini API key into a private GitHub repository and woke up to a $55,444.78 Google Cloud bill. Elsewhere, an OpenAI key got abused nearly a million times before anyone noticed. Neither was a model failure. The model worked fine. The wiring around it didn't — and that gap, between a model that reasons beautifully in a demo and a system that survives a week of real traffic, is where almost every multi-agent project dies.

The pitch is easy to fall for: a team of tireless specialists collaborating around the clock while you sleep. The reality is agents that hallucinate in isolation, memory that evaporates between sessions, handoffs that silently corrupt data, and "smart" frontier models burning tokens on work a cheap model could do. The practitioners quoted throughout this note — @AiCamila_'s telemetry and evaluation work, @AndrewYNg's eval discipline, @johniosifov's handoff contracts, @Asteri_eth's Obsidian pipeline, @RoundtableSpace's agent teams, @arena's live-session measurement, @ArtificialAnlys's infrastructure benchmarks — don't agree on everything. But they converge on one thing: the agents that survive in production are the ones wrapped in tight feedback loops between observation, evaluation, and human escalation. Orchestration is a systems-engineering problem, not a prompting problem. This note walks the layers that close the gap — patterns, memory, handoffs, cost routing, evaluation, observability, security, and deployment — and ends with a concrete plan you can run.

CONTENTS

CH.01

Why do most multi-agent systems collapse the moment they leave the demo?

The demo is a lie. It runs on a curated input, a fresh context window, and a human hovering over the keyboard. Production has none of those, and the thing that breaks is never the part you rehearsed.

@NeoOpenGPU names it bluntly:

Most AI agents fail at the boring part. Not the model. The reasoning. The plumbing. Auth tokens expiring mid-run. Webhooks that drop.

The framework choice is part of the trap. @DeRonin_ warns: "Avoid AutoGen/AG2: moved to community maintenance, releases stalled. CrewAI: demos well, breaks in production." What survives contact with real workloads isn't a library — it's the compounding skills of context engineering, tool design, orchestration, and eval discipline. Strip those away and the failure modes are predictable:

  • Agents without shared state drift apart and contradict each other.
  • Agents without bounded inputs spawn ~20K tokens of overhead confirming what the parent already knew.
  • Agents without a separate verifier grade their own output and rationalize what they already did instead of catching the failure.
  • Agents without exit conditions burn tokens until the budget is gone.

@AndrewYNg's diagnosis cuts deeper: the single biggest predictor of execution quality is a disciplined process for evals and error analysis. Without it you optimize blind — you swap a model, tweak a prompt, add a tool, and have no idea which change moved the needle because you never set a baseline. @johniosifov adds the structural version: teams that build narrow skills (one job, one bounded input, one structured output) ship; teams that build general agents (smart, capable, no domain shape) watch them re-confirm what the parent session already knew, burn twenty thousand tokens of spawn overhead, and hallucinate tool calls the instant context exceeds a single window. His warning for multi-agent specifically: "multi-agent failures are invisible until they cascade" — Agent A produces plausible-but-wrong output, Agent B takes it as ground truth, and nobody sees it until the damage is downstream.

CH.02

From better prompts to better loops — what actually changed?

The shift that separates frontier practitioners from everyone else is they stopped typing prompts and started designing loops. Output becomes input, the model checks its own work, and the cycle runs until a verification condition is met.

@0xCodez puts it as a literal architectural change: "I don't prompt Claude anymore. I write loops — and the loops do the work." The loop runs until the result is right. That is a different discipline from prompt-crafting, and it rests on the four design patterns @AndrewYNg named — necessary scaffolding, not sufficient on their own:

  1. Reflection — the agent examines its own output for errors before finalizing.
  2. Tool Use — the agent decides which external functions to call.
  3. Planning — a high-level goal is decomposed into sub-tasks.
  4. Multi-agent collaboration — specialized agents with distinct roles and memory ask each other for help.

These give you the vocabulary. The rest of this note is the engineering that makes them hold up.

CH.03

Which orchestration pattern fits your problem?

The pattern matters less than the coordination medium underneath it. @AiCamila_ maps three canonical shapes, and all three live or die on whether agents read and write to shared, persistent state.

Pattern How it works Real implementation Where it breaks
Orchestrator (central brain) One agent routes tasks to specialized sub-agents; maps directly to Ng's Planning @Asteri_eth's Obsidian "AI Employee" — raw thoughts get categorized, a PM agent spawns dev/research/content sub-agents least to debug; the recommended starting point
Hierarchical (supervisor-worker) Supervisors manage workers under strict permission boundaries @MyWestLord's 42-agent sales department: a Chief Sales Officer delegates to managers, with agents for outreach (email/voice/SMS in 8 languages), RevOps (HubSpot + data warehouse), and research (lead scoring) governance collapses without delegation capture (see below)
Swarm (peer-to-peer) Agents collaborate as peers with shared memory @RoundtableSpace's Agent Teams in Claude Code (v2.1.32+): a team lead creates QA / frontend / backend roles that message each other directly peers drift into contradiction without enough shared context

The Swarm example is the vivid one: the QA agent found three bugs, sent feedback directly to the developer agents — not a report to a human — they fixed the issues, and the app shipped in a single pass. The /simplify command extends the idea: three agents review code in parallel for architecture issues and duplicates, multiple perspectives without central coordination.

Hierarchy carries the sharpest governance risk, and @AtsuyaYamakawa names it: if a service account executes an API call, the system must capture who the agent is representing, so audit trails reflect the human actor. Without that, "access control and governance collapse" — tickets appear with no owner, logs show the agent acted but not on whose behalf.

The non-obvious point, from @0xTria's Loop Engineering framework: state must live on disk, not in context. "The model forgets everything between runs, so an MD file or a knowledge graph holds what is done and what is still open." Orchestrator, Hierarchy, or Swarm — the .pipeline folder, the Obsidian note, the Markdown state file is the actual nervous system. Pick the pattern for your topology; the persistent state file is what makes any of them work.

CH.04

How do you stop agents from becoming expensive amnesiacs?

Memory is where most systems quietly fail, and the fix is architectural: a three-tier structure where the durable state lives on disk, not in a context window that evaporates at session end. @AiCamila_'s layout shows up again and again in well-built systems.

Tier Holds Backed by
Short-term (STM) the current conversation + recent tool results the live context window
Long-term (LTM) facts, episodic history, procedural knowledge vector DBs (Pinecone/Weaviate) + knowledge graphs (Neo4j/Graphify)
Hybrid router queries LTM first for facts, then STM for current context; a summarization layer moves important STM into LTM to control length the orchestrator's canonical on-disk state

@Asteri_eth's pipeline is the clean illustration: raw thoughts land in one Obsidian note, an automation layer categorizes them, and if a project is identified, a research agent pulls reference material before a project manager agent ever spawns sub-agents. The human reviews and edits the plan before approval triggers execution. @bonsaixbt pushes this further by mapping every conversation, file, asset, and research snippet into a connected knowledge graph with Graphify + Obsidian; the reported result was token usage dropping roughly 70x because the system stopped re-explaining context it had already established. (Creator-reported, not benchmarked — but the mechanism is sound: don't pay to re-establish what's already on disk.)

There's a subtler failure that shared memory introduces. @0xLogicrw, drawing on the DecentMem research, surfaces decision convergence: when all agents share one global memory, they converge on the same decisions and you lose the diversity that made multi-agent worth doing. The defense is private memory per agent.

For production, the memory layer must support four things: persistence across sessions, structured retrieval (not just semantic similarity), attribution (which agent wrote what, when), and garbage collection (old, irrelevant context must decay). Vector databases handle semantic recall; graph databases handle relational structure; and plain Markdown files with strict naming conventions — as @igorfomich demonstrates — can be surprisingly effective for agent consumption when metadata is embedded in the filenames.

CH.05

What makes a handoff between agents actually reliable?

This is the question nobody answers well, and it's what kills systems in production. The answer is the schema-validated handoff contract — the explicit agreement that defines what Agent A must produce for Agent B to consume. Four mechanisms, synthesized across the corpus.

1. Bounded inputs, structured outputs. @Mnilax's "Barry vs. Mahesh" distinction is the key. Every sub-agent should be a Barry: "one job, one bounded input, one structured output." Every sub-agent that was a Mahesh — "smart, general, no domain shape" — cost ~20K tokens of spawn overhead and returned nothing useful. The contract is the schema that turns a Mahesh into a Barry.

2. File-based handoff with verification. @MyWestLord's Planner→Coder→Tester→Reviewer pipeline makes this concrete: each agent writes to a designated file, and the Reviewer reads them all and checks the diff against the tests before issuing a verdict. The file structure is the contract.

3. Separate the maker from the checker. @0xTria: "A separate checker agent grades the output." Models grading their own work "often justify what they already did rather than catching failures." The checker must be a different agent with a different prompt, and the verification bar must be set before the loop starts.

4. Exit conditions. Loops without stop conditions burn tokens fast. @0xTria: "Exit must be set before the loop starts" — the loop runs until completion, max iterations, or budget exhaustion. @AiCamila_'s self-healing pattern adds the escalation layer: Detect (error logs, failed tool calls), Diagnose (compare against baseline), Remediate (retry, fallback model, reset state), Escalate to a human only when auto-fix fails.

@johniosifov's framework formalizes the whole thing: one agent plans, another executes, a third validates, a supervisor routes; standardized interfaces (MCP or A2A) carry the messages; schema validation between agents enforces format and completeness; auditable orchestration logic logs every decision with agent identity, input, and output; and active human-in-the-loop escalation requires an actual human response, not a theoretical approval gate. The specific failure this prevents is the cascade: Agent A's plausible-but-wrong output becoming Agent B's ground truth, invisible until it's expensive. @arena validates the concern empirically by measuring tool hallucination as a signal distinct from task failure — the agent invents a tool output or misattributes which tool ran, and everything downstream proceeds on a false premise.

For cross-framework coordination, @_avichawla's Agent Communication Protocol (ACP) gives a standardized RESTful interface — an ACP server receives requests from an ACP client and forwards to the agent — so LangChain, CrewAI, and custom agents interoperate without vendor lock-in.

CH.06

How do you match cost to complexity without going broke?

Using a single frontier model for everything is, in @hadesboun101's words, "financially insane." The winning strategy is tiered routing, and the metric that matters is cost per successful task — not cost per token.

Tier Share of work Use for Example models (creator-reported pricing)
Cheap / fast ~80% drafts, formatting, simple coding Haiku, Kimi K2.6 ($0.09), local Ollama
Mid-tier ~15% standard tasks Sonnet, GPT-4o
Frontier ~5% final judgment, deep reasoning, last 10% of QC Opus ($1.41), Fable 5

@Sprytixl runs this live: routine tasks to Kimi K2.6 at $0.09, complex work stays on Opus at $1.41, and context never drops between switches because the orchestrator — not the individual agents — holds canonical state. @Voxyz_ai splits by where visual output justifies the price: keep the main Fable 5 session on planning and frontend, then "write a clear spec and dispatch to Codex (GPT-5.5 xhigh) with /goal" for backend and heavier implementation.

@0xLogicrw's research reinforces the budget logic: "Favor models with lower unit costs to allow for more iterations and attempts within that budget." A cheaper model that gets five attempts often beats one expensive pass. And within a tier, reasoning effort is its own lever — use the standard setting for standard work and reserve the most expensive one for genuinely long-horizon autonomous tasks.

For the build surface, @MiteshJ71069 compares OpenAI's Agent Builder against n8n:

Tool Wins on Use it for
n8n triggers (Gmail, Slack, webhooks, schedulers), 500+ integrations, model flexibility (OpenAI, Anthropic, Claude, local Ollama) production systems that need model-agnostic flexibility
AgentKit (OpenAI Agent Builder) UI speed, ease of use quick demos

CH.07

What do you actually measure — and how?

Most teams measure task success and nothing else, and even that poorly. Real observability means tracing every step and evaluating on four pillars, because a cost spike without a matching success gain is the early signal of model drift or routing failure.

@AiCamila_'s telemetry is explicit: trace every step — user query → agent thought → tool call → LLM call → final answer — using OpenTelemetry with semantic conventions. The span attributes are not optional: tool name, model used, prompt hash. Without them you cannot reconstruct a failure path. Track latency per step, token usage, error rate, and cost per trace.

On top of that telemetry sits the four-pillar evaluation framework:

Pillar The question it asks
Task Success did the agent complete the job? (binary — and most teams stop here)
Tool Usage Quality did it call the right tool with the right parameters, or hallucinate a function signature?
Reasoning Coherence does the chain of thought support the conclusion, or rationalize a wrong answer after the fact?
Cost-Performance cost per successful task — an agent that succeeds first try at $2 is cheaper than one that succeeds on the fifth retry at $0.50/call

The evaluation pipeline runs Golden Dataset → Hybrid Judges (LLM + Human) → Production Readiness (Go/No-Go). Start small with a golden dataset and an LLM-as-Judge, then add human review for critical tasks — non-negotiable, because the LLM judge fails predictably wherever the model can't tell correct reasoning from a confident-sounding error.

@arena adds the causal layer that tells you whether your metrics mean what you think. Across millions of live sessions, they track five signals — task success, steerability, error recovery, user praise vs. complaint, and tool hallucination — and the headline metric is net model improvement: how much a specific model improves outcomes relative to the average model, not the absolute score (which drifts upward across all models as the task mix changes, masking stagnation). Their data shows a real trade-off worth internalizing: Claude Fable 5 leads on confirmed task success rate and praise-vs-complaint by the widest margin ever recorded over Opus-4.8 and GPT-5.5, but exhibits weaker steerability. If your workflow needs to redirect an agent mid-task when it misreads intent, low steerability is a production blocker no matter how good the autonomous-run numbers look.

The infrastructure dimension most teams underweight comes from @ArtificialAnlys's AA-AgentPerf benchmark, whose lead metric is Agents per Megawatt — simultaneous agents supported at fixed performance targets (20 tokens/s per user, ≤10s TTFT) per megawatt consumed.

Architecture Agents per MW
GB300 rack-scale disaggregated inference 61,354
B300 single-node disaggregated 21,053

Rack-scale disaggregated inference is roughly 3× more power-efficient than single-node Blackwell — which determines whether your fleet scales linearly with infrastructure spend or hits a cost wall. One methodological note from the same source: they removed IFBench from Intelligence Index v4.1 because it no longer distinguished frontier models. Saturated benchmarks are dangerous — they make every model look good and hide the real differences.

CH.08

How do you secure an agent that can write and run code?

Security for an agentic system is not access control on a static API — it's containment of an autonomous process that writes code, calls services, and decides at machine speed. The blast radius of a compromise is whatever you let one agent touch.

That $55,444.78 bill from the opening is the lesson made concrete. @AiCamila_'s defense-in-depth stack, with the specific tools:

  • Sandbox tool execution — run every agent in its own Docker container (@0xKnzo), so a prompt-injection attack leaks one container's scope, not the host.
  • Validate and sanitize all outputs before acting on them.
  • Data loss prevention for sensitive data.
  • Runtime policy enforcement with OPA, Kyverno, or a custom engine.
  • Least-privilege, combined with output validation and monitoring, with adversarial red-team tests run monthly, not annually.

@BratDotAI draws the hard line: an AI coding agent should never perform production deploys, database changes, or billing changes without explicit human approval. The most reliable version is runtime platforming — instead of asking the model to enforce its own security (a fox guarding a henhouse), deploy the agent inside a managed platform that provides SSO for identity, role-based access control for permissions, and audit logs the agent cannot modify. The refund only goes through if the person who clicked has the right role. Security is decoupled from the AI's internal logic and enforced by the execution environment.

The synthesis: sandbox at the container level, enforce least-privilege at the tool level, validate at the output level, govern at the platform level — and never let an agent touch production data, deploys, or billing without a human gate.

CH.09

When should a human step in?

The hardest operational question isn't when to automate — it's when to stop. Escalation is the last resort, not the first: automated remediation handles the boring, repetitive failures, and humans handle the judgment calls.

@AiCamila_'s self-healing loop operationalizes it — Detect (error logs, failed tool calls, quality drops), Diagnose (compare against baseline, analyze recent changes), Remediate (retry with different parameters, fall back to a cheaper or different model, reset state, or auto-fix), Escalate only when auto-fix fails. A concrete instance of the remediate step, from @0xLogicrw: route the bulk of traffic to a cheaper primary model (DeepSeek v4) and automatically call Claude Opus when the primary fails at complex tasks. That's not just cost optimization — it's a reliability pattern, with the cheap model handling the long tail and the expensive one catching the edge cases that matter. @0xTria's self-repairing harness adds the regression lock: "A failing trace gets diagnosed, the fix is verified against the exact input that failed, and the failure is locked as a regression test so it cannot recur."

The decision rule is clean: automate remediation for failures with objective verification criteria (stale version strings, missing tests, known error codes); escalate to humans for failures that require judgment (ambiguous intent, ethical boundaries, financial decisions). And always log the escalation path so you can trace why a human was brought in — and whether the automation should have caught it earlier.

@johniosifov's operational warning is the one that has destroyed real systems: "active human-in-the-loop escalation" must mean checkpoints that require an actual human response — not a theoretical approval gate that gets bypassed at 2 AM when everyone's asleep. The agent must be able to pause, notify, and wait with enough context for the human to decide without reconstructing the entire reasoning chain — not just log a warning and proceed. His Agentic Capability Stack frames how much autonomy you should even be reaching for:

Level Name What it does Reality today
1 Assistance human decides where most systems run
2 Automation repeatable tasks where most systems run
3 Agentic multi-step autonomous workflows where "real ROI" appears — the org stops scaling human effort and starts scaling decisions
4 Autonomous full campaign cycles largely theoretical for high-stakes work

Level 3 is the target for most production systems, and its specific architectural requirement is exactly the multi-agent orchestration with schema-validated handoffs from earlier — one plans, one executes, one validates, a supervisor routes.

CH.10

How do you ship an agent update without breaking prod?

Shipping an agent update isn't shipping a web app. The model is non-deterministic, the context is variable, and a reasoning regression doesn't fail a unit test — it shows up as a subtly wrong answer that passes every format check.

@AiCamila_ prescribes blue-green and canary deployments: maintain two identical environments and switch traffic instantly (blue-green), or gradually route 5–10% to the new version (canary). Use Argo CD, Istio, or Linkerd for traffic splitting, with automatic rollback triggers on error thresholds. The GitOps extension: store agent configs, prompts, and manifests in Git; let Argo CD continuously reconcile desired state to production; add manual approval gates for high-risk changes. Version prompts, tools, and logic together — a prompt change without the matching tool change creates a silent failure. Keep the previous version alive for at least 24 hours before cleanup, because regressions often surface only after sustained traffic.

One hardening detail most teams skip entirely: audit your own settings file. Buried keys quietly bill you, and a single cache-control placement can swing your monthly cost dramatically.

CH.11

The action plan: from architecture to production in five moves

Don't build the agents first. Build the instruments first — then the roles, then the loop, then the evaluation, then the hardening. Each move has a verification you can actually run.

Move 1 — Instrument before you build anything. Add OpenTelemetry tracing with semantic conventions (every span carries tool name, model used, prompt hash). Use Jaeger or Grafana Tempo for traces, LangSmith or Phoenix for LLM-specific observability. Verify: you can name the model version, prompt version, and tool call behind a bad output within 60 seconds of a complaint — reconstruct three recent failure paths from trace data alone, or your instrumentation is insufficient.

Move 2 — Architect roles, memory, and handoffs. Write skill files first — Markdown documents defining each agent's role, input schema, output schema, and exit conditions. (@charliejhills: "Skills are folders of instructions that Claude loads on demand"; @Sia_TechAi notes Anthropic's official and community skills give you a foundation.) Choose the Orchestrator pattern — easiest to debug — and set up the file-based handoff structure with schema validation (start with JSON schemas and validate with Pydantic). Stand up the three-tier memory (STM / LTM / hybrid router) with state on disk, and a CLAUDE.md-style brief agents load on init.

Move 3 — Route cost to complexity, then close one real loop. Wire tiered routing (cheap → mid → frontier, per the table above) with the orchestrator holding canonical state so context survives model switches. Then build one true loop — agent acts, output is verified against criteria, fail continues with adjusted input, pass exits — with a max iteration count and a token budget set before it starts. @0xCodez: "the loop runs until the result is right."

Move 4 — Build the evaluation harness. Create a golden dataset — 20–50 known-good examples to start, growing toward at least 100 representative tasks. Run the four pillars on every deployment candidate. Use an LLM-as-Judge for screening, then human review for: any task where judge confidence is below 0.8, all financial or safety-critical actions, and a random 10% calibration sample. Measure inter-annotator agreement between judge and human; below 85% means your rubric needs work. Layer in @arena's five-signal causal tracking and calculate net improvement against a baseline. Apply @0xLogicrw's cost-constrained protocol — fix a financial budget rather than a step count — and heed the @ArtificialAnlys DeepSWE insight: write eval tasks from scratch rather than adapting public GitHub issues, so models can't game the benchmark by recovering fixes from commit history.

Move 5 — Harden, deploy, and keep hardening. Sandbox each agent (Docker), enforce least-privilege, configure the self-healing loop with a model fallback and @0xTria's regression lock. Design escalation that can't be bypassed — time-based (no response in X minutes → broader channel) and impact-based (financial threshold, data sensitivity) — and run fire drills at random off-hours to measure time-to-acknowledgment. Deploy with canary/shadow routing (5–10%, previous version alive 24h, GitOps-versioned). If your fleet exceeds 100 concurrent agents, measure Agents/MW and move to disaggregated architecture when you hit thermal or power limits. Schedule monthly: adversarial red-teaming, prompt/model version audits against golden-dataset regression, cost-per-successful-task trend analysis, and a security-policy review against actual permissions granted.

CH.12

How will you know it's working?

Verification is a set of deliberately hostile tests — you break the system on purpose and confirm it fails safely.

  • Memory test. Start a complex task, interrupt the session, resume 24 hours later. The agent continues from where it left off without re-explaining context.
  • Handoff test. Inject an intentional error into Agent A's output. Agent B rejects it at validation instead of propagating it — or the supervisor routes to human review.
  • Cost test. Run the full workflow with cheap models on 80% of tasks. Total cost is under 20% of all-frontier, with under 5% quality degradation on your golden dataset.
  • Failure test. Kill an agent mid-task. The system recovers, loses no work, and leaves no resources in an inconsistent state.
  • Trace test. Trace any production failure to a specific model version, prompt version, and tool call within 60 seconds.
  • Business test. You can demonstrate, with data, that AI-generated assets contribute measurably to outcomes — bridging output volume and revenue, the gap where @johniosifov warns "44% of efficiency gains fail to translate to profit impact."

CH.13

The uncomfortable truth about multi-agent systems

The corpus converges on something that sounds backwards: the most important skill in multi-agent orchestration is self-restraint — knowing what not to automate. @JuliannPod's research on learning is the source: "the things that feel inefficient — testing yourself, rebuilding from scratch, explaining without notes — are the only things that actually work." Applied to agents, the human's role shifts from executor to judge, from writer to editor, from doing to deciding. @Mnilax puts a number on what's left: "What's left is the judgment... judgment has a number: 47 minutes." The eight-hour workday compresses to 47 minutes of oversight because the loops handle the rest — but only if the human has taste. "Teaching prompts is two hours," @JuliannPod says. "Teaching taste is the rest."

Two failure modes follow directly. The teams that treat agents as replacements for junior staff fail. The teams that treat agents as amplifiers of senior judgment — with rigorous handoff contracts and persistent memory — build systems that compound. And the teams that assume "better model = less oversight" fail precisely at the edge cases, where the model is most confident and most wrong (exactly @arena's steerability-vs-success tension).

The last word belongs to @mardehaym:

Token Capital = Human Capital × Scaffolding × Feedback Loops.

It's a multiplication, not a sum. If any one of those three is zero, your total is zero — no matter how powerful the model. Invest in the scaffolding first: the memory, the orchestration, the evaluation, the observability. The model is the cheapest part to swap, and the last thing that will save you.

multiagentorchestrationobservability
DISCUSSION

No comments yet — start the conversation.

Sign in to join the discussion — it's free.