Skip to main content

mesh-cognition

Python coupling kernel for Mesh Cognition — per-field admission and state blending for CfC neural networks.

A pure-Python library that turns any agent running a continuous-time neural network into a Mesh Cognition node. Each agent evaluates incoming peer state per neuron and decides locally whether, how much, and which dimensions to couple.

Canonical home: meshcognition.org · Protocol spec: meshcognition.org/spec/mmp

Install

pip install mesh-cognition

Zero external dependencies. Python ≥ 3.10.

Quick start

from mesh_cognition import MeshNode

# Create a node matching your model's hidden dimension
node = MeshNode(hidden_dim=64)

# After each inference step — update local state
node.update_local_state(new_h1, new_h2, confidence=0.8)

# Receive peer state (from network, another agent, etc.)
node.add_peer("peer-1", peer_h1, peer_h2, confidence=0.9)

# Before next inference — get coupled state
h1, h2 = node.coupled_state()
# Feed h1, h2 into your next inference step

# Inspect what the agent decided
print(node.coherence)             # Kuramoto r(t): 0 = desynced, 1 = locked in sync
print(node.coupling_decisions)    # per-peer: aligned / guarded / rejected

How it works

For each peer, the agent evaluates per-neuron drift:

Outcome Drift band Behavior
aligned ≤ 0.25 strong coupling — agent admits peer state
guarded 0.25 – 0.5 reduced coupling — admitted with lowered weight
rejected > 0.5 no coupling — peer state discarded for this dimension

Each hidden dimension is gated independently. The agent decides locally; no central coordinator.

Two modes

  • SemanticCoupler (default) — cosine drift, suitable for shared-memory or LLM-style agents
  • NeuralCoupler — per-neuron time constants τ, real Kuramoto order parameter r(t), tuned for CfC (closed-form continuous-time) models
from mesh_cognition import MeshNode, NeuralCouplingConfig

# Neural mode using tau from a trained CfC model
node = MeshNode(hidden_dim=64, config=NeuralCouplingConfig(tau=model_tau))

Same API surface for both modes.

Where this fits

This package implements the per-agent admission + state-blending behavior — the cognition kernel. Wire-protocol concerns (identity, transport, peer discovery, CMB serialization) are handled by other Mesh Memory Protocol implementations. Bring your own networking; let this library handle the math of coupling.

For the full protocol specification, see meshcognition.org/spec/mmp.

License

Apache 2.0. © 2026 SYM.BOT Ltd.

Metadata

Release files for mesh-cognition 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mesh-cognition 1.2.0
File Size Uploaded
mesh_cognition-1.2.0.tar.gz 10.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mesh-cognition 1.2.0
File Interpreter ABI Platform
mesh_cognition-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / mesh_cognition-1.2.0.tar.gz

Download URL mesh_cognition-1.2.0.tar.gz
Size 10.1 kB
Tags Source
SHA-256 checksum
How to use checksums
049d73f83fd0c09e5f15b3e4f17fe5937a59125c8c52c9a65437795057b3f071
BLAKE2b-256 checksum
How to use checksums
836a84dbd64eccc3fece0394ac23ed2742dc96813e0704fdc2a47f03d0628fae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / mesh_cognition-1.2.0-py3-none-any.whl

Download URL mesh_cognition-1.2.0-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3d1de6ea87b9d02c86f00d98dfb247887e011eddfe1cd61e20aaf5f457880723
BLAKE2b-256 checksum
How to use checksums
1db3284b4d3c600abf723c0c673bcd5588dc28ce85a4a5f5039f38a31c53b163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page