a2a-net.Core 0.12.0

Prefix Reserved
dotnet add package a2a-net.Core --version 0.12.0
                    
NuGet\Install-Package a2a-net.Core -Version 0.12.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="a2a-net.Core" Version="0.12.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="a2a-net.Core" Version="0.12.0" />
                    
Directory.Packages.props
<PackageReference Include="a2a-net.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add a2a-net.Core --version 0.12.0
                    
#r "nuget: a2a-net.Core, 0.12.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package a2a-net.Core@0.12.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=a2a-net.Core&version=0.12.0
                    
Install as a Cake Addin
#tool nuget:?package=a2a-net.Core&version=0.12.0
                    
Install as a Cake Tool

A2A-NET

Agent-to-Agent (A2A) is a lightweight, extensible protocol and framework for orchestrating tasks and exchanging structured content between autonomous agents using JSON-RPC 2.0.

Build Status Release NuGet License


๐Ÿงฉ Projects

๐Ÿง  Core

  • A2A.Core
    Contains the core abstractions, models, contracts, and data types shared across both clients and servers.
    Includes agent cards, messages, tasks, artifacts, capabilities, and JSON-RPC protocol definitions.
    This package is dependency-free and safe to use in any environment.

๐Ÿ“ก Client

  • A2A.Client.Abstractions
    Defines the core interfaces and contracts for implementing A2A clients, including IA2AClient and protocol APIs.

  • A2A.Client
    Provides client-side functionality for A2A agent discovery and metadata resolution.
    Includes utilities for retrieving agent cards and establishing connections.

  • A2A.Client.Transports.Http
    Implements the HTTP transport for the IA2AClient.
    Enables agent-to-agent communication over HTTP using JSON-RPC 2.0.

  • A2A.Client.Transports.Grpc
    Implements the gRPC transport for the IA2AClient.
    Enables persistent, bidirectional agent-to-agent communication over gRPC connections.

  • A2A.Client.Transports.JsonRpc
    Implements the JSON-RPC transport for the IA2AClient.
    Enables persistent, bidirectional agent-to-agent communication over JSON-RPC connections.


๐Ÿ› ๏ธ Server

  • A2A.Server.Abstractions
    Defines core server-side abstractions including IA2AServer, IA2AAgentRuntime, IA2AStore, task queuing, and event streaming interfaces.
    Provides the foundation for building custom A2A-compatible agent implementations.

  • A2A.Server
    Core server components for building A2A-compatible agents.
    Includes task execution orchestration, state management, event streaming, and agent runtime integration.

  • A2A.Server.Transports.Http
    Implements the HTTP transport for the IA2AServer.
    Enables agent-to-agent communication over HTTP using JSON-RPC 2.0.

  • A2A.Server.Transports.Grpc
    Implements the gRPC transport for the IA2AServer.
    Enables persistent, bidirectional agent-to-agent communication over gRPC connections.

  • A2A.Server.Transports.JsonRpc
    Implements the JSON-RPC transport for the IA2AServer.
    Enables persistent, bidirectional agent-to-agent communication over JSON-RPC connections.

  • A2A.Server.Persistence.Memory
    In-memory implementation of IA2AStore for lightweight, ephemeral task state persistence.

  • A2A.Server.Persistence.Redis Redis-based implementation of IA2AStore for distributed, scalable task state persistence.

  • A2A.Server.Scheduling.Memory
    In-memory task scheduling and queuing implementation.

  • A2A.Server.Scheduling.Quartz
    Quartz-based task scheduling and queuing implementation for advanced scheduling scenarios.


๐Ÿš€ Getting Started

Install the packages

dotnet add package A2A.Core 
dotnet add package A2A.Client.Abstractions
dotnet add package A2A.Client 
dotnet add package A2A.Client.Transports.Http 
dotnet add package A2A.Client.Transports.Grpc
dotnet add package A2A.Client.Transports.JsonRpc
dotnet add package A2A.Server.Abstractions
dotnet add package A2A.Server
dotnet add package A2A.Server.Transports.Http
dotnet add package A2A.Server.Transports.Grpc
dotnet add package A2A.Server.Transports.JsonRpc
dotnet add package A2A.Server.Persistence.Memory
dotnet add package A2A.Server.Persistence.Redis
dotnet add package A2A.Server.Scheduling.Memory
dotnet add package A2A.Server.Scheduling.Quartz

Discover a remote agent

var discoveryDocument = await httpClient.GetA2ADiscoveryDocumentAsync(new Uri("http://localhost"));

Configure and use a client

services.AddA2AClient(client => 
{
  client.UseHttpTransport(new Uri("http://localhost"));
  client.UseGrpcTransport(new Uri("http://localhost:5000"));
  client.UseJsonRpcTransport(new Uri("http://localhost:6000"));
});

Host an agent

Configure services
builder.Services.AddA2AServer(server =>
{
    server
        .Host(agent => agent
            .WithCard(card => card
                .WithName("Sample Agent")
                .WithDescription("An example agent for demonstration purposes.")
                .WithVersion("1.0.0")
                .WithSkill(skill => skill
                    .WithName("Chat")
                    .WithDescription("A skill for engaging in conversations.")
                    .WithTag("chat"))
                .SupportsPushNotifications()
                .SupportsStreaming()
                .SupportsStateTransitionHistory())
                .UseRuntime<ChatAgent>())
            .UseMemoryStore()
            .UseMemoryTaskQueue()
            .UseHttpTransport()
            .UseGrpcTransport()
            .UseJsonRpcTransport("/json-rpc");
});
Configure the application
app.UseA2AServer();
Implement an agent runtime
public class ChatAgent(Kernel kernel)
    : IA2AAgentRuntime
{ 

    public Task<Models.Response> ProcessAsync(Models.Message message, CancellationToken cancellationToken = default)
    {
        var task = new Models.Task()
        {
            ContextId = message.ContextId ?? Guid.NewGuid().ToString("N"),
            History = [message]
        };
        return Task.FromResult<Models.Response>(task);
    }

    public async IAsyncEnumerable<Models.TaskEvent> ExecuteAsync(Models.Task task, [EnumeratorCancellation] CancellationToken cancellationToken = default)
    {
        var chat = kernel.GetRequiredService<IChatClient>();
        var message = task.History?.LastOrDefault() ?? throw new NullReferenceException($"The history of the task with the specified id '{task.Id}' is null or empty.");
        var messageText = string.Join('\n', message.Parts.OfType<Models.TextPart>().Select(p => p.Text));
        var artifactId = Guid.NewGuid().ToString("N");
        var isFirstChunk = true;
        yield return new Models.TaskStatusUpdateEvent()
        {
            ContextId = task.ContextId,
            TaskId = task.Id,
            Status = new()
            {
                State = TaskState.Working,
                Message = new()
                {
                    ContextId = task.ContextId,
                    TaskId = task.Id,
                    Role = Role.Agent,
                    Parts =
                    [
                        new Models.TextPart()
                        {
                            Text = "Processing started by Semantic Kernel Chat Agent."
                        }
                    ]
                }
            }
        };
        var stopwatch = Stopwatch.StartNew();
        await foreach (var content in chat.GetStreamingResponseAsync(messageText, new(), cancellationToken))
        {
            yield return new Models.TaskArtifactUpdateEvent()
            {
                ContextId = task.ContextId,
                TaskId = task.Id,
                Artifact = new() 
                { 
                    ArtifactId = artifactId,
                    Parts = 
                    [            
                        new Models.TextPart() 
                        { 
                            Text = content.Text
                        }
                    ]
                },
                Append = !isFirstChunk
            };
            isFirstChunk = false;
        }
        stopwatch.Stop();
        yield return new Models.TaskStatusUpdateEvent()
        {
            ContextId = task.ContextId,
            TaskId = task.Id,
            Status = new()
            {
                State = TaskState.Completed,
                Message = new()
                {
                    ContextId = task.ContextId,
                    TaskId = task.Id,
                    Role = Role.Agent,
                    Parts =
                    [
                        new Models.TextPart()
                        {
                            Text = $"Processing completed in {stopwatch.ElapsedMilliseconds}ms."
                        }
                    ]
                }
            },
            Final = true
        };
    }

}

๐Ÿ“š Documentation

For a full overview of the A2A protocol, see https://a2a-protocol.org/.


๐Ÿ›  Tools

Explore tools for working with the A2A protocol and ecosystem:

  • Client Console A simple console application that demonstrates how to interact with A2A-compatible agents using the A2A-NET client.
    It allows you to discover agents, send messages, and receive responses over different transports (HTTP, gRPC, JSON-RPC).

๐Ÿงช Samples

Explore sample projects demonstrating how to use the A2A-NET solution:

  • Semantic Kernel
    Demonstrates how to build and host an A2A-compatible agent using Microsoft's Semantic Kernel and OpenAI.
    Includes both a server that exposes the agent and a client that interacts with it over HTTP using the JSON-RPC protocol.

๐ŸŽฏ Key Features

  • ๐Ÿ”„ Protocol Compliance: Full implementation of the A2A protocol
  • ๐Ÿš€ Multiple Transports: HTTP, gRPC and JSON-RPC support for flexible communication patterns
  • ๐Ÿ“Š Task Management: Complete lifecycle management for agent tasks with state persistence
  • ๐Ÿ”” Push Notifications: Configurable push notification system for real-time updates
  • ๐Ÿ“ก Event Streaming: Real-time task event streaming with artifact and status updates
  • ๐Ÿ”Œ Pluggable Architecture: Extensible infrastructure with custom storage and event streaming backends
  • ๐ŸŽญ Agent Discovery: Built-in agent card discovery and metadata resolution

๐Ÿ›ก License

This project is licensed under the Apache-2.0 License.


๐Ÿค Contributing

Contributions are welcome! Please open issues and PRs to help improve the ecosystem.

See contribution guidelines for more information on how to contribute.


๐Ÿ™ Acknowledgments

This project implements the Agent-to-Agent (A2A) protocol specification.
For more information about the A2A protocol, visit https://a2a-protocol.org/.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on a2a-net.Core:

Package Downloads
a2a-net.Server.Infrastructure.Abstractions

Contains service abstractions used by the A2A server infrastructure

a2a-net.Client.Abstractions

Contains the core abstractions and building blocks for an A2A client.

Yaap.A2A.Client.Abstractions

Package Description

Yaap.A2A.Server.Abstractions

Package Description

a2a-net.Core.JsonRpc

Contains the core JSON-RPC abstractions and building blocks of the A2A Protocol.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.12.0 295 12/9/2025
0.10.0 5,557 6/25/2025
0.9.1 301 6/24/2025
0.9.0 289 6/20/2025
0.8.0 455 5/17/2025
0.7.0 351 5/16/2025
0.6.0 359 5/16/2025
0.5.0 466 5/1/2025
0.4.1 541 4/17/2025
0.4.0 352 4/17/2025
0.3.0 340 4/17/2025
0.2.0 359 4/16/2025