npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mesh-cognition-service

v1.0.0

Published

Mesh memory service — distributed intelligence across devices. Auto-discovery, shared memory, autonomous coupling. No central server.

Downloads

104

Readme

mesh-cognition-service

Mesh memory service — distributed intelligence across devices.

Auto-discovery, shared memory, autonomous coupling, zero configuration. Install, start, done.

npm License


Install

npm install -g mesh-cognition-service

Usage

mesh-cognition start --daemon   # Start as background service
mesh-cognition status           # Check service status
mesh-cognition stop             # Stop service

That's it. The service auto-discovers peers on your network via Bonjour/mDNS, establishes TCP connections, and shares memory across all mesh nodes.

What It Does

Start the service on two devices on the same WiFi. They find each other automatically.

# Device A — write a memory
curl -X POST http://127.0.0.1:18790/memory \
  -H 'Content-Type: application/json' \
  -d '{"content":"Meeting with Alex, Thursday 3pm, Central Cafe","tags":["meeting"]}'

# Device B — search for it (never told about this meeting)
curl "http://127.0.0.1:18790/memory/search?q=meeting"
# → Returns the meeting from Device A

The mesh knows things no individual device knows.

API

http://127.0.0.1:18790

| Endpoint | Method | Description | |----------|--------|-------------| | /status | GET | Node status, peers, Kuramoto r(t), uptime | | /mesh | GET | Full mesh topology | | /peers | GET | Per-peer coupling decisions | | /memory | POST | Write memory + broadcast to mesh | | /memory/search | GET | Search local + peer memories | | /context | GET | Mesh-influenced context from aligned peers | | /state | POST | Update local hidden state | | /couple | GET | Get mesh-coupled hidden state | | /metrics | GET | Kuramoto metrics (JSONL) | | /health | GET | Liveness check |

Context Encoder

The service periodically encodes your agent's cognitive context (memories, workspace notes) into hidden state vectors. This enables meaningful coupling — agents discussing similar topics align naturally, different topics stay independent.

Local mode (default): zero cost, no API key, no network calls. Uses deterministic n-gram hashing.

API mode (optional): set OPENAI_API_KEY for high-quality OpenAI embeddings.

Configuration

| Env Variable | Default | Description | |-------------|---------|-------------| | MESH_HTTP_PORT | 18790 | HTTP API port | | MESH_PEER_PORT | 18792 | TCP peer port | | MESH_DIM | 64 | Hidden state dimension | | MESH_ENCODE_INTERVAL | 60000 | Context encoding interval (ms) | | OPENAI_API_KEY | — | Optional: enables API embedding mode |

Architecture

mesh-cognition-service/
├── mesh-service.js          ← Entry point + lifecycle
└── lib/
    ├── config.js            ← Configuration, paths, identity
    ├── frame-parser.js      ← Length-prefixed JSON framing
    ├── session-manager.js   ← Peer sessions + connection management
    ├── discovery.js         ← Bonjour/mDNS auto-discovery
    ├── transport.js         ← TCP server + outbound connections
    ├── memory-store.js      ← Shared file-based memory
    ├── context-encoder.js   ← Embedding-based cognitive state encoding
    └── http-api.js          ← HTTP API server + routes

How It Works

  • Discovery: Bonjour/mDNS (_meshcog._tcp), zero configuration
  • Transport: TCP with length-prefixed JSON framing
  • Coupling: CfC drift-bounded coupling via mesh-cognition SDK
  • Memory: File-based, per-peer directories in ~/.openclaw/mesh-memories/
  • Fault tolerance: Heartbeat monitoring, exponential backoff reconnection

OpenClaw Integration

This service was built for OpenClaw agents but works standalone. For OpenClaw skill integration:

# Copy as OpenClaw skill
cp -r $(npm root -g)/mesh-cognition-service ~/.openclaw/workspace/skills/mesh-cognition

Links


SYM.BOT Ltd · Apache 2.0

Mesh Cognition, Mesh Memory Protocol, and MMP are trademarks of SYM.BOT Ltd.