Every Decision Is Documented.

Architecture decisions are recorded as ADRs in the open repo. No surprises, no lock-in.

Contents

Quick Start

Get WorldMesh Edge running on your device in four simple steps.

Step 1: Install pip install worldmesh-edge
Step 2: Register Device worldmesh-edge register
Step 3: Start Processing worldmesh-edge start --device usb
Step 4: Subscribe to Spatial Events worldmesh-edge stream | jq '.objects'

Your device is now capturing spatial events. Events are serialized in the spatial_event_v0 format and can be consumed by your agents immediately.

Edge CLI Reference

Complete command reference for the WorldMesh Edge service.

Commands

Command Description Common Flags
worldmesh-edge start Start the edge inference service --device-id, --space-id, --privacy-tier, --model
worldmesh-edge register Register a new device with the relay --api-key, --relay-host
worldmesh-edge status View device status, events/sec, inference time --format (json, human)
worldmesh-edge test-camera Test camera connectivity and fps --device-id, --duration

Flags

Flag Type Description
--device-id string (UUID) Unique identifier for this edge device
--space-id string (UUID) WorldMesh space to publish events to
--privacy-tier string ANONYMIZED (default), HASHED, or RAW
--model string yolov8n (default), yolov8s, yolov8m

Schema Reference

The spatial_event_v0 schema defines the structure of all spatial events flowing through WorldMesh.

{ "schema_version": "0.2.0", "event_id": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "timestamp": "2026-04-10T14:35:22.123Z", "space_id": "12345678-1234-5678-1234-567812345678", "device_id": "87654321-4321-8765-4321-876543210987", "privacy_tier": "ANONYMIZED", "objects": [ { "class": "human", "zone": "loading-dock", "movement": "entering", "confidence": 0.94, "carrying_weapon": false, "bbox": { "x": 120, "y": 85, "width": 40, "height": 120 } }, { "class": "vehicle", "zone": "parking-area", "movement": "stationary", "confidence": 0.87, "vehicle_type": "forklift" } ], "frame_meta": { "inference_ms": 94, "model": "yolov8n", "input_fps": 30, "quality": "HD" } }

Field Descriptions

Field Type Description
schema_version string Current schema version (0.2.0)
event_id uuid Unique event identifier
timestamp ISO 8601 Event timestamp in UTC
space_id uuid WorldMesh space identifier
privacy_tier enum ANONYMIZED, HASHED, or RAW
objects array Array of detected spatial objects
frame_meta object Inference metadata and performance

API Endpoints

WorldMesh provides REST and WebSocket APIs for cloud relay integration.

REST API

Method Endpoint Description
POST /api/v1/spaces Create a new space for your deployment
GET /api/v1/spaces/{id} Get space metadata and stats
GET /api/v1/spaces/{id}/events Query events (supports filters and pagination)
POST /api/v1/auth/token Exchange API key for JWT token

WebSocket API

Endpoint Description
WS /api/v1/spaces/{id}/stream Real-time spatial event stream. Connect with auth token, receive events as they occur.

Example: Query Events

curl -X GET "https://api.worldmesh.io/api/v1/spaces/abc123/events" \ -H "Authorization: Bearer YOUR_TOKEN" \ -d "query_params={ 'zone': 'loading-dock', 'class': 'human', 'limit': 100, 'offset': 0 }"

LLM Adapters

Connect WorldMesh spatial events to your favorite LLM framework.

Claude

Use Anthropic's Claude API with WorldMesh spatial context. Built-in vision understanding for spatial events.

from worldmesh import StreamClient from anthropic import Anthropic stream = StreamClient(space_id="...") for event in stream: response = client.messages.create( model="claude-opus-4", messages=[{ "role": "user", "content": f"Analyze: {event}" }] )

OpenAI

GPT-4o with real-time spatial awareness. Stream events directly to function calling.

from worldmesh import StreamClient from openai import OpenAI stream = StreamClient(space_id="...") for event in stream: response = client.chat.completions.create( model="gpt-4o", messages=[{ "role": "system", "content": event.to_json() }] )

Ollama

Run local LLMs with WorldMesh. Perfect for edge deployments and privacy-critical workloads.

from worldmesh import StreamClient import ollama stream = StreamClient(space_id="...") for event in stream: response = ollama.chat( model="mistral", messages=[{ "role": "user", "content": event.to_json() }] )

OpenClaw

Popular AI agent framework with 300k+ GitHub stars. Seamlessly integrate spatial intelligence into your autonomous workflows.

