Skip to content

Commit 955828c

Browse files
authored
docs(spec): add RPC vs messaging section, SLIM SRPC, and A2A advantages (broadcast RPC, streaming, idempotency, MLS E2E) (#10)
Signed-off-by: Luca Muscariello <muscariello@ieee.org>
1 parent f404f25 commit 955828c

File tree

1 file changed

+130
-5
lines changed

1 file changed

+130
-5
lines changed

draft-agntcy-messaging-ecosystem.md

Lines changed: 130 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,26 @@ author:
3737

3838
--- abstract
3939

40-
Agentic AI systems require messaging infrastructure that supports real-time collaboration, high-volume streaming, and dynamic group coordination across distributed networks. Traditional protocols like AMQP, MQTT, and NATS address some requirements but fall short on security, particularly regarding post-compromise protection and quantum-safe encryption essential for autonomous agents handling sensitive data.
41-
42-
This document analyzes six messaging protocols—AMQP, MQTT, NATS, AMQP over WebSockets, Kafka, and AGNTCY SLIM—across dimensions critical for GenAI agent systems: streaming performance, delivery guarantees, security models, and operational complexity. We examine how each protocol's design decisions impact agentic AI deployments, from lightweight edge computing scenarios to large-scale multi-organizational collaborations.
43-
44-
AGNTCY SLIM emerges as a purpose-built solution, integrating Message Layer Security (MLS) with gRPC over HTTP/2 to provide quantum-safe end-to-end encryption, efficient streaming, and OAuth-based authentication. Unlike transport-layer security approaches, SLIM's MLS implementation ensures secure communication even through untrusted intermediaries while supporting dynamic group membership changes essential for collaborative AI agents.
40+
Agentic AI systems require messaging infrastructure that supports real-time
41+
collaboration, high-volume streaming, and dynamic group coordination across
42+
distributed networks. Traditional protocols like AMQP, MQTT, and NATS address
43+
some requirements but fall short on security, particularly regarding
44+
post-compromise protection and quantum-safe encryption essential for autonomous
45+
agents handling sensitive data.
46+
47+
This document analyzes six messaging protocols—AMQP, MQTT, NATS, AMQP over
48+
WebSockets, Kafka, and AGNTCY SLIM—across dimensions critical for GenAI agent
49+
systems: streaming performance, delivery guarantees, security models, and
50+
operational complexity. We examine how each protocol's design decisions impact
51+
agentic AI deployments, from lightweight edge computing scenarios to large-scale
52+
multi-organizational collaborations.
53+
54+
AGNTCY SLIM emerges as a purpose-built solution, integrating Message Layer
55+
Security (MLS) with gRPC over HTTP/2 to provide quantum-safe end-to-end
56+
encryption, efficient streaming, and OAuth-based authentication. Unlike
57+
transport-layer security approaches, SLIM's MLS implementation ensures secure
58+
communication even through untrusted intermediaries while supporting dynamic
59+
group membership changes essential for collaborative AI agents.
4560

4661
--- middle
4762

@@ -356,6 +371,116 @@ hierarchy and optional message persistence support regulatory requirements,
356371
while the end-to-end encryption provides compliance with data protection
357372
regulations.
358373

374+
# RPC in Agentic Protocols and Relationship to Messaging
375+
376+
Most agent-facing interfaces in use today — notably A2A and the Model Context
377+
Protocol (MCP) — are Remote Procedure Call (RPC) oriented. They expose
378+
synchronous request/response semantics for tool invocation, resource listing,
379+
and capability execution. This section clarifies how RPC relates to asynchronous
380+
messaging and how the two paradigms interoperate in agentic systems.
381+
382+
## RPC vs. Messaging: Synchronous vs. Asynchronous
383+
384+
- **RPC (A2A, MCP)**: Caller issues a request and blocks/awaits a timely
385+
response. Semantics emphasize tightly scoped operations (for example, “call tool
386+
X with parameters Y”) with bounded latency and explicit error contracts.
387+
- **Messaging (AMQP, MQTT, NATS, Kafka, SLIM)**: Decoupled producers/consumers
388+
communicate via topics/subjects/queues. Delivery can be one-to-one, one-to-many,
389+
or many-to-many with loose coupling, buffering, and retries. Producers are not
390+
inherently blocked by consumers.
391+
392+
In practice, agentic applications need both: synchronous tool invocations for
393+
interactivity and asynchronous channels for streaming output, progress,
394+
coordination, and fan-out/fan-in patterns.
395+
396+
## When Asynchronous Feels Synchronous (Interactive Real-Time)
397+
398+
Asynchronous transports can provide an interactive, “RPC-like” experience when:
399+
- A request message includes a correlation ID and reply-to destination.
400+
- The callee publishes a response on the indicated reply destination within a short SLA.
401+
- Client libraries surface responses as futures/promises and manage timeouts/retries.
402+
403+
This underpins instant messaging UX and maps well to agent UIs where a user
404+
triggers an action and expects prompt, possibly streaming, results.
405+
406+
## Bridging Patterns: RPC over Messaging and Streaming RPC
407+
408+
- **Request/Reply over Pub/Sub**: Implement RPC by publishing a command event
409+
and awaiting a correlated reply event (applies to AMQP, NATS, MQTT, and SLIM
410+
topics).
411+
- **Streaming RPC**: Use bidirectional streams (for example, gRPC over SLIM
412+
HTTP/2/3) to deliver token streams, partial results, or progress updates while
413+
retaining an RPC caller experience.
414+
- **Sagas and CQRS**: For multi-step workflows across agents, coordinate via
415+
asynchronous orchestration with idempotency keys, correlation/causation IDs, and
416+
compensations.
417+
- **Backpressure and Flow Control**: Prefer streaming transports (HTTP/2/3,
418+
gRPC) or messaging systems with flow control when returning large/continuous
419+
results.
420+
421+
## A2A and MCP in Context
422+
423+
- **A2A Agent Cards**: Describe capabilities/endpoints commonly invoked via
424+
RPC-style calls (tool execution, configuration). They benefit from messaging for
425+
discovery, eventing, and long-running workflows.
426+
- **MCP**: Standardizes RPC-like interactions (resources, tools, prompts). For
427+
multi-party sessions, combine MCP RPC with a messaging layer for broadcast,
428+
presence, and coordination.
429+
430+
431+
## SLIM RPC (SRPC)
432+
433+
SLIM also supports a native RPC style via SRPC (Slim RPC), which layers
434+
request/response semantics on top of SLIM's interactive, real-time messaging.
435+
SRPC addresses practical RPC concerns in distributed agent systems:
436+
437+
- Correlation and reply routing for synchronous calls over an async transport
438+
- Idempotency keys and deduplication to make retries safe
439+
- Lightweight synchronization/ordering guarantees for request/response and streaming
440+
- Seamless fit for A2A/MCP-style tool calls while retaining SLIM's MLS security and multiplexing
441+
442+
See SRPC reference and examples: [SLIM RPC (SRPC) README](https://github.com/agntcy/slim/blob/main/data-plane/python/integrations/slimrpc/README.md).
443+
444+
## Advantages of SLIM for A2A APIs
445+
446+
SLIM augments existing A2A-style RPC with capabilities that are difficult to
447+
achieve over plain request/response transports:
448+
449+
- **Simultaneous fan-out RPC (scatter-gather)**: Invoke a single RPC across many
450+
agents (by topic/group/labels) concurrently and aggregate responses
451+
(first-success, quorum, all-success) with correlation IDs.
452+
- **Group addressing and dynamic membership**: Target MLS-secured groups;
453+
add/remove agents without reconfiguring endpoints.
454+
- **Streaming responses**: Return partial results or token streams from each
455+
agent over a single multiplexed connection (gRPC over HTTP/2/3).
456+
- **Idempotency and safe retries**: SRPC supports idempotency keys and
457+
deduplication, enabling robust retry without duplicating effects.
458+
- **QoS, deadlines, and backpressure**: Apply delivery guarantees, per-call
459+
timeouts, and flow control to avoid overload while maintaining interactivity.
460+
- **End-to-end security and multi-tenant isolation**: MLS E2E encryption and
461+
OAuth-based policy across both RPC and messaging channels.
462+
- **Observability and tracing**: Correlation/causation IDs and standardized
463+
transport enable distributed tracing and per-agent metrics.
464+
465+
These capabilities let A2A-style tool calls scale beyond one-to-one
466+
interactions, enabling broadcast queries, coordinated multi-agent actions, and
467+
efficient collection of results in real time.
468+
469+
## Security Implications
470+
471+
- **Identity and Authorization**: Reuse OAuth tokens across RPC (gRPC) and
472+
messaging (SLIM channels as topics) for consistent policy enforcement.
473+
- **End-to-End Security**: MLS-backed secure channels (SLIM) so both RPC and
474+
messaging inherit end to end message encryption.
475+
## Guidance: When to Choose What
476+
477+
- Use **RPC (A2A/MCP)** for low-latency, point operations with immediate
478+
feedback and well-defined error contracts.
479+
- Use **Messaging** for broadcast/fan-out, decoupling, retries, buffering, and
480+
multi-party coordination.
481+
- Use **Streaming RPC or RPC over Messaging** for interactive UX with
482+
partial/continuous results or uncertain duration operations.
483+
359484
# Comparison
360485

361486
Table 1 provides a detailed comparison of three popular messaging protocols commonly considered for agent communication systems:

0 commit comments

Comments
 (0)