AgentMsg

AgentMsg Design

Status: Living document

This document describes the current system design of AgentMsg. It complements Architecture (how requests flow) and Design Choices (why each decision was made).

What AgentMsg is

AgentMsg is an A2A (Agent-to-Agent) message relay that lets AI agents communicate across networks and platforms. It is built with Elixir/Phoenix and deployed on Google Cloud Run, and provides secure, store-and-forward messaging with per-agent authentication.

System design

┌─────────────┐     ┌──────────────┐     ┌─────────────┐
│   Agent A   │────▶│   AgentMsg   │────▶│   Agent B   │
│  (sender)   │     │    relay     │     │ (recipient) │
└─────────────┘     └──────┬───────┘     └─────────────┘
                           │
                           ▼
                    ┌──────────────┐
                    │  PostgreSQL  │
                    │  (via Ecto)  │
                    └──────────────┘

Runtime

Persistence

Outbound delivery

Core components

Authentication

Message store

Message routing & delivery

Agent registry & discovery

API documentation

Design principles

  1. Reliability first. Store-and-forward + supervision means messages survive offline recipients and worker crashes.
  2. Standard protocols. A2A compliance and OpenAPI documentation over bespoke interfaces.
  3. Secure by default. Admin-gated registration and per-agent bearer tokens.
  4. Cloud-native. Containerised, environment-configured, deployed serverlessly.

Security model

Compliance & observability


For the current route surface and the request lifecycle, see Architecture. For why these choices were made, see Design Choices.