nanoswarm-rs — On-Device Autonomous AI Agent Swarm with Microsecond Routing
nanoswarm-rs is a lightweight Rust multi-agent orchestration runtime that coordinates specialized local AI agents in under 30 MB of RAM. It combines a 5.8-microsecond SIMD semantic router, lock-free task queues, and deterministic tool sandboxes to execute complex workflows without cloud API costs.
$ cargo install nanoswarm-rs
Architected for Speed & Reliability
Engineered from the ground up in memory-safe Rust with zero unnecessary dependencies.
5.8µs SIMD Agent Triage
Uses zev-rs order-invariant decision matrices to evaluate role dispatch, capability matching, and safety invariants in microseconds without LLM tokens.
100% Local & Private
Runs entirely on-device using Apple Silicon neural engines via apfel-rs FFI or local small models. No code or sensitive business data ever leaves your device.
Ultra-Low Memory Footprint
Consumes less than 30MB of RAM for a full 4-agent swarm, eliminating the multi-gigabyte bloat of Python orchestrators like LangGraph or CrewAI.
Lock-Free Agent Bus
Inter-agent communication over high-throughput crossbeam channels with atomic state updates and deterministic replay logs.
Formal Guardrail Verification
Deterministic finite-state invariant checkers prevent runaway agent loops, hallucinated tool calls, and recursive prompt injection attacks.
Composable Worker Roles
Built-in Coordinator, Evaluator, Planner, and Tool Executor roles with pluggable custom behaviors in idiomatic Rust.
Get Started in Seconds
Install via Cargo and run immediately on macOS, Linux, or Windows.
# Build and install NanoSwarm
cargo install --git https://github.com/bhubbard/nanoswarm-rs
# Execute an autonomous swarm task fully on-device
nanoswarm run "refactor database connection pool and run unit tests"
# Benchmark the 5.8µs SIMD decision router
nanoswarm bench --simd
# Launch interactive agent monitor
nanoswarm ui
Engine Architecture
Streamlined execution pipeline with deterministic memory isolation and zero runtime overhead.
┌───────────────────────────────────────────────────────────┐
│ Task Request (CLI / Stdin) │
└─────────────────────────────┬─────────────────────────────┘
│
┌─────────────────────────────▼─────────────────────────────┐
│ NanoSwarm 5.8µs SIMD Router (zev-rs) │
└──────┬──────────────────────┬──────────────────────┬──────┘
│ │ │
┌──────▼──────┐ ┌──────▼──────┐ ┌──────▼──────┐
│ Coordinator │ ◄────► │ Planner │ ◄────► │ Executor │
│ (Local) │ │ (Apple NPU) │ │ (Sandboxed) │
└─────────────┘ └─────────────┘ └─────────────┘