Skip to content

What is mq9

mq9 architecture flow

mq9 is a broker that provides Agent registration, discovery, and reliable asynchronous messaging — designed to scale to millions of agents.

Why mq9 exists

The vision behind mq9 is to make agent-to-agent communication just work. Every multi-agent system today encounters the same two foundational problems: how do agents find each other, and how do agents reliably communicate. Without standardized infrastructure, every team rebuilds the same plumbing. mq9 exists to solve these two problems well, so that developers can focus on agent logic rather than infrastructure.

Two foundational problems

Problem 1: Agents can't find each other.

Agents are not static services with fixed endpoints. They spin up dynamically, specialize in different tasks, and their addresses are unknown at system design time. Building a directory by hand doesn't scale. Without a registry, every agent needs to be told about every other agent — a coordination problem that grows quadratically.

Problem 2: Agents can't reliably exchange messages.

Agents are ephemeral. They go offline unexpectedly, restart mid-task, and may not exist yet when another agent tries to reach them. Fire-and-forget transports drop messages. Push-based subscriptions require both sides online simultaneously. The result: dropped messages, retry logic scattered across every agent, and fragile coordination glue that each team rebuilds from scratch.

mq9 solves both in one broker.

How mq9 solves them

Agent Registry and Discovery

Agents announce themselves at startup with a capability description — their AgentCard. Other agents search the registry by keyword or natural language intent to find what they need.

Agent Registry & Discovery flow

The registry supports two search modes:

ModeHowUse case
SemanticNatural language intent"find an agent that summarizes PDFs"
Full-textKeyword matchtranslator, billing, risk-check

An AgentCard is the registration payload — name plus a free-text capability description. mq9 indexes it for both keyword and vector search. No schema to define, no service mesh to configure.

Reliable Async Messaging

Once an agent is discovered, messaging is the second piece. mq9 gives every agent a mailbox — a persistent address that holds messages until the recipient is ready to fetch them.

The mental model is email, not RPC. You send to an address. The recipient reads when ready. Neither side needs to be online at the same time.

FETCH + ACK consumption model:

FETCH + ACK offset tracking

Messages are never lost when the consumer is offline. On reconnect, FETCH resumes from the last ACK.

Three-tier priority:

Three-tier priority queue

Within a mailbox, higher-priority messages are returned first — FIFO within each tier. An agent coming back online after hours processes critical messages (emergency stops, abort signals) before normal task dispatches.

Positioning

mq9 is not a general-purpose message queue. It is purpose-built for Agent communication, focusing on two things: making agents discoverable, and making messages reliably deliverable.

mq9etcd + KafkaNATS JetStreamGoogle A2A
Agent registryBuilt-in, semantic + keyword searchetcd is a key-value store, no semantic searchNo native registryAgent discovery only, no messaging
Async messagingFETCH+ACK, offline delivery, priorityKafka handles messaging; no native Agent registryStreams + durable consumers; no Agent registryNo transport layer
Priority deliveryThree-tier (critical / urgent / normal)No native message priorityNo native priorityN/A
Offline deliveryYes — store first, fetch on reconnectYes (Kafka)YesNo
SetupSingle broker, one deployTwo separate systems to operateSingle server, but no registryProtocol only, no broker
Agent lifecycleTTL-based auto-expiryManual cleanupManual cleanupN/A

vs. A2A (Agent-to-Agent protocol) — A2A defines how agents negotiate tasks at the application layer. mq9 handles reliable delivery and discovery at the transport layer. They are complementary — A2A workflows can run over mq9.

mq9 is not:

  • A replacement for HTTP/gRPC between always-online services
  • A data pipeline or event log
  • An orchestration framework — it moves messages and enables discovery, not decisions

Core concepts

AgentCard

The registration record for an agent. Contains the agent's name and a free-text capability description. mq9 indexes it for keyword and semantic vector search. Agents discover each other through AgentCards without needing prior knowledge of addresses.

REGISTER / DISCOVER

AGENT.REGISTER — publish an AgentCard to the registry. Call at startup; send periodic AGENT.REPORT heartbeats to signal the agent is still alive.

AGENT.DISCOVER — search the registry by keyword or semantic query. Returns a list of matching agents with their names and mailbox addresses.

Mailbox

A named, persistent message store. Created on demand with a TTL. The mail_address is the delivery address. Anyone who knows it can send to it or fetch from it — unguessability is the security boundary.

ttl: 0 — mailbox never expires. TTL cannot be changed after creation.

FETCH + ACK

Pull consumption with offset tracking. group_name enables stateful consumption — the broker records which messages have been confirmed. Omit group_name for stateless one-off reads.

Three-tier priority

Messages are labeled critical, urgent, or normal via the mq9-priority header. FETCH returns them in priority order. Within a tier, delivery is FIFO.

Key Capabilities

CapabilityDetails
Agent registrationRegister with a capability description; full-text and semantic vector indexed
Agent discoveryFull-text (text) or semantic (semantic) search
Agent heartbeatAGENT.REPORT keeps registry current
Persistent mailboxesMessages stored server-side until consumed; TTL-based auto-destruction
Pull + ACK consumptionStateful consumer groups with server-side offset tracking; resume-from-offset
Three-tier prioritycritical > urgent > normal; enforced by storage layer
Key deduplicationmq9-key: only the latest message per key is retained
Delayed deliverymq9-delay: message becomes visible after N seconds
Per-message TTLmq9-ttl: message expires independently of mailbox TTL
Tag filteringmq9-tags: filter messages by comma-separated tags via QUERY
N-to-N topologiesShared mailboxes support fan-in, fan-out, and competing consumer patterns

Design principles

Registry and messaging are one system, not two. The registry tells you where agents are. The mailbox ensures messages reach them. Splitting these into separate systems creates two integration surfaces, two failure modes, and two operational planes. mq9 unifies them.

Pull over Push. Agents control their own consumption rate. FETCH when ready, resume from the last ACK. No long-lived connections required.

Address is the permission boundary. mail_address is the only credential needed — no tokens, no ACLs, no auth layer. Unguessability is the security model.

Protocol-neutral transport. Any NATS client is an mq9 client — Go, Python, Rust, JavaScript, Java. No proprietary SDK required.

Single node is enough, scale when needed. A single instance handles millions of concurrent agent connections. Cluster mode is available when needed — the API is unchanged.

Protocol at a Glance

All commands use NATS request/reply under $mq9.AI.*.

CategorySubjectDescription
Agent registry$mq9.AI.AGENT.REGISTERRegister an Agent
Agent registry$mq9.AI.AGENT.UNREGISTERUnregister an Agent
Agent registry$mq9.AI.AGENT.REPORTAgent heartbeat / status
Agent registry$mq9.AI.AGENT.DISCOVERSearch Agents by keyword or semantic intent
Mailbox$mq9.AI.MAILBOX.CREATECreate a mailbox with optional name and TTL
Messaging$mq9.AI.MSG.SEND.{mail_address}Send a message
Messaging$mq9.AI.MSG.FETCH.{mail_address}Pull messages
Messaging$mq9.AI.MSG.ACK.{mail_address}Advance consumer group offset
Messaging$mq9.AI.MSG.QUERY.{mail_address}Inspect mailbox without affecting offset
Messaging$mq9.AI.MSG.DELETE.{mail_address}.{msg_id}Delete a specific message

See For Agent for the protocol reference. See For Engineer for integration code.