Inside our Managed Agents architecture — 15 agents, 1 environment
A walk-through of the seven primary and eight specialist agents we provisioned on Anthropic's Managed Agent platform, why we wired them together this way, and why the production flag is still off by default.
When Anthropic shipped Managed Agents, the obvious-but-wrong move was to take our existing inline cascade and lift each call into a separate agent. That way lies $3.50-per-report territory. Instead we treated the platform as a chance to redraw the system around user actions first, with specialists called only where the domain work is non-trivial.
The result: 15 agents in one environment, mapped 1:1 to product surfaces, with a thin HMAC-signed bridge sitting between them and our PostgreSQL writes.
Primary layer — seven user-facing agents
Each primary agent maps to exactly one product action. No more, no less:
- P1 Main Orchestrator (Haiku 4.5) — text-router for ambiguous chat input. Cheap, fast, almost always right.
- P2 Area Analysis Pipeline (Opus 4.7) — the heavy hitter. Drawn polygon in, nine-section report out, fanning to four specialists.
- P3 Report Translator (Sonnet 4.6) — section-parallel EN ↔ TR/RU/UZ translation. Sibling report, glossary-pinned.
- P4 Section Re-analyzer — single-section regenerate with optional user hint, model picked at the call site.
- P5 Oblast Aggregator (Opus 4.7) — N parcels in, viloyat-level brief out, parcel-weighted statistics.
- P6 Chat Companion (Sonnet 4.6) — mascot chat backed by our public MCP server. No fabrication; everything grounded in MCP tools.
- P7 Share & PDF Orchestrator (Haiku 4.5) — mints share tokens, drives PDF generation, crafts OpenGraph preview text.
Specialist layer — eight domain workers
Specialists are JSON-in / JSON-out. They never address the user; they get a structured task, return structured data, and the primary stitches the result.
- S1 Cadastral Analyst (Sonnet 4.6) — spatial → structured cadastral JSON.
- S2 Satellite Interpreter (Opus 4.7) — 12-month NDVI history → vegetation-health JSON.
- S3 Policy Aligner (Sonnet 4.6) — analysis + WB / UZ-2030 / UNFF / SDG framework docs → alignment JSON.
- S4 Composer (Opus 4.7) — S1+S2+S3 outputs → nine XML-tagged markdown sections.
- S5 Species Recommender (Sonnet 4.6) — bioclimate + soil + 64-species catalog → ranked 3–5 recommendations.
- S6 Cost Estimator (Haiku 4.5) — species + area + oblast → USD cost bands with multipliers.
- S7 Risk Analyzer (Sonnet 4.6) — spatial + climate + infrastructure → categorised risks with mitigations.
- S8 Translator (Sonnet 4.6) — section markdown + target lang → translated section markdown.
The bridge that ties it together
Agents live in Anthropic's environment. Our database lives on our VPS. The bridge — five small modules in backend/app/ — handles every crossing:
auth/agent_token.py— HMAC-signed 60-second service-to-service tokens. An agent's reply is rejected if the signature is missing, replayed, or mismatched.models/agent_invocation.py— every call logged with cost, latency, tokens, status. Full audit trail.routes/agent_internal.py— HMAC-protected/api/agent/internal/*endpoints (get_spatial_context,write_section,finalize_report). Internet can't reach them.agent_bridge/*— SSE event translator that streams agent progress to the React frontend.- Contract tests — 9/9 green for the P2 path.
Why the production flag is OFF
USE_AGENT_PIPELINE=false by default. The Managed Agents path costs roughly 3× the inline cascade because each sub-agent rebuilds part of its context. For an always-on demo deployment, the inline path is the right baseline.
Where we'll flip it ON: cross-team workflows, the researcher sub-agent builder on the Q3 2026 roadmap, and parallel report queues for multi-tenant orgs. Anywhere isolation matters more than the bill.
What we'd ship next
- Per-agent budget caps. Right now the cost guardrail is a daily total ($50 alert, $100 hard-stop). Per-agent caps would let us experiment with Opus-on-everything safely.
- Agent-level prompt cache namespacing. S1, S2, S3 share most of their grounding context — caching them in a single namespace would shave another 30%.
- A "shadow" run mode. Send the same request through both inline and Managed Agents paths, diff the outputs, surface where the architectures disagree. Best ground-truth we can build for ourselves.
Architecture diagram + per-agent matrices live in docs/HACKATHON_AGENT_ARCHITECTURE.md in the repository.