a2a-go

a2a-go

Golang SDK for A2A Protocol

Stars: 241

Visit
 screenshot

A2A Go SDK is a Go library for running agentic applications as A2A Servers, following the Agent2Agent (A2A) Protocol. It allows users to build agentic applications that adhere to the A2A Protocol and easily add support for different communication protocols and database backends. The SDK provides examples for creating A2A servers and clients, along with detailed documentation and more examples in the a2a-samples repository. Contributions are welcome, and the project is licensed under the Apache 2.0 License.

README:

A2A Go SDK

License Nightly Check Go Doc Ask DeepWiki

A2A Logo

A Go library for running agentic applications as A2A Servers, following the Agent2Agent (A2A) Protocol.


✨ Features

  • A2A Protocol Compliant: Build agentic applications that adhere to the Agent2Agent (A2A) Protocol.
  • Extensible: Easily add support for different communication protocols and database backends.

🚀 Getting Started

Requires Go 1.24.4 or newer:

go get github.com/a2aproject/a2a-go

Visit pkg.go for a full documentation.

Examples

For a simple example refer to the helloworld example.

Server

For a full documentation visit pkg.go.dev/a2asrv.

  1. Create a transport-agnostic A2A request handler:

    var options []a2asrv.RequestHandlerOption = newCustomOptions()
    var agentExecutor a2asrv.AgentExecutor = newCustomAgentExecutor()
    requestHandler := a2asrv.NewHandler(agentExecutor, options...)
  2. Wrap the handler into a transport implementation:

    grpcHandler := a2agrpc.NewHandler(requestHandler)
    
    // or
    
    jsonrpcHandler := a2asrv.NewJSONRPCHandler(requestHandler)
  3. Register handler with a server, for example:

    import "google.golang.org/grpc"
    ...
    server := grpc.NewServer()
    grpcHandler.RegisterWith(server)
    err := server.Serve(listener)

Client

For a full documentation visit pkg.go.dev/a2aclient.

  1. Resolve an AgentCard to get an information about how an agent is exposed.

    card, err := agentcard.DefaultResolver.Resolve(ctx)
  2. Create a transport-agnostic client from the AgentCard:

    var options a2aclient.FactoryOption = newCustomClientOptions()
    client, err := a2aclient.NewFromCard(ctx, card, options...)
  3. The connection is now open and can be used to send requests to a server:

    msg := a2a.NewMessage(a2a.MessageRoleUser, a2a.TextPart{Text: "..."})
    resp, err := client.SendMessage(ctx, &a2a.MessageSendParams{Message: msg})

🌐 More Examples

You can find a variety of more detailed examples in the a2a-samples repository.


🤝 Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines on how to get involved.

Before starting work on a new feature or significant change, please open an issue to discuss your proposed approach with the maintainers. This helps ensure your contribution aligns with the project's goals and prevents duplicated effort or wasted work.


📄 License

This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for a2a-go

Similar Open Source Tools

For similar tasks

For similar jobs