Getting Started
A2A (Agent-to-Agent) agents are intelligent, autonomous applications that can process messages, handle document operations, and communicate with other agents in the Health Universe platform. They're perfect for building AI-powered healthcare workflows, document processing pipelines, and clinical decision support tools.
This guide will walk you through creating, testing, and deploying your first A2A agent.
Prerequisites
Before you begin, make sure you have:
Python 3.10+ installed
Basic familiarity with Python and async programming
Installation
1. Create a New Repository
Create a new GitHub repository for your agent:
git clone https://github.com/<your_username>/<your_repo_name>.git
cd <your_repo_name>2. Set Up Your Environment
Create and activate a virtual environment:
3. Install the SDK
Install the Health Universe A2A SDK:
Creating Your First Agent
Basic Agent Structure
Create a file called main.py with your first agent:
Understanding the Agent Structure
Every A2A agent must implement three core methods:
get_agent_name(): Returns the display name for your agentget_agent_description(): Describes what your agent doesprocess_message(): The main logic that processes user requests
The AgentContext provides access to:
Document operations:
context.document_clientfor reading/writing filesProgress updates:
context.update_progress()for user feedbackInter-agent communication:
context.call_agent()for calling other agents
Testing Locally
1. Create Test Data
Create a local test environment:
2. Local Testing Script
Create test_local.py:
Run the test:
3. Test the Server
You can also test the full HTTP server locally:
Then visit:
http://localhost:8000 - Main endpoint
http://localhost:8000/.well-known/agent-card.json - Agent metadata
http://localhost:8000/health - Health check
Creating Requirements File
Generate your dependencies:
Your requirements.txt should include at minimum:
Deploying to Health Universe
1. Prepare Your Repository
Ensure your repository contains:
main.py- Your agent coderequirements.txt- DependenciesREADME.md- Documentation (optional but recommended)
2. Commit and Push
3. Deploy on Health Universe
Go to your Health Universe workspace
Click "Deploy a new app"
Fill in the deployment form:
GitHub Repository: Select your repository
App Name: "Medical Data Analyzer"
Description: "Analyzes medical datasets and generates clinical insights"
Runtime: Select FastAPI → Add to Navigator
Main File:
main.py
Click "Deploy App"
4. Monitor Deployment
Watch the build logs to ensure your agent deploys successfully. Once complete, your agent will be available in Health Universe Navigator.
Using Your Agent in Navigator
Open Navigator in your Health Universe workspace
Upload documents to a thread (medical data files, reports, etc.)
Search for your agent by name or description
Click "Use Tool" to run your agent
Monitor progress as your agent processes the documents
View results in the artifacts panel when complete
Next Steps
Now that you have a basic agent working, you can:
Learn about document operations for advanced file handling
Explore inter-agent communication for building agent workflows
Add validation to make your agents more robust
Integrate with LLMs for AI-powered analysis
Common Issues
Agent not appearing in Navigator?
Ensure you selected "Add to Navigator" during deployment
Check that your agent implements all required methods
Local testing not working?
Make sure you activated your virtual environment
Verify the
test_data/source/directory exists with sample files
Deployment fails?
Check your
requirements.txtincludeshealth-universe-a2aEnsure your
main.pyfile is in the repository rootReview the build logs for specific error messages
Need help?
Check the Health Universe documentation
Review the SDK source code for examples
Last updated
Was this helpful?