Python coupling kernel for Mesh Cognition — per-field admission and state blending for CfC neural networks
Project description
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 agentsNeuralCoupler— 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mesh_cognition-1.2.0.tar.gz.
File metadata
- Download URL: mesh_cognition-1.2.0.tar.gz
- Upload date:
- Size: 10.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
049d73f83fd0c09e5f15b3e4f17fe5937a59125c8c52c9a65437795057b3f071
|
|
| MD5 |
4e7735fb78699716e14c64c6d060f785
|
|
| BLAKE2b-256 |
836a84dbd64eccc3fece0394ac23ed2742dc96813e0704fdc2a47f03d0628fae
|
File details
Details for the file mesh_cognition-1.2.0-py3-none-any.whl.
File metadata
- Download URL: mesh_cognition-1.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d1de6ea87b9d02c86f00d98dfb247887e011eddfe1cd61e20aaf5f457880723
|
|
| MD5 |
5c3c0b5b01d2cc196d966cd46395de8e
|
|
| BLAKE2b-256 |
1db3284b4d3c600abf723c0c673bcd5588dc28ce85a4a5f5039f38a31c53b163
|