Coverage Check — Agent-to-Agent Prototype
A self-initiated concept prototype answering one question: is my medication covered, and what do I need to get it approved? An orchestrator agent delegates to two narrowly-scoped worker agents, reachable by voice or text, with the same orchestration exposed as a headless API for systems that have no interface of their own. Built to prototype agent-to-agent design, conversation/voice state, and headless-system experience rules against a real LLM API — not simulated.
Context & Challenge
One Assistant Can't Safely Do Two Jobs
Answering "is my medication covered, and what do I need to get it approved?" means two separate lookups — plan eligibility, then formulary and prior-authorization — usually siloed in different systems. My existing agentic work (an email-draft assistant, an embedded analytics assistant) was all human-to-single-agent. This prototype exists to prove the pattern this gap needs: real delegation between scoped agents, not one assistant doing everything.
Eligibility and formulary data live in separate systems of record — one assistant with broad access to both blurs an auditable boundary.
Typical chatbot patterns hide whether one assistant or several actually produced an answer — trust requires seeing the handoff.
Nothing in my portfolio defined retention, disclosure, and ownership rules for a system with no interface of its own.
Prior conversational work stopped at chat — no shared state model across voice and text as input channels.
adjustMy Brief
Design and build a small, honest agent-to-agent system — one orchestrator, two scoped workers — reachable by voice or text, with the same orchestration exposed headlessly, and with real LLM API calls behind it rather than simulated copy.
Think — Architecture Decisions
The Split Is the Design Decision
For most of my case studies, the research phase is user interviews. Here, the equivalent rigor went into architecture: deciding what each agent is allowed to know, and defending why.
Key Decisions
Two-Worker Split
Eligibility vs. Coverage agents
Each agent can do less, not more, than the whole task requires — scope is legible from each agent's own instructions.
Sequential, Not Parallel
Coverage depends on eligibility
Checking a formulary for an inactive member is meaningless — this dependency isn't one Anthropic's parallel pattern fits.
Orchestrator-Only State
Workers are stateless
Only the orchestrator holds conversation history and session state — one place to audit, one place to change.
Confidence Aggregation
Computed at synthesis
A low or partial result from either agent surfaces as a visible caveat, never silently upgraded.
Agent-to-agent architecture — orchestrator delegating sequentially to two stateless workers, then synthesizing; neither worker ever sees the other's output
Design Evolution
From Architecture to Working Prototype
The process followed the same discipline as my other coded prototypes: think before code, define the contract before the interface, build the system before the screens.
Design Progression
account_tree01 — Architecture
- Agent-to-agent diagram
- Delegation rules
- Stateless workers
- Synthesis logic
description02 — Context Files
- Orchestrator prompt
- Worker prompts
- I/O contracts
- Scope boundaries
graphic_eq03 — Conversation State
- Voice + text, shared state
- Trace visibility
- Low-confidence state
- Error state
policy04 — Headless Rules
- Retention
- Disclosure
- Ownership boundaries
- API contract
code05 — Prototype
- FastAPI backend
- Real Claude API calls
- Demo-mode fallback
- Vanilla frontend
Step 02
Context Files as a Real Deliverable
Each agent's behavior is governed by a markdown file — the actual system prompt sent to Claude in live mode, not documentation written after the fact. This is the direct answer to "markdown and context-file deliverables for agent consumption": the file a reviewer opens is the file the agent runs on.
orchestrator.md
Scope, delegation order, synthesis rules, output JSON contract, what it must never do.
eligibility-agent.md
Input/output contract, refuses out-of-scope questions, stateless by design.
coverage-agent.md
Formulary/PA scope only, never recommends clinical alternatives, structured output only.
terminalFrom orchestrator.md
Never forward one worker agent's raw output to the
other worker agent. Each worker gets only what the orchestrator explicitly
constructs for it. If confidence is medium or low, say so in the answer itself —
do not present a hedge only in metadata the user never sees.
Step 03
Conversation & Voice State
Voice and text share one state machine — voice isn't a thinner, separate interaction model. The difference is only the input method (speech-to-text) and one added output (text-to-speech on the final answer), which matters because a voice-only user can't visually scan a confidence badge — the spoken answer says the caveat explicitly.
One shared state machine for voice and text — low-confidence and error states are visible outcomes, not hidden fallbacks
Step 04
Headless System — Experience Rules
The same orchestration is exposed as POST
/v1/coverage-check, with no UI of its own. Because nothing here is a screen,
the "experience" is entirely in the contract — what's disclosed, what's retained, who
owns what.
Retention
Member/plan IDs discarded post-request; results cached 15 minutes; transcripts retained 30 days, then deleted.
Disclosure
Every response carries ai_generated, not_medical_advice,
and confidence — consumers must surface them.
Ownership
Payer systems own source data; the patient owns transcripts; workers never receive each other's output.
One orchestration layer, two consumers — the headless path is governed entirely by contract, not by a screen
Step 05
Code — Real Agents, Real API, Honest Fallback
In live mode (ANTHROPIC_API_KEY set), each agent call
is a real Anthropic API request using the markdown context files as system prompts. In
demo mode, the identical contract is satisfied deterministically, so the same frontend,
trace, and confidence logic work either way — a portfolio prototype that only runs with a
live key attached isn't reviewable by someone who doesn't want to configure one.
FastAPI backend
Orchestrator + 2 workers, Anthropic SDK integration, headless endpoint, health check exposing current mode.
Vanilla frontend
No framework, no build step — Web Speech API for voice in/out, live trace rendering, confidence badges.
Demo ↔ live parity
Same JSON contract in both modes — reviewable without a key, upgradeable to live inference with one env var.
Role Fit
Competency → Evidence, Traceable
| Requirement | Where it's proven |
|---|---|
| Agent-to-agent flow | Orchestrator class delegating to two independently-scoped workers, sequential
dependency justified in architecture.md |
| Conversation state design | Full state table (listening → … → answer_ready / low_confidence / error), rendered live in the UI trace |
| Voice / multimodal | Web Speech API input + speech synthesis output, sharing one state machine with text |
| Markdown/context-file deliverables for agents | orchestrator.md, eligibility-agent.md,
coverage-agent.md — the real system prompts, not summaries of them
|
| Headless system experience rules | Retention / disclosure / ownership rules defined from scratch;
POST /v1/coverage-check as the no-UI consumer contract |
| Prototyping against LLM APIs | Real Anthropic SDK calls in live mode, contract-matched demo-mode fallback |
| Responsible AI UX patterns | Per-claim provenance, confidence-as-UI-state, disclosure block on every response, honest error state |
What This Proves
A Small, Honest Proof — Not a Production Claim
infoTransparency
This is a self-initiated prototype built to close a specific portfolio gap — not a shipped Pfizer feature. All member, plan, and drug data is synthetic. It's a two-agent, single-sequential-flow system, deliberately scoped small rather than claiming production-scale multi-agent expertise.
Agent Scope
2 workers
each independently scoped and auditable
Delegation Visibility
100%
of delegation steps rendered in real time
LLM Integration
Live
Anthropic SDK, with contract-matched demo fallback
Headless Contract
3
retention, disclosure, and ownership rules, defined from scratch
Reflections