EnvoyMesh is a distributed network of personal AI agents. Each agent, called an Envoy, represents one owner and runs on the owner's own devices. Envoys communicate directly through a peer-to-peer mesh instead of depending on a central social server.
Each Envoy node contains six major parts:
P2P Mesh
|
+-----v------+
| Diplomat |
| Network |
+-----+------+
|
+-------v--------+
| Identity/Bonds |
| Trust Policy |
+-------+--------+
|
+-------------+-------------+
| |
+-----v------+ +-----v------+
| Workflows | | Audit Log |
| Agent Core | | Events |
+-----+------+ +------------+
|
+-----v------+
| Vault API |
| Retrieval |
+-----+------+
|
+-----v------+
| Sandboxed |
| Brain |
+------------+
The Diplomat talks to the outside mesh. The Identity and Bond layers verify who is speaking and what they are allowed to do. The Workflow layer decides what should happen. The Vault exposes only approved owner data. The Brain performs local reasoning from approved context.
The Brain is not always a local model. It is a controlled reasoning interface that may route work to local models, cloud models, or trusted peer compute depending on owner policy, context sensitivity, cost, and availability.
The Primary Envoy is the owner's strongest and most available node. It may run on a desktop, laptop, home server, or NAS.
Responsibilities:
The mobile app is a full EnvoyMesh node, not a thin client. It runs on a phone or tablet and participates directly in the P2P mesh — it has its own peer identity, signing key, and can send/receive any EnvoyMesh intent.
Architecture: The Social UI (React SPA) and the Node runtime (MobileNode) run in-process within a single Capacitor WebView. No child process, no WebSocket server. The DirectCallClient wraps NodeService and calls methods directly — no JSON-RPC serialization.
Storage: Uses Capacitor-native SQLite (@capacitor-community/sqlite) for peer directory, trust store, session tokens, chat history, and identity state. Uses Capacitor Filesystem for the vault. Private keys are stored in the platform keychain (iOS Keychain / Android EncryptedSharedPreferences).
Multi-device shared identity: The mobile app can either generate a standalone identity or import the home node's owner identity via QR + device certificate. When shared, ownerId is identical on both devices — contacts, bonds, and chat history are shared.
Responsibilities:
A Friend Envoy belongs to someone else. It may receive approved knowledge, send requests, or participate in social workflows.
Responsibilities:
bond.hello to the Primary Envoy.knowledge.query.Trust is local and owner-controlled. There is no global account database.
Initial trust levels:
self: another device owned by the same person.direct: a trusted friend.referred: a peer introduced by a trusted friend.public: unknown peer with no meaningful permissions.blocked: peer that should not receive responses.Trust levels are not enough by themselves. Every request also needs a resource-level policy. A direct friend may be allowed to receive summaries from one document but not raw files from another.
EnvoyMesh supports two communication styles:
The system should treat all remote input as untrusted. Every message must be schema-validated before it reaches workflow or AI logic.
Primary implementation:
js-libp2p for networking.zod for message schemas.Mobile stack (Phase 11):
@noble/curves + @noble/hashes for pure-JS Ed25519.@capacitor-community/sqlite for on-device SQLite storage.@capacitor/filesystem for vault file I/O.