Inspiration

Discharge is one of the highest-friction moments in care delivery. Patients often leave with fragmented instructions, dense clinical wording, medication changes that are hard to interpret, and unclear follow-up steps. I wanted to build an agent that improves that last mile of care communication by turning the available patient context into something clearer, safer, and easier to review.

What it does

Discharge Companion is a Prompt Opinion A2A healthcare agent that generates structured discharge guidance from patient-specific context.

It produces a consistent, review-ready response with:

  • a Discharge Overview
  • Medication Guidance
  • Follow-Up Actions
  • Warning Signs
  • a Patient-Friendly Summary
  • Review Flags for missing or conflicting information

The agent is designed for communication support and workflow support, not diagnosis or prescribing. If the available context is incomplete, it is instructed to flag uncertainty instead of guessing.

How I built it

I built Discharge Companion as a Prompt Opinion A2A agent with:

  • patient and workspace scope support
  • A2A availability enabled
  • FHIR context extension enabled
  • a versioned system prompt focused on discharge communication
  • structured output guidance for consistent review-ready responses
  • consultation instructions so other agents can call it as a discharge specialist

I also created a repo-first asset pack to make the agent reproducible:

  • prompt bundle and platform-ready system prompt
  • input/output schemas
  • synthetic patient scenarios and expected outputs
  • architecture documentation
  • manual setup assets for Prompt Opinion
  • test prompts for both direct use and A2A use through General Chat Agent

For testing, I used synthetic patient records in Prompt Opinion and validated two main flows:

  1. selecting Discharge Companion directly in patient scope
  2. selecting General Chat Agent and explicitly asking it to consult Discharge Companion through A2A

Challenges

One of the biggest challenges was designing for a platform with limited public documentation. Because of that, I treated the repo as the source of truth and built the project so the prompts, contracts, docs, and setup assets could be reviewed and copied into the platform cleanly.

Another challenge was keeping the agent narrow and safe. Discharge communication is clinically important, so I had to make sure the agent:

  • stayed grounded in available patient context
  • did not invent medication or follow-up instructions
  • handled sparse context safely
  • made clinician review a core part of the workflow

I also had to think carefully about how the agent would behave both as a directly selected patient-scope agent and as an A2A specialist called by another agent.

What I learned

I learned that a narrow healthcare agent can be much more credible than a broad “general medical assistant.” By focusing on one workflow boundary, I could make the output structure clearer, the safety stance stronger, and the A2A behavior easier to reason about.

I also learned that for interoperable agent systems, documentation and prompt architecture matter as much as model choice. A good A2A agent needs:

  • a clear specialist role
  • explicit constraints
  • predictable output structure
  • a clean handoff path for other agents

What’s next

The next steps are to:

  • test more synthetic and edge-case discharge scenarios
  • improve routing from General Chat Agent into Discharge Companion
  • add richer FHIR-backed context where available
  • expand evaluation around ambiguity, missing data, and review-flag behavior
  • package the agent for marketplace publishing and final demo presentation

Built With

Share this project:

Updates