Signature
← Back to Overview

MAXIM

Agent Mesh & Cooperative Intelligence

Sovereign Agents, Cooperative Network

Design Philosophy

Every Maxim instance is a sovereign agent. It owns its hippocampus, its causal models (NAc), its semantic concepts (ATL), its learned significance weights, and its tool registry. No other agent can modify its state directly.

Cooperation happens through four verbs:

Sharing

"Here's what I learned" — serialized CausalLinks, reflections, or motor programs sent as gifts. The receiver decides what to keep.

Requesting

"Can you do this?" — delegated goals with results returned. The receiver evaluates with its own planner.

Querying

"What do you know about X?" — read-only queries against peer memory. Never returns raw dumps.

Advertising

"Here's what I can do" — capability broadcasts via heartbeat. Statistics only, not the actual data.

Identity & Discovery

Each agent carries two layers of identity. AgentProfile is the lightweight local identity (nickname, role, capabilities) used by in-process agents like the research protocol's Writer and Reviewer. AgentIdentity extends it with hardware capabilities, knowledge statistics, and inference info for network coordination.

What's Broadcast

  • Node ID — persistent across restarts (saved to disk), stable address for peer tracking
  • Available tools & skills — what this agent can do (used for delegation routing)
  • Knowledge statistics — episodic memory count, causal link count, top tools by success rate
  • Inference models — what LLMs are loaded, whether inference is available
  • Embodiment summary — body modalities and affordances (when embodied)

The identity shares statistics about knowledge, not the knowledge itself. A peer sees "500 episodes, high-confidence grasp patterns" — not the actual memories.

Transport Layer

The PeerChannel implements the same Channel interface as SMS and voice, so mesh messages flow through CommunicationGateway. Sends are queued to a background thread — callers never block on network I/O.

Send Path send_mesh() → Queue (maxsize=1000) → Background Thread → HTTP POST /v1/mesh/message ↓ retry on failure Exponential backoff: 1s, 2s, 4s (3 attempts) Receive Path POST /v1/mesh/message → MeshMessage.from_dict() → protocol_version check ↓ PeerChannel.receive() ↓ Percept on agent bus (salience=0.7)

The wire protocol uses MeshMessage — a typed envelope with 24 message types covering discovery, delegation, knowledge sharing, prediction, and inference routing. A protocol_version field ensures peers running different Maxim versions can detect incompatibilities.

Admission Control

MeshAdmissionControl protects agents from flooding. Every incoming message is checked before dispatch. Peers that exceed rate limits accumulate violations with escalating gate durations.

Trust LevelRate LimitHow Established
Verified120 msg/minPre-shared key
Discovered60 msg/minmDNS (future)
Remote60 msg/minTunnel auth
Unknown20 msg/minNo auth

Burst detection triggers at 20 messages in 5 seconds. Gate durations escalate: 30s → 2min → 10min → 1hr. Gated peers receive 429 responses and are skipped by the distributed planner.

Knowledge Sharing

Knowledge sharing uses a provider/receiver protocol. Any subsystem can participate by implementing two simple interfaces. The ExperienceBroker routes between them without knowing subsystem specifics.

Protocol KnowledgeProvider — get_shareable(limit, **filters) → list[dict] KnowledgeReceiver — import_knowledge(data, source, trust) → bool Broker ExperienceBroker.register_provider(nac_provider) ExperienceBroker.register_receiver(nac_receiver) ExperienceBroker.get_shareable("causal_link") → [{knowledge_type: ..., ...}] ExperienceBroker.import_knowledge("causal_link", data, "peer-A", "verified")

Built-in Adapters

Causal Links

Wraps NAc. Exports high-confidence links (≥0.6, 3+ observations). Imports with trust-level transfer discount (0.5× for verified, 0.1× for unknown).

Reflections

Wraps Hippocampus. Exports memories with reflection text. Imports with trust-level salience caps (0.5 for verified, 0.15 for unknown).

Motor Programs

Wraps ProgramRegistry. Exports battle-tested programs (3+ executions, ≥50% success). Requires verified/discovered trust. Validates entity paths against local embodiment.

Future adapters (DN thresholds, forward models, contacts) register the same way — no broker changes needed.

Task Delegation

One agent can propose a goal to another. The TaskDelegator picks the best peer by tool availability and success rate. The TaskReceiver evaluates proposals using local NAc predictions and queue depth.

Safety Mechanisms

  • Loop detection — Goals carry delegation_depth (max 2) and delegation_chain (cycle detection)
  • Queue limits — Max 5 concurrent delegations per agent
  • NAc veto — Rejects if local NAc predicts failure with >70% confidence
  • Gated peer skip — Misbehaving peers are excluded from delegation routing

Distributed Planning

The AdaptivePlanner's _tag_delegatable_subgoals() runs after LLM decomposition. It checks each sub-goal against peer capabilities and tags actions with _preferred_node when a peer is better suited:

  • Remote-only tools — peer has the tool, we don't → always delegate
  • Better success rate — peer has >80% success and local NAc predicts <50% → delegate

Clock Synchronization

The PeerClockEstimator learns per-peer clock offsets using heartbeat round-trip times (NTP-lite). Offsets are smoothed with an EMA and stabilize after ~10 sync points.

The SCN's register_external() corrects incoming TemporalSignatures before registration, ensuring temporal bins align across agents with different system clocks. The phase-normalized indexing is naturally resistant to small offsets — skew only matters when it shifts a memory into the wrong hour bin (>30 minutes).

API Endpoints

The mesh mounts under the existing LeaderProxy, inheriting authentication, rate limiting, and GPU metrics. Three endpoints handle all mesh traffic:

EndpointMethodPurpose
/v1/mesh/messagePOSTSend a MeshMessage to this agent (checked by MeshAdmissionControl)
/v1/mesh/peersGETList all known peers from PeerRegistry (read-only)
/v1/mesh/statusGETAdmission control state — per-peer trust, violations, gate status

The PeerRegistry bootstraps from the existing peer config file (tunnel URL + API key) or can be populated via mDNS discovery (future). Peers are tracked by persistent node_id, updated on each heartbeat exchange.

Trust Model

TrustKnowledge DiscountMotor ProgramsRate Limit
Verified0.5×Accepted120/min
Discovered0.3×Accepted60/min
Remote0.3×Rejected60/min
Unknown0.1×Rejected20/min

Locally-learned knowledge always dominates. Imported data is a prior, not a replacement — as the local agent observes the same patterns, confidence grows organically through its own experience.