Protocol v2 (Current)
Agent Protocol v2 is the recommended protocol for new agent deployments. It provides enhanced features for production environments.
Key Features
| Feature | Description |
|---|---|
| Connection Pooling | Maintain multiple connections per agent with load balancing |
| Multiple Transports | gRPC, Binary UDS, and Reverse Connections |
| Request Cancellation | Cancel in-flight requests when clients disconnect |
| Reverse Connections | Agents connect to proxy (NAT traversal) |
| Enhanced Observability | Built-in metrics export in Prometheus format |
| Config Push | Push configuration updates to capable agents |
Documentation
| Page | Description |
|---|---|
| Protocol Specification | Wire protocol, message types, and streaming |
| API Reference | AgentPool, client, and server APIs |
| Connection Pooling | Load balancing and circuit breakers |
| Transport Options | gRPC, UDS, and Reverse comparison |
| Reverse Connections | NAT traversal and agent-initiated connections |
| Performance Benchmarks | Latency, throughput, and optimization results |
| Migration Guide | Migrate from v1 to v2 |
Quick Start
use ;
use Duration;
let config = AgentPoolConfig ;
let pool = with_config;
// Add agents (transport auto-detected)
pool.add_agent.await?; // gRPC
pool.add_agent.await?; // UDS
Version Comparison
| Feature | v1 | v2 |
|---|---|---|
| Transport | UDS (JSON), gRPC | UDS (binary), gRPC, Reverse |
| Connection pooling | No | Yes (4 strategies) |
| Bidirectional streaming | Limited | Full support |
| Metrics export | No | Prometheus format |
| Config push | No | Yes |
| Health tracking | Basic | Comprehensive |
| Flow control | No | Yes |
| Request cancellation | No | Yes |