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|
| Parameter | Value | Note |
|---|---|---|
| τ initialisation (fast half) | < 5s | Mood, reactive signals — couples readily across agents |
| τ initialisation (slow half) | > 30s | Domain expertise, identity — resists coupling, stays sovereign |
| Hidden dimension | 128 RECOMMENDED | Reference 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:
| Field | Type | Required | Description |
|---|---|---|---|
| remix_score | float 0–1 | MUST | Probability this agent’s CMBs will be remixed by peers |
| trajectory | float[6] | MUST | Cognitive state direction vector for mesh blending |
| patterns | float[8] | MUST | Soft pattern activations (learned emotional/domain patterns) |
| anomaly | float 0–1 | MUST | How unusual the current signal sequence is |
| coherence | float 0–1 | SHOULD | Phase 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.parentsreferences 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 | τ | Coupling | Role |
|---|---|---|---|
| Fast | < 5s | Synchronises readily | Mood, reactive signals |
| Slow | > 30s | Resists coupling | Domain 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
}| Output | Value | Interpretation |
|---|---|---|
| anomaly | 0.50 | Baseline — nothing unusual for a solo agent |
| remixScore | 0.00 | No peers connected — no one to remix — correct |
| coherence | 0.08 | Very low — 5 diverse topics in one session (expected) |
| patterns[6] | 0.60 | Highest pattern — mood variation detected (fatigued → optimistic → energized → proud) |
| trajectory[1] | -0.23 | Strongest 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.
| Method | Input | Output | Description |
|---|---|---|---|
| ingestSignal | Signal | void | Feed a signal (own CMB or mesh peer CMB) into the LNN. Accumulates until inference triggers. |
| runInference | void | Insight | Run CfC inference on accumulated signals. Produces insight. Triggers onInsight callback. |
| getContext | timeWindow? | Context | Return recent signals, insights, and agent activity within a time window. For Layer 7 reasoning input. |
| getInsights | limit? | Insight[] | Return recent insights. For trend analysis and Layer 7 decision support. |
| onInsight | callback(Insight) | void | Register 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):
| Field | Type | Required | Description |
|---|---|---|---|
| type | string | MUST | "own" (agent’s observation) or "mesh" (peer’s CMB accepted by SVAF) |
| from | string | MUST | Agent name that produced this signal |
| content | string | MUST | Signal content (CMB rendered text or raw observation) |
| timestamp | uint64 | MUST | Unix milliseconds when signal was produced |
| valence | float | SHOULD | Mood valence from CMB mood field (-1 to 1). Default 0. |
| arousal | float | SHOULD | Mood 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