Skip to content

RnD4ASI/A2A-Example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Agent2Agent (A2A) Example

This directory demonstrates a simple implementation of Google�s Agent2Agent (A2A) protocol with three specialized agents and an orchestrator.

Directory Structure

agent2agent/
├── README.md           # this file
└── a2a_example.py      # example script showing A2A workflow

Overview

The A2A protocol enables AI agents to discover each other�s capabilities, negotiate tasks, and collaborate through structured JSON messages.

Components

  • AgentCard: Advertises an agent�s name and capabilities.
  • Task: Encapsulates task metadata, status, and resulting artifact.
  • Message: Carries sender, receiver, content, and optional parts for UI negotiation.
  • Agent (base class): Provides advertise and default handle_message (echo).
  • SearchAgent: Implements search_candidates to return dummy profiles.
  • FilterAgent: Implements filter_candidates to filter by skill.
  • ScheduleAgent: Implements schedule_interview to assign interview times.
  • Orchestrator: Acts as the client agent, discovers capabilities, sends messages to complete a candidate-sourcing workflow.

Prerequisites

  • Python 3.7 or higher

No external packages are required (uses Python standard library).

Running the Example

  1. Clone or navigate to this directory:
    cd agent2agent
  2. Run the example script:
    python a2a_example.py
  3. Observe:
    • Agents advertise their capabilities.
    • Orchestrator issues tasks: search, filter, schedule.
    • Agents respond with Task artifacts.
    • Final output: list of found, filtered candidates and interview schedule.

Extending this Example

  • Add new agents: Create classes inheriting from Agent and implement handle_message for new actions.
  • Real data: Replace dummy logic with database/API calls or LLM-based processing.
  • Network transport: Integrate HTTP/WebSocket layers for remote agent communication.
  • UI integration: Use Message.parts to negotiate UI components (forms, iframes).

References

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages