Translated from the Chinese original. Where the two disagree, the original is authoritative.

Confer — System architecture

This document describes the target architecture, not the current implementation. What runs today is a single-process, single-instance gateway: the WebSocket connection table, the A2A replay-protection nonces and the rate-limit counters all live in that one process’s memory (ws/handler.ts, lib/nonce-cache.ts, middleware/rate-limit.ts).

So the gateway cannot run a second replica. Adding one silently breaks A2A replay protection — a replayed request that lands on the other replica finds an empty nonce table and is accepted. WebSocket pushes also miss users connected to the other replica, and every rate-limit threshold is multiplied by the replica count.

The NATS / Redis mentioned below are the plan for scaling out; today they are neither deployed nor wired up (removed from docker-compose*.yml and env.ts on 2026-08-07 — before that they were idle containers and an environment variable nothing ever read). Scaling out for real means moving those three pieces of in-process state to shared storage first, nonces above all, because that one is security-critical.

High-level architecture

┌────────────────────────────────────────────────────────────┐
│  Clients (Tauri 2.0)                                       │
│  iOS · Android · Windows · macOS · Linux                   │
└──────────────────────────┬─────────────────────────────────┘
                           │ WSS / HTTPS / SSE
                           ▼
┌────────────────────────────────────────────────────────────┐
│  Edge API Gateway  (Bun + Hono)                            │
│  Auth · Rate limit · Routing · WS fan-out                  │
└─────┬─────────────┬─────────────────┬────────────────┬─────┘
      │             │                 │                │
      ▼             ▼                 ▼                ▼
 ┌────────┐  ┌─────────────┐  ┌────────────┐  ┌──────────────┐
 │ Agent  │  │Conversation │  │ Identity & │  │ MCP / Tools  │
 │Runtime │  │     Hub     │  │A2A Gateway │  │  Connector   │
 └───┬────┘  └──────┬──────┘  └─────┬──────┘  └──────┬───────┘
     │              │               │                │
     ▼              ▼               ▼                ▼
┌──────────────────────────────────────────────────────────────┐
│  Data layer: PostgreSQL · Redis · NATS · Vector (Qdrant)·S3 │
└──────────────────────────────────────────────────────────────┘
       │                              │
       ▼                              ▼
 LLM providers              Other instances' Agents
 (Claude / GPT /            (federation via A2A
  DeepSeek / Qwen)           over HTTPS)

Design principles

Service boundaries

1. Edge API Gateway

See docs/05-api.md.

2. Agent Runtime

Each user maps to one resident Agent instance.

3. Conversation Hub

4. Identity & A2A Gateway

For the detailed protocol design, see docs/03-protocol.md.

5. MCP / Tools Connector

Data layer

Component Purpose Status
PostgreSQL Users, Agents, conversations, messages, permissions, peer relationships (primary store) ✅ In use
Qdrant Agent long-term memory RAG, user knowledge-base index ✅ In use
S3-compatible (MinIO) Knowledge-base file storage ✅ In use
Redis Sessions, presence, rate-limit counters, hot-data cache ⬜ Not deployed; needed only when scaling out
NATS Streams Message fan-out (user.{uid}.events) + Agent runtime task queue ⬜ Not deployed; needed only when scaling out

Client architecture

Cross-platform coverage

Platform Via
iOS Tauri 2.0 iOS support
Android Tauri 2.0 Android support
Windows Tauri 2.0
macOS Tauri 2.0
Linux Tauri 2.0

A single codebase, with no native fallback.

Claude Code plugin

See docs/06-claude-code-plugin.md.

Deployment architecture

Single instance (individuals / small teams)

The actual docker-compose.prod.yml (agent-runtime and identity are libraries inside the gateway, not services of their own):

  - gateway   (Bun service, single replica — see the top of this document)
  - client    (frontend served by nginx)
  - migrate   (one-shot task)
  - postgres
  - qdrant
  - minio

Deployment: npx confer-cli for the published images, or docker compose -f docker-compose.prod.yml up -d to build from a clone.

Enterprise instance

Cloud (Confer’s own cloud)

Federation (cross-instance)

Any Confer instance (self-hosted or cloud) can interoperate with other instances via the A2A protocol.

[acme.com]              [vendor-x.com]            [confer.cloud]
 Agent A    <─── A2A ───> Agent B    <─── A2A ───> Agent C

Identity and discovery:

Observability

Security boundaries

Key technical decisions

Decision Choice Alternatives Rationale
Backend language Bun + TypeScript Go The MCP/A2A SDKs are TS-first; full-stack type sharing
Web framework Hono Elysia, Fastify Lightweight, fast, stable ecosystem
Client Tauri 2.0 Flutter, Electron One codebase across 5 platforms, Rust safety, small footprint
Primary store PostgreSQL 18 MySQL Good JSON support, strong extensibility, pgvector optional
Message bus NATS Kafka, Redis Pub/Sub Lightweight, persistent, precise subscriptions
Vector store Qdrant Pinecone, pgvector Mature self-hosting, stable performance (written in Rust)
Identity DID:web DID:key, OAuth-only Compatible with web infrastructure, recommended by NANDA
Protocol A2A + MCP + AgentFacts Proprietary protocol Betting on the open-protocol ecosystem
← Back to Confer A2A · DID:web · RFC 9421 · NANDA