Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
ra2a
Comprehensive Rust SDK for the Agent2Agent (A2A) Protocol — client transport, server framework, streaming, gRPC, and multi-backend task storage.
ra2a implements the full A2A protocol specification (v0.3.0) with an idiomatic Rust API — Axum server middleware, reqwest-based client, SSE streaming, gRPC transport, push notifications, and pluggable SQL storage backends. For the upstream protocol specification, see google/A2A.
See Security before using in production.
Quick Start
Add ra2a to your project:
Build an Agent (Server)
use async_trait;
use ;
async
Talk to an Agent (Client)
use ;
async
Feature Flags
Feature flags keep compile-time dependencies minimal — enable only what you need:
| Flag | Default | Description |
|---|---|---|
client |
yes | HTTP/JSON-RPC client, SSE streaming, card resolver, middleware |
server |
yes | Axum HTTP server, event queue, task lifecycle, REST + SSE endpoints |
grpc |
— | gRPC transport via tonic/prost (requires protobuf) |
telemetry |
— | OpenTelemetry tracing spans and metrics |
postgresql |
— | PostgreSQL task store via sqlx |
mysql |
— | MySQL task store via sqlx |
sqlite |
— | SQLite task store via sqlx |
sql |
— | All SQL backends (postgresql + mysql + sqlite) |
full |
— | Everything (server + grpc + telemetry + sql) |
# Server with PostgreSQL storage and telemetry
= { = "0.4", = ["server", "postgresql", "telemetry"] }
# Client only
= { = "0.4", = false, = ["client"] }
# Everything
= { = "0.4", = ["full"] }
Design
| Aspect | Detail |
|---|---|
| Protocol version | A2A v0.3.0 |
| Transport | HTTP/JSON-RPC + SSE streaming + gRPC |
| Server framework | Axum with Tower middleware |
| Client | reqwest + reqwest-eventsource (SSE) |
| Task storage | In-memory (default), PostgreSQL, MySQL, SQLite |
| Authentication | HMAC-SHA256 push notification verification |
| Serialization | serde (JSON) + prost (protobuf) |
| Async runtime | tokio |
| Linting | pedantic + nursery (warn), correctness (deny) |
Examples
Run the built-in examples to see ra2a in action:
# Start the server
# In another terminal, run the client
Security
See SECURITY.md for disclaimers, supported versions, and vulnerability reporting.
Acknowledgments
- Agent2Agent Protocol Specification — protocol design by Google
- google/A2A — official reference implementations (Python, TypeScript)
License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT License (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project shall be dual-licensed as above, without any additional terms or conditions.