Inspiration

Cancer doesn't wait for committee meetings — but tumor boards do.

A patient can have their biopsy done, their genomic panel run, and their HIR record fully populated, yet a Multidisciplinary Team still spends hours manually compiling that data before they can make a single treatment decision. That gap — between data existing and data being actionable — is where patients fall through the cracks.

The Agents Assemble hackathon challenged us to think about the "endgame" for healthcare AI. For us, that endgame isn't AI replacing oncologists. It's an AI that has already read every lab result, cross-referenced every biomarker, and ranked the best clinical trials — before the doctor walks into the room.

OCC was built to close that last mile.

What it does

OCC is a precision oncology AI agent that reads a patient's live FHIR R4 record and generates a fully structured Multidisciplinary Team (MDT) report in seconds. Given a patient, it automatically: interprets genomic biomarkers (EGFR, ALK, PD-L1), retrieves biopsy and TNM staging reports, matches the patient to eligible clinical trials with confidence scores, and formally delegates to specialist agents (Radiology, Pathology) via the A2A protocol — all presented as a clinical-grade Virtual Tumor Board summary.

How we built it

OCC is a Google ADK agent served over FastAPI and exposed via the A2A 1.0 protocol as an External Agent on the Prompt Opinion platform. FHIR credentials (fhir_url, fhir_token, patient_id) are injected by a before_model_callback from the A2A message metadata into session state — they never touch the LLM context. Eight specialized tools query live FHIR R4 resources (Patient, Condition, MedicationRequest, Observation, DiagnosticReport) and a local mCODE-aligned trial registry. A custom Starlette middleware handles API key authentication, request logging, and FHIR metadata bridging across differing A2A payload structures. The entire stack is booted with a single start.sh script, tunnelled to Prompt Opinion via ngrok.

Challenges we ran into

  1. Secure credential injection without prompt leakage. FHIR bearer tokens had to flow from the platform to the agent's tools without ever appearing in the LLM context window. The solution was ADK's before_model_callback writing to session state, with every tool reading from tool_context.state at call time.

  2. A2A metadata inconsistency. Prompt Opinion placed FHIR context at params.metadata in some calls and params.message.metadata in others. The middleware had to detect and bridge both paths on every request before the payload reached the agent.

  3. FHIR parsing variance. The same biomarker (e.g., PD-L1) can appear as valueQuantity, valueString ("TPS 60%"), or valueCodeableConcept depending on the FHIR server. Every tool needed defensive parsing that gracefully degrades without crashing the agent turn.

  4. Stateless multi-patient sessions. Switching between patients without restarting the server required ensuring session state was fully overwritten per A2A request — no bleed-over between patients.

    Accomplishments that we're proud of

What we learned

ADK's before_model_callback is underrated — it's the cleanest way to inject context into a tool-calling agent without polluting the prompt. A2A metadata is a powerful secure side-channel — the protocol's ability to carry structured metadata alongside a message eliminates the need for custom session backends in multi-tenant clinical deployments. Prompt engineering is a clinical protocol — specifying the output format as a numbered MDT procedure (Step 1: Sentinel Check, Step 2: Pathology Audit…) produced dramatically more consistent structured outputs than open-ended instructions. FHIR in the wild requires defensive code — real bundles do not conform to a single schema shape, and graceful degradation is not optional.

What's next for OCC — Oncology Care Coordinator

Live ClinicalTrials.gov integration — replace the local registry with a real-time API call to NCT, expanding from a curated list to thousands of active trials. Radiology & Pathology sub-agents — promote the stub request_specialist_consultation delegations into real A2A agents that process imaging and pathology reports independently. Longitudinal patient tracking — move from single-turn MDT snapshots to persistent session tracking that alerts the care team when a biomarker changes or a new trial opens. EHR write-back — push the MDT summary back to the FHIR server as a DocumentReference, closing the loop between the AI recommendation and the patient's permanent record. Multi-cancer expansion — extend the mCODE toolset beyond lung cancer to breast, colorectal, and haematological malignancies.

Built With

  • a2a-sdk
  • cloud
  • fastapi
  • fhir-r4
  • gemini-flash
  • google-adk
  • httpx
  • mcode
  • ngrok
  • prompt-opinion
  • python
  • python-dotenv
  • render
  • starlette
  • uvicorn
Share this project:

Updates