# CLI Integration worldmesh-edge start --adapter openclaw --space-id YOUR_SPACE # Python SDK from worldmesh import StreamClient from openclaw import Agent stream = StreamClient(space_id="...") agent = Agent(name="spatial-agent") for event in stream: context = agent.parse_spatial_event(event) agent.process(context)

Environment Variables

Configure WorldMesh Edge with these environment variables.

Variable Type Description
WORLDMESH_DEVICE_ID uuid Unique device identifier (auto-generated if not set)
WORLDMESH_SPACE_ID uuid Space to publish events to
WORLDMESH_PRIVACY_TIER enum ANONYMIZED (default), HASHED, RAW
WORLDMESH_MQTT_HOST string MQTT broker hostname (e.g., localhost:1883)
WORLDMESH_API_KEY string API key for relay authentication
WORLDMESH_MODEL string YOLOv8 model size (n, s, m)
WORLDMESH_LOG_LEVEL string DEBUG, INFO, WARN, ERROR

Example .env File

WORLDMESH_SPACE_ID=12345678-1234-5678-1234-567812345678 WORLDMESH_PRIVACY_TIER=ANONYMIZED WORLDMESH_MQTT_HOST=mqtt.worldmesh.io:1883 WORLDMESH_API_KEY=sk-project-xxxxxxxxxxxxxxxxxxxxx WORLDMESH_MODEL=yolov8n WORLDMESH_LOG_LEVEL=INFO

Docker Quick Start

Deploy the full WorldMesh stack (edge + relay) using Docker Compose.

docker-compose.yml

version: '3.8' services: mqtt: image: eclipse-mosquitto:latest ports: - "1883:1883" volumes: - mqtt_data:/mosquitto/data relay: image: worldmesh/relay:latest ports: - "8080:8080" environment: - MQTT_HOST=mqtt:1883 - API_PORT=8080 depends_on: - mqtt volumes: - relay_data:/app/data edge: image: worldmesh/edge:latest environment: - WORLDMESH_SPACE_ID=demo-space - WORLDMESH_MQTT_HOST=mqtt:1883 - WORLDMESH_PRIVACY_TIER=ANONYMIZED devices: - /dev/video0:/dev/video0 depends_on: - mqtt volumes: mqtt_data: relay_data:

Start the Stack

Run docker-compose up -d

Your WorldMesh deployment is now running. Access the relay at http://localhost:8080

SDK Installation

Install WorldMesh SDKs for your preferred programming language.

Python

# Install via pip pip install worldmesh-edge # Or with optional dependencies pip install worldmesh-edge[all] # Verify installation worldmesh-edge --version

JavaScript / Node.js

# Install via npm npm install @worldmesh/client # Or via yarn yarn add @worldmesh/client # Verify installation node -e "console.log(require('@worldmesh/client').version)"

Go

# Install via go get go get github.com/worldmesh/go-client # Import in your code import "github.com/worldmesh/go-client/worldmesh"

Rust

# Add to Cargo.toml [dependencies] worldmesh = "0.2.0" # Or via cargo add cargo add worldmesh

Java

<dependency> <groupId>io.worldmesh</groupId> <artifactId>worldmesh-client</artifactId> <version>0.2.0</version> </dependency> implementation 'io.worldmesh:worldmesh-client:0.2.0'

C# / .NET

# Install via NuGet dotnet add package WorldMesh.Client # Or via Package Manager Console Install-Package WorldMesh.Client

Interactive API Explorer

Test API endpoints directly from your browser. Requires authentication token.

Try It Now

Note: This is a demo explorer. Replace YOUR_API_GATEWAY_URL with your actual API endpoint in production.

Changelog

Version history and release notes for WorldMesh protocol and SDKs.

v0.2.0

2026-04-15
Current

Added

  • WebSocket API for real-time event streaming
  • Multi-language SDK support (Python, JavaScript, Go, Rust, Java, C#)
  • Enhanced privacy tier controls (PUBLIC, ANONYMIZED, ABSTRACTED)
  • Safety invariant: carrying_weapon survives all tiers

Changed

  • Improved edge inference performance (94ms → 87ms on Raspberry Pi 4)
  • Updated schema with frame_meta object
  • Enhanced face anonymization with 15% region expansion

Fixed

  • MQTT reconnection handling in edge runtime
  • Memory leak in long-running inference loops

v0.1.0

2026-02-01

Added

  • Initial protocol specification (spatial_event_v0.json)
  • Python edge runtime with YOLOv8n inference
  • MQTT transport layer
  • Basic face anonymization pipeline
  • REST API for space management
  • TimescaleDB integration for event storage

v0.0.1

2025-12-10

Added

  • Proof of concept: edge object detection
  • Initial schema draft
  • Project inception and architecture planning