For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

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 agent

  • get_agent_description(): Describes what your agent does

  • process_message(): The main logic that processes user requests

The AgentContext provides access to:

  • Document operations: context.document_client for reading/writing files

  • Progress updates: context.update_progress() for user feedback

  • Inter-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 code

  • requirements.txt - Dependencies

  • README.md - Documentation (optional but recommended)

2. Commit and Push

3. Deploy on Health Universe

  1. Click "Deploy a new app"

  2. 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 FastAPIAdd to Navigator

    • Main File: main.py

  3. 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

  1. Open Navigator in your Health Universe workspace

  2. Upload documents to a thread (medical data files, reports, etc.)

  3. Search for your agent by name or description

  4. Click "Use Tool" to run your agent

  5. Monitor progress as your agent processes the documents

  6. View results in the artifacts panel when complete

Next Steps

Now that you have a basic agent working, you can:

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.txt includes health-universe-a2a

  • Ensure your main.py file is in the repository root

  • Review the build logs for specific error messages

Need help?

Last updated

Was this helpful?