Skip to content

Latest commit

 

History

History
97 lines (67 loc) · 2.96 KB

File metadata and controls

97 lines (67 loc) · 2.96 KB

A2A Registry Service

An Agent-to-Agent (A2A) Registry Service implementation in Go, designed to facilitate the discovery and management of autonomous agents. This project follows Clean Architecture principles to ensure modularity, testability, and maintainability.

Architecture & Dataflow

The system facilitates communication between agents and sidecars. Below is the dataflow diagram illustrating the A2A sidecar communication:

A2A Dataflow

Features

  • Agent Registry: Full CRUD operations for registering, retrieving, listing, and deleting agent details.
  • Dual Transport: Supports both HTTP (REST) and gRPC interfaces simultaneously.
  • Clean Architecture: Separation of concerns with Domain, Ports, Services, and Adapters layers.
  • Protocol Compliance: Adheres to the A2A Protocol JSON Schema for AgentCard.
  • In-Memory Storage: Currently uses a thread-safe in-memory repository (Phase 1).

Getting Started

Prerequisites

  • Go: Version 1.21 or higher
  • Make (Optional, for running utility commands)

Installation

  1. Clone the repository:

    git clone https://github.com/ThisaraWeerakoon/Agent-Mesh.git
    cd Agent-Mesh
  2. Install dependencies:

    go mod download

Running the Server

Start the application using:

go run cmd/server/main.go

The server will start on:

  • HTTP: Port 3000
  • gRPC: Port 50051

Google ADK Integration

Easily integrate google/adk-go agents with the AgentMesh network.

1. Client: Remote Agent as Tool

import mesh_adk "github.com/ThisaraWeerakoon/Agent-Mesh/pkg/adk"

// Create a tool that proxies requests to the remote 'summary_agent'
// No schema definition needed - it defaults to handling a "request" string.
summaryTool, _ := mesh_adk.RemoteTool("summary_agent", "A tool that summarizes text.", "summary_agent")

// Use it in your agent
rootAgent, _ := llmagent.New(llmagent.Config{
    Tools: []tool.Tool{summaryTool},
})

2. Server: Expose Agent to Mesh

import mesh_adk "github.com/ThisaraWeerakoon/Agent-Mesh/pkg/adk"

// Start a server that listens for mesh tasks and forwards to your agent
// It uses the standard ADK Runner to execute the agent.
mesh_adk.ServeAgent(50054, myAdkAgent)

3. Running the Example

Launch the complete flow with:

  1. Sidecar: go run cmd/sidecar/main.go
  2. Agent Server: go run cmd/adk_example/server/main.go
  3. Client: go run cmd/adk_example/client/main.go "Summarize this..."

Documentation

For more detailed information, please refer to the following guides:

  • Developer Guide: In-depth look at architecture, design decisions, and codebase structure.
  • Usage Guide: Step-by-step instructions on how to use the API (HTTP & gRPC) and run tests.

Testing

Run the integration tests to verify the system:

go test -v ./tests/...