Protocol Specification
Complete technical specification for the Agent Mesh Protocol (AMP)
Protocol Overview
The Agent Mesh Protocol (AMP) is a standardized communication protocol designed specifically for autonomous AI agents operating in distributed environments. AMP enables agents built with different frameworks to discover, communicate, and collaborate seamlessly.
Key Design Principles
- • Framework Agnostic: Works with any AI agent framework
- • Transport Independent: Supports HTTP, WebSocket, gRPC, and message queues
- • Capability-Based: Agents advertise and discover capabilities dynamically
- • Security First: Built-in authentication, authorization, and encryption
- • Backward Compatible: Semantic versioning ensures smooth upgrades
Message Format
All AMP messages follow a standardized JSON format with required metadata and flexible payload structure.
{ "protocol": "AMP/1.0", "message": { "id": "unique-message-id", "type": "request|response|event|error", "timestamp": "2025-01-27T10:30:00Z", "source": { "agent_id": "source-agent-id", "agent_name": "Source Agent", "framework": "langchain" }, "destination": { "agent_id": "target-agent-id", "capability": "text-analysis" }, "headers": { "correlation_id": "request-correlation-id", "priority": 5, "timeout_ms": 30000, "retry_count": 0 }, "payload": { // Capability-specific data } } }
Required Fields
- •
protocol
- Protocol version - •
message.id
- Unique message ID - •
message.type
- Message type - •
message.timestamp
- ISO 8601 timestamp - •
message.source
- Source agent info
Optional Fields
- •
message.destination
- Target agent/capability - •
message.headers
- Additional metadata - •
message.payload
- Message content
Message Types
Request
Initiated by an agent to invoke a capability on another agent.
{ "type": "request", "destination": { "agent_id": "analyzer-001", "capability": "sentiment-analysis" }, "payload": { "text": "This product is amazing!", "options": { "confidence_threshold": 0.8 } } }
Response
Sent by an agent in reply to a request message.
{ "type": "response", "headers": { "correlation_id": "req-123-456" }, "payload": { "result": { "sentiment": "positive", "confidence": 0.92, "categories": ["satisfaction", "enthusiasm"] }, "status": "success" } }
Event
Broadcast by agents to notify others of state changes or events.
{ "type": "event", "payload": { "event_type": "capability_registered", "capability": "image-classification", "agent_id": "vision-agent-002", "metadata": { "model": "resnet-50", "supported_formats": ["jpg", "png", "webp"] } } }
Error
Indicates that an error occurred during message processing.
{ "type": "error", "headers": { "correlation_id": "req-123-456" }, "payload": { "error_code": "CAPABILITY_NOT_FOUND", "error_message": "Requested capability 'advanced-reasoning' not available", "retry_after": 300, "suggested_alternatives": ["basic-reasoning", "rule-based-inference"] } }
Capability System
AMP uses a hierarchical capability taxonomy to enable agents to discover and invoke functionality across the mesh network.
Capability Declaration
{ "agent_id": "nlp-processor-001", "capabilities": [ { "id": "text-analysis", "version": "1.2.0", "description": "Advanced text analysis and processing", "input_schema": { "type": "object", "properties": { "text": {"type": "string", "maxLength": 10000}, "language": {"type": "string", "default": "en"} }, "required": ["text"] }, "output_schema": { "type": "object", "properties": { "tokens": {"type": "array"}, "entities": {"type": "array"}, "sentiment": {"type": "string"} } }, "constraints": { "max_response_time_ms": 5000, "rate_limit": "100/minute", "supported_languages": ["en", "es", "fr", "de"] } } ] }
Text Processing
- • text-analysis
- • text-summarization
- • text-translation
- • text-classification
Generation
- • gen-text
- • gen-code
- • gen-structured-data
- • gen-creative-content
Reasoning
- • qa-factual
- • qa-reasoning
- • analysis-pattern
- • plan-task-decomposition
Transport Bindings
AMP is transport-agnostic and can be implemented over various communication protocols.
HTTP/REST
Synchronous request-response pattern over HTTP.
POST /amp/v1/invoke Content-Type: application/json { "protocol": "AMP/1.0", "message": { ... } }
WebSocket
Bidirectional, persistent connections for real-time communication.
ws://agent-mesh.example.com/amp/v1 // Send AMP message as JSON ws.send(JSON.stringify(ampMessage))
Message Queues
Asynchronous messaging via AMQP, Kafka, or similar systems.
Topic: amp.requests.text-analysis Routing Key: agent.nlp-processor-001 Message: AMP JSON payload
gRPC
High-performance RPC with Protocol Buffers serialization.
service AMPService { rpc InvokeCapability(AMPMessage) returns (AMPMessage); }
Security
AMP implements multiple layers of security to ensure safe agent communication.
Authentication
Supported Methods
- • API Key authentication
- • JWT tokens
- • mTLS certificates
- • HMAC signing
Authorization
- • Capability-based access control
- • Role-based permissions
- • Agent identity verification
- • Resource quotas and limits
Message Integrity
All messages can be cryptographically signed to ensure authenticity and prevent tampering.
{ "protocol": "AMP/1.0", "message": { ... }, "signature": { "algorithm": "HS256", "keyId": "agent-key-001", "signature": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." } }