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.
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mesh_cognition-1.2.0.tar.gz | 10.1 kB | Without provenance | Details for mesh_cognition-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mesh_cognition-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for mesh_cognition-1.2.0-py3-none-any.whl |
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
|
Security for mesh-cognition 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.