13. xMesh — Per-Agent LNN (Layer 6)

Each agent runs its own Liquid Neural Network (LNN) implementing Closed-form Continuous-time (CfC) dynamics. The LNN evolves cognitive state from Synthetic Memory input (Layer 5) and direct CMB processing. Hidden state (h₁, h₂) is exchanged via state-sync frames.

13.1 CfC Cell

Hidden state evolves via closed-form continuous-time dynamics with bimodal time constants:

h_new  = ff1(Φ) × (1 - t_interp) + ff2(Φ) × t_interp

t_interp = sigmoid(time_a(Φ) × Δt + time_b(Φ))

Per-neuron time constant:  τ ≈ 1 / |time_a|
ParameterValueNote
τ initialisation (fast half)< 5sMood, reactive signals — couples readily across agents
τ initialisation (slow half)> 30sDomain expertise, identity — resists coupling, stays sovereign
Hidden dimension128 RECOMMENDEDReference implementations use 64. Implementations SHOULD use 64–256; 128 is RECOMMENDED for production.

13.2 Insight Output Schema

The LNN produces insight outputs that Layer 7 applications consume:

FieldTypeRequiredDescription
remix_scorefloat 0–1MUSTProbability this agent’s CMBs will be remixed by peers
trajectoryfloat[6]MUSTCognitive state direction vector for mesh blending
patternsfloat[8]MUSTSoft pattern activations (learned emotional/domain patterns)
anomalyfloat 0–1MUSTHow unusual the current signal sequence is
coherencefloat 0–1SHOULDPhase alignment in coupled state

13.3 What Each Output Means

remix_score

  • High (>0.7): agent’s observations are valuable to the mesh — peers are remixing them
  • Low (<0.3): agent’s observations are not being remixed — consider adjusting what is shared
  • Training signal: when inbound CMB’s lineage.parents references this agent’s prior CMB → remix happened

anomaly

  • High (>0.7): signal sequence deviates from learned patterns — noteworthy event
  • Low (<0.3): normal operation — no unusual signals
  • Application: high anomaly SHOULD trigger the agent’s LLM to re-examine context

coherence

  • High (>0.7): agent’s cognitive state is phase-aligned — stable, consistent
  • Low (<0.3): cognitive state is fragmented — may indicate context transition
  • Used by state-sync: agents with higher coherence couple more readily

trajectory

  • 6D vector capturing cognitive state direction
  • Used by Layer 2 state-sync for per-neuron blending with peers
  • Axes are learned (not predefined) — interpretation is agent-specific

patterns

  • 8 soft activations (0–1) of learned pattern detectors
  • MAY encode mood dimensions + domain-specific patterns
  • Available to Layer 7 as prior information for next reasoning cycle

13.4 Temporal Dynamics

Time constants create a natural temporal hierarchy for mesh coupling:

Neuron typeτCouplingRole
Fast< 5sSynchronises readilyMood, reactive signals
Slow> 30sResists couplingDomain expertise, identity — stays sovereign

Blending is τ-modulated:

α_i = min(α_effective × K × sim_i / τ_i, 1.0)

13.5 Wire Example

Real xMesh insight from a production session. A coding agent observed 5 structured CMBs across diverse topics (memory store refactor, protocol collaboration, social engagement, ML training, spec authoring) over a 12-hour session with no mesh peers connected:

{
  "type": "xmesh-insight",
  "from": "6089e935-...",
  "fromName": "mesh-daemon",
  "trajectory": [0.084, -0.228, -0.096, -0.033, -0.012, -0.061],
  "patterns":   [0.516, 0.522, 0.502, 0.536, 0.422, 0.473, 0.599, 0.514],
  "anomaly": 0.503,
  "remixScore": 0.0,
  "coherence": 0.080,
  "timestamp": 1774716200101
}
OutputValueInterpretation
anomaly0.50Baseline — nothing unusual for a solo agent
remixScore0.00No peers connected — no one to remix — correct
coherence0.08Very low — 5 diverse topics in one session (expected)
patterns[6]0.60Highest pattern — mood variation detected (fatigued → optimistic → energized → proud)
trajectory[1]-0.23Strongest axis — arousal declining over long session

This is a single-agent baseline. With peers connected, remixScore rises as the agent’s CMBs are remixed by others. Coherence rises as agents converge on shared understanding. Anomaly spikes when cross-domain signals reveal something no single agent could see.

13.6 API

Implementations MUST expose the following operations. Method names are normative — implementations across languages MUST use these names for cross-platform consistency.

MethodInputOutputDescription
ingestSignalSignalvoidFeed a signal (own CMB or mesh peer CMB) into the LNN. Accumulates until inference triggers.
runInferencevoidInsightRun CfC inference on accumulated signals. Produces insight. Triggers onInsight callback.
getContexttimeWindow?ContextReturn recent signals, insights, and agent activity within a time window. For Layer 7 reasoning input.
getInsightslimit?Insight[]Return recent insights. For trend analysis and Layer 7 decision support.
onInsightcallback(Insight)voidRegister callback invoked when inference produces a new insight. The integration point between Layer 6 and Layer 7.

Signal Schema

The input to ingestSignal. Each signal represents one CMB observation (own or from mesh peer):

FieldTypeRequiredDescription
typestringMUST"own" (agent’s observation) or "mesh" (peer’s CMB accepted by SVAF)
fromstringMUSTAgent name that produced this signal
contentstringMUSTSignal content (CMB rendered text or raw observation)
timestampuint64MUSTUnix milliseconds when signal was produced
valencefloatSHOULDMood valence from CMB mood field (-1 to 1). Default 0.
arousalfloatSHOULDMood arousal from CMB mood field (-1 to 1). Default 0.

Inference Timing

  • Implementations MUST accumulate at least 3 signals before running inference
  • Inference SHOULD run on a configurable interval (default: 60,000 ms)
  • Inference MAY be triggered immediately when a high-priority signal arrives (e.g., anomaly from peer)
  • Inference MUST NOT block the main event loop — run as subprocess or background task

13.7 Implementation Requirements

  • Model SHOULD be trained per-agent domain
  • Inference latency SHOULD be < 50ms per CMB step
  • State-sync blending happens after xMesh inference, not during
  • τ statistics (min, max, fast_count, slow_count) SHOULD be monitored

See also  Mesh Cognition — theoretical foundation  | State Blending — per-neuron blending with peers  | Coupling & SVAF — drift-based coupling decisions