net-mesh 0.34.0

High-performance, schema-agnostic, backend-agnostic event bus
Documentation

Net

High-performance encrypted mesh runtime — the engine crate.

Most people should depend on a SDK, not on this crate directly:

cargo add net-mesh-sdk                       # Rust
npm install @net-mesh/sdk @net-mesh/core     # TypeScript / Node
pip install net-mesh-sdk                     # Python
go get github.com/ai-2070/net/go             # Go

Docs: https://ai2070.net/docs · Concepts · API reference · Design philosophy and benchmarks

Architecture

The protocol-level docs live alongside this crate, in docs/. They describe what the wire actually does — the level below the user-facing guides on the docs site.

Doc Covers
TRANSPORT.md Wire format, the 64-byte header, encryption, packet pools, sessions, fair scheduling, multi-hop forwarding, routing, reliability, adaptive batching, failure detection, NAT traversal, swarm discovery
IDENTITY.md Entity identity, origin binding, permission tokens and delegation
CHANNELS.md Named hierarchical channels and capability-based authorization
ORGANIZATIONS.md Org identity, admission modes, private discovery, revocation floors
BEHAVIOR.md Capability announcements and indexing, diffs, node metadata, schema registry, autonomy rules, context fabric, load balancing, proximity graph, safety envelopes
SUBNETS.md The four-level subnet hierarchy and gateway visibility
SUBPROTOCOLS.md The subprotocol registry, ID space, version negotiation, opaque forwarding
STORAGE_AND_CORTEX.md RedEX logs, CortEX folds, NetDB, durability
COMPUTE.md Daemons, capability-based placement, six-phase migration
DATAFORTS.md Greedy caching, data gravity, content-addressed blobs, directory transfer
STATE.md Distributed state
SENSING.md Capability sensing and interest coalescing
CONTINUITY.md Observational continuity
CONTESTED.md Contested environments
CONFIG_REPLICATION.md RedEX replication configuration
CAPABILITIES_SCHEMA.md The canonical capability axis schema — CI fails on drift
AGENT_TOOLS.md AI tool calling
cli/ net transfer, net-mesh typegen

Design plans, code reviews and audits are in docs/internal/ at the repo root — working history, not documentation.

Features

No features are enabled by default. Opt in explicitly.

Feature Flag Dependencies
Redis Streams redis redis
NATS JetStream jetstream async-nats
Net transport net chacha20poly1305, snow, blake2, dashmap, socket2, ed25519-dalek
NAT traversal (classifier + rendezvous + connect_direct) nat-traversal net
Port mapping (NAT-PMP inlined + UPnP-IGD) port-mapping nat-traversal, igd-next
Regex filters regex regex
C FFI ffi
RedEX (local append-only log) redex net, tokio-stream, postcard
RedEX disk durability redex-disk redex
CortEX (adapter core + tasks + memories) cortex redex
NetDB (unified query façade) netdb cortex
Dataforts (greedy + gravity + blob + RYW) dataforts cortex, blake3, xxhash-rust
MeshDB (federated query AST + planner + executor) meshdb cortex
MeshOS (cluster-behavior engine + behavior snapshot) meshos cortex

Building

cargo build --release                      # core only, no adapters
cargo build --release --features net       # transport only (~2 MB)
cargo build --release --features redis     # + Redis adapter
cargo build --release --all-features       # everything

Tests

cargo test --all-features --lib            # unit tests

Integration suites are per-feature — --test three_node_integration --features net, --test integration_redex --features "redex redex-disk", --test integration_netdb --features netdb, and so on. See tests/ for the full set, and .github/workflows/ci.yml for the matrix CI actually runs.

Benchmarks

cargo bench --all-features

See BENCHMARKS.md for published numbers and methodology.

Claude Code Skill

Net looks like Kafka or NATS from the outside, and the model underneath is different enough that an agent working from surface familiarity will write integration code that runs and is quietly wrong. Install the skills first:

npx skills add ai-2070/net-claude-skill -g

Drop -g to install into the current project only. To update to the latest version:

npx skills update -g

Restart Claude Code and run /skillsnet-event-bus and net-payments should be listed. Full install options in Claude Skills.

Give the agent the source too

opensrc is a small tool that fetches a package's real source into a local cache for exactly this purpose:

npx -y opensrc@latest path ai-2070/net

Links

Docs · Concepts · API reference · GitHub

License

MIT OR Apache-2.0

Third-party license notice

The default net feature links ring for the packet-path ChaCha20-Poly1305 AEAD. ring is distributed under an ISC-style license together with notices for portions derived from BoringSSL and OpenSSL/SSLeay; see the ring LICENSE for the full text. Binary distributions that bundle the compiled library (the published Python wheels, npm prebuilds, Go FFI static libraries, and release binaries) include ring's object code and should retain that notice alongside their own license files.