An Agent2Agent (A2A) demo for healthcare research and presentation generation using OpenAI (triage + review), Gemini (research), and Gamma (presentation) APIs. The system routes requests through multiple specialized agents, streams progress updates, and produces patient-friendly presentations with a polished UI.
✅ Completed:
- FastAPI service scaffolding (triage, research, review, presentation)
- Agent Cards (
.well-known/agent-card.jsonfor each service) - React frontend shell with Tailwind CSS
- Orchestrator client
- Run scripts for Windows and Linux/Mac
🚧 In Progress:
- Real-time SSE streaming integration
- API integrations (OpenAI, Gemini, Gamma)
- UI animations and task monitoring
Single command to run everything (backend + frontend):
Windows:
.\run_all.batLinux/Mac:
./run_all.shSee Local Run section below for detailed setup instructions.
This plan describes a concrete, implementation-ready path to build an Agent2Agent (A2A) demo for healthcare research and presentation generation. The analysis agent is removed. The focus is on a highly visible demo with animations, real-time task updates, and UI polish.
Primary user story: A user requests a patient-friendly presentation on a healthcare topic (e.g., diabetes management). The system routes the request, streams research progress, and produces a Gamma presentation link with a polished UI that visualizes agent handoffs.
Success criteria
- ✅ Triage routes to research and presentation agents correctly.
- ✅ Research agent streams progress and can request clarifying info (input-required state).
- ✅ Review agent verifies medical summaries for tone, clarity, and compliance notes.
- ✅ Presentation agent returns a Gamma URL and the UI embeds or links it.
- ✅ UI shows animated handoffs, task status updates, and artifacts in real time.
Agents
-
Triage/Classification Agent (OpenAI)
- Skill:
classify_and_route - Routes to Research or Presentation directly.
- Skill:
-
Medical Research Agent (Gemini 3 Pro)
- Skills:
summarize_medical_research,extract_key_points - Streaming SSE support.
- Skills:
-
Review Agent (OpenAI)
- Skill:
review_medical_summary - Checks clarity, audience friendliness, and compliance notes.
- Skill:
-
Presentation Agent (Gamma API)
- Skill:
create_presentation - Generates slides and returns
gammaUrl.
- Skill:
Client Agent (A2A Orchestrator)
- Discovers Agent Cards.
- Sends user request to triage agent.
- Routes results to Research → Review → Presentation pipeline.
- Maintains
contextIdandtaskId.
- Create a shared A2A service template (FastAPI recommended).
- Implement baseline endpoints:
POST /messageGET /message/stream(SSE for streaming agents)POST /tasks/resubscribe
- Implement a common schemas module:
TaskStatusUpdateEvent,TaskArtifactUpdateEventMessage,TaskState
Acceptance: A mock agent returns a completed message and streams updates.
For each agent service, add /.well-known/agent-card.json with:
name,description,urlauthentication(Bearer)capabilities(streaming or not)skillslist with concrete examples
Acceptance: Client can discover all agents and list skills.
- Implement
classify_and_routeusing a small function-based classifier. - Register handoff tools:
transfer_to_medical_research_agenttransfer_to_presentation_agent
- Route based on intent:
- Research requests → Research agent
- Slide requests with outline already provided → Presentation agent
Acceptance: 5 test prompts route correctly.
- Implement research prompts using Google GenAI SDK.
- Return structured JSON output:
summary,keyPoints,riskFactors,citations,audienceTone
- Add streaming progress updates:
- Send
TaskStatusUpdateEventevery few seconds. - Emit partial summaries as they are produced.
- Send
- Add input-required flow:
- If missing patient type or region, send
input-requiredstatus.
- If missing patient type or region, send
Acceptance: Streams updates + valid JSON output.
- Review the Research JSON for clarity and compliance.
- Output:
revisedSummarywarnings(e.g., missing citations)patientFriendlyScore(1-5)
Acceptance: Validates and improves research output.
- Accept outline and summary from review agent.
- Call Gamma Generate API:
POST /generationswith theme, tone, slide count- Poll
GET /generations/{id}untilcompleted
- Return
gammaUrlin artifact.
Acceptance: Presentation link works in UI.
- Left pane: conversation and prompts.
- Right pane: Task Monitor with agent cards.
- Footer: progress log & artifact links.
- Agent Handoff Animation
- Visual “pulse” moving from triage → research → review → presentation.
- Task Status Badge Animations
queued(gray shimmer),working(animated spinner),input-required(yellow pulse),completed(green check),failed(red shake).
- Streaming Output Animation
- Research text appears with typing effect or incremental fade-in.
- Artifacts Reveal
- Charts or Gamma link slides in from the right with a smooth easing.
- React + Framer Motion for animations.
- SSE client for real-time updates.
- Tailwind CSS for rapid styling.
- Build Task Monitor component (status list + progress bar).
- Add Agent Pipeline visualization (timeline or node graph).
- Implement SSE hook to update tasks and stream artifacts.
- Embed Gamma presentation using iframe or link card.
Acceptance: Animations and streaming updates visible in demo recording.
- Receive user prompt.
- Send to Triage agent.
- If routed to Research:
- Start Research task (stream updates to UI).
- If
input-required, pause and ask user.
- Send Research output to Review agent.
- Send reviewed summary + outline to Presentation agent.
- Return Gamma URL and embed in UI.
- User: “Create a patient-friendly presentation on diabetes management.”
- Research agent asks: “Which population? (e.g., adults, adolescents, seniors)”.
- User: “Adults in the US.”
- Research agent streams summary and key points.
- Review agent refines summary + adds warnings.
- Presentation agent returns Gamma URL.
- UI embeds deck; task monitor shows completed pipeline.
- Client agent + 4 services
- Agent Cards for each agent
- UI shell (React + Tailwind CSS)
- README with local run steps
- UI animations + streaming updates (in progress)
- Demo GIF/Video
- Streaming failures → fall back to polling
- Slow Gamma generation → show “Generating slides…” animation + progress bar
- Missing citations → review agent inserts warning banner
- ✅ Scaffold FastAPI services.
- ✅ Implement Agent Cards.
- ✅ Build UI shell with Task Monitor + animation placeholders.
- Wire SSE to show real-time updates.
- Integrate API calls (OpenAI, Gemini, Gamma).
- Add streaming animations and real-time task updates.
- Do not store PHI.
- Use de-identified sample text.
- Display banner: "For educational purposes only."
A .gitignore file is included to prevent committing:
- Python bytecode (
__pycache__/,*.pyc) - Virtual environments (
.venv/,venv/) - Node modules (
node_modules/) - IDE files (
.vscode/,.idea/) - Environment files (
.env) - OS files (
.DS_Store,Thumbs.db)
If files were already tracked, remove them from Git:
git rm -r --cached .
git add .
git commit -m "Update .gitignore"This repo includes scaffolded FastAPI services for triage, research, review, and presentation, plus a React frontend.
Windows (PowerShell):
.\run_all.bator
& .\run_all_with_frontend.ps1Linux/Mac (Bash):
./run_all.shThis will start all backend services (ports 8001-8004) and the frontend (port 5173).
python -m venv .venv
# Windows
.venv\Scripts\activate
# Linux/Mac
source .venv/bin/activate
pip install -r requirements.txtcd web
npm install
cd ..Windows (PowerShell):
& .\run_all_with_frontend.ps1Linux/Mac (Bash):
./run_all.shBackend services:
uvicorn services.triage.app:app --port 8001 --reload
uvicorn services.research.app:app --port 8002 --reload
uvicorn services.review.app:app --port 8003 --reload
uvicorn services.presentation.app:app --port 8004 --reloadFrontend:
cd web
npm run devOrchestrator (standalone):
python client/orchestrator.py- Frontend UI: http://localhost:5173
- Triage Service: http://localhost:8001
- Research Service: http://localhost:8002
- Review Service: http://localhost:8003
- Presentation Service: http://localhost:8004
Port already in use:
- Stop any existing services on ports 8001-8004 or 5173
- On Windows:
netstat -ano | findstr :8001to find processes - Kill process:
taskkill /PID <pid> /F
PowerShell script execution error:
- Use the batch file:
run_all.bat - Or run:
powershell -ExecutionPolicy Bypass -File .\run_all_with_frontend.ps1
Frontend not starting:
- Ensure Node.js is installed:
node --version - Install dependencies:
cd web && npm install
Python dependencies:
- Ensure Python 3.10+ is installed
- Activate virtual environment before running services
a2a_agent/
├── client/
│ └── orchestrator.py # Client orchestrator
├── services/
│ ├── common/ # Shared schemas and utilities
│ ├── triage/ # Triage agent service
│ ├── research/ # Research agent service
│ ├── review/ # Review agent service
│ └── presentation/ # Presentation agent service
├── web/ # React frontend
│ ├── src/
│ │ ├── App.jsx
│ │ └── components/
│ └── package.json
├── run_all.sh # Bash script (Linux/Mac)
├── run_all.ps1 # PowerShell script (Windows)
├── run_all_with_frontend.ps1 # PowerShell script with frontend
├── run_all.bat # Batch file wrapper
├── requirements.txt # Python dependencies
└── README.md