Weaving intelligence into the fabric of reality
Loom is a runtime that enables AI agents to continuously sense, reason, and act in the real world. It's built around events instead of requests: events in, actions out, state in the middle. QoS and backpressure keep things real-time; the router chooses local vs cloud intelligently.
Why Loom:
- Native multi-agent collaboration: request/reply, fanout/fanin, contract-net, barrier — powered by Envelope (thread/correlation semantics)
- Event-driven from the ground up: QoS levels, backpressure handling, topic routing with wildcard support
- Polyglot ecosystem: Write agents in Python (loom-py), JavaScript (loom-js, coming), or Rust; Bridge service spans processes and networks
- MCP integration: Connect to Model Context Protocol servers; access filesystems, databases, APIs as native capabilities
- Production-ready: Comprehensive error handling, timeout management, observability hooks, integration tests
- loom-proto — Shared protobuf definitions. We vendor protoc via protoc-bin-vendored in build.rs, so you don't need a system install.
- core (loom-core) — Runtime: Event Bus, Agent Runtime, Router, ActionBroker, Tool Orchestrator, MCP Client, Collaboration primitives, Directories. Depends only on loom-proto.
- loom-audio — Optional audio stack: mic, VAD, STT (whisper.cpp), wake detection, TTS (Piper/espeak-ng). Depends on loom-proto and core.
- bridge — gRPC service for cross-process event/action streaming. Supports RegisterAgent, bidirectional EventStream, ForwardAction, Heartbeat. Enables Python/JS agents to participate in the Loom ecosystem.
- loom-py — Python SDK with Agent/Context API, @capability decorator, Envelope support. Includes trio example (Planner/Researcher/Writer). PyPI-ready (0.1.0a1).
- demo/voice_agent — First complete E2E demo app wiring audio stack through the core runtime.
Dependency directions: loom-proto → core → (optionally) app; loom-audio depends on both loom-proto and core. core does not depend on loom-audio to keep the runtime slim and portable.
See full component breakdown and contracts in docs/ARCHITECTURE.md.
- Start the Bridge server
- Write your agents (see loom-py/examples/trio.py):
- Explore more examples in loom-py/examples/.
- Build the workspace
- Prepare STT/TTS models (optional helper script)
- Run the demo
For advanced setup (local vLLM, Piper voices, environment-only config), see demo/voice_agent/README.md.
See docs/QUICKSTART.md for more Rust examples.
Asynchronous pub/sub with QoS levels (Realtime, Batched, Background), backpressure handling (sampling, dropping, aggregation), and topic routing. Supports thread-based broadcast (thread.{id}.broadcast) and reply topics (thread.{id}.reply).
Actor-based stateful agents with lifecycle management (create/start/stop/delete), dynamic topic subscriptions, persistent state (RocksDB), ephemeral context (in-memory), and mailbox-based event distribution.
Unified metadata envelope for events and actions with reserved keys: thread_id, correlation_id, sender, reply_to, ttl, hop, ts. Enables multi-agent collaboration with automatic TTL/hop management.
Built on top of Envelope:
- request/reply: Correlated request-response with timeout
- fanout/fanin: Broadcast with strategies (any, first_k, majority, timeout)
- barrier: Wait for N agents to check in
- contract-net: Call for proposals, bid collection, award, execution
Unified capability registry and invocation layer. Supports native Rust providers, MCP tools, WASM plugins, and remote capabilities (via Bridge). Standardized error codes: ACTION_OK, ACTION_ERROR, ACTION_TIMEOUT, INVALID_PARAMS, CAPABILITY_ERROR, PROVIDER_UNAVAILABLE.
Connect to Model Context Protocol servers and use their tools as native capabilities:
- JSON-RPC 2.0 over stdio transport
- Auto-discovery and registration of tools
- Qualified naming (server:tool) to avoid conflicts
- Configurable protocol version with validation
- Comprehensive error handling and timeout management
Future enhancements (P1): SSE transport, Resources/Prompts/Sampling APIs, Notifications.
Policy-based routing (Local/Cloud/Hybrid) driven by:
- Privacy policy (public, sensitive, private, local-only)
- Latency budget (ms)
- Cost cap (per-call limit)
- Quality threshold (confidence score)
Logs every routing decision with reason, confidence, estimated latency/cost.
Cross-process event and action forwarding:
- RegisterAgent: External agents (Python/JS) register with topics and capabilities
- EventStream: Bidirectional streaming (publish/receive events)
- ForwardAction: Client-initiated capability invocation
- ActionCall: Server-initiated action push (internal correlation map)
- Heartbeat: Connection health monitoring
Enables polyglot multi-agent systems with Python/JS agents collaborating with Rust agents.
- AgentDirectory: Discover agents by id/topics/capabilities; auto-registers on creation
- CapabilityDirectory: Snapshot of registered providers from ActionBroker; query by name or type
- Storage: RocksDB for agent state; optional Vector DB for long-term memory
- Telemetry: Structured logs, OpenTelemetry tracing, Prometheus metrics (events/sec, latency P50/P99, routing decisions, tool calls)
The audio pipeline (mic/VAD/STT/wake/TTS) lives in loom-audio and is intentionally optional.
- Native Rust providers: Built-in capabilities (WeatherProvider, WebSearchProvider, LlmGenerateProvider)
- MCP tools: Connect to any MCP server (filesystems, databases, APIs)
- WASM sandbox or out-of-process (gRPC) plugins for custom capabilities
- Integrations: vLLM/OpenAI-compatible LLMs, workflow tools (n8n), and more
See docs/INTEGRATIONS.md and docs/MCP.md for details.
P0 (MVS — Minimal Viable System): ✅ Mostly complete
- ✅ Bridge (gRPC) with full lifecycle
- ✅ Python SDK (loom-py) with trio example
- ✅ Collaboration primitives (request/reply, fanout/fanin, contract-net, barrier)
- ✅ MCP Client (stdio transport, auto-discovery, qualified naming)
- ✅ Directories (Agent & Capability)
- 🚧 Dashboard MVP (topology, metrics, swimlanes) — in progress
- 🚧 CLI basics (new/dev/list/bench) — in progress
- 🚧 JS SDK (loom-js) — in progress
P1 (Observable Iteration):
- Dashboard enhancements (histograms, error heatmaps, backpressure gauges)
- CLI templates (voice-assistant, home-automation, etc.)
- Streaming APIs and parallelism (SSE, semaphore, circuit breaker)
- Error taxonomy and unified error_event
- SDK ergonomics (memory plugins, type hints)
- MCP enhancements (SSE transport, Resources/Prompts APIs)
P2 (Ecosystem & Policy):
- MCP server mode (expose Loom capabilities externally)
- Learning-based routing (bandit/RL algorithms)
- Security & multi-tenancy (namespaces, ACLs, audit logs)
- Event persistence & replay (WAL, snapshots, time-travel debugging)
- WASI tool isolation
P3 (Performance & Mobile):
- Mobile/edge packaging (iOS/Android xcframework/AAR)
- Deep performance optimization (lock-free, zero-copy, GPU/NPU)
- Production hardening (graceful degradation, circuit breakers)
See docs/ROADMAP.md for detailed milestones and acceptance criteria.
Component-level documentation in docs/core/:
- docs/core/overview.md — dataflow and system overview
- docs/core/event_bus.md — Event Bus (QoS, backpressure, topic routing)
- docs/core/agent_runtime.md — Agent Runtime (lifecycle, mailboxes, subscriptions)
- docs/core/router.md — Router (policy-based Local/Cloud/Hybrid selection)
- docs/core/action_broker.md — ActionBroker (capability registry and invocation)
- docs/core/llm.md — LLM Client (streaming, retries, provider adapters)
- docs/core/plugin_system.md — Plugin System (WASM, out-of-process)
- docs/core/storage.md — Storage (RocksDB, Vector DB)
- docs/core/telemetry.md — Telemetry (metrics, tracing, structured logs)
- docs/core/envelope.md — Envelope (thread/correlation metadata)
- docs/core/collaboration.md — Collaboration primitives (request/reply, fanout/fanin, contract-net)
- docs/core/directory.md — Directories (agent & capability discovery)
Additional documentation:
- docs/MCP.md — MCP Client guide and configuration
- docs/BRIDGE.md — Bridge protocol and usage
- docs/ROADMAP.md — development roadmap and milestones
- docs/BACKPRESSURE.md — EventBus QoS policies
- docs/EXTENSIBILITY.md, docs/INTEGRATIONS.md, docs/MOBILE.md
Contributions welcome! See CONTRIBUTING.md. We're especially excited about:
- New capability providers (native or MCP integrations)
- SDK ergonomics & examples (loom-py/loom-js)
- Dashboard and observability tools
- Collaboration strategies and patterns
- Documentation improvements
Apache License 2.0 — see LICENSE
Loom — Weaving Intelligence into the Fabric of Reality
.png)

