How allenpeng0705/envoymesh works
EnvoyMesh is a self-hosted, decentralized P2P social and agent mesh: a home node owns identity, policy, AI, and data, while phones act as thin clients. The main workflow is a user action in the Social UI, sent over the home-node service connection, handled locally or dispatched to peers, then returned as chat, content, knowledge, or task results. The README documents the major product branches; sampled source specifically confirms the UI’s WebSocket RPC pattern, RAG indexing/search, and chain-orchestration ownership. Other wiring below reflects documented behavior, not inspected implementation.
Main entry points: node-service-impl.ts Node services · node-service-chain-orchestration.ts Task orchestration · index.ts Node runtime · mesh-outbound-helper.ts Mesh transport
Components 20
User clients
- Social UI
apps/social/src/App.tsx - Node service client
apps/social/src/hooks/useNodeService.tsx - EnvoyGo client
apps/envoygo
Home node
- Node runtime
apps/node/src/index.ts - Node services
apps/node/src/node-service-impl.ts - Identity and trust
apps/node/src/node-service-identity.ts - Chat and calls
apps/node/src/chat-outbound-deliver.ts - Local data
packages/local-store/src/storage-gate.ts
Peer mesh
- Mesh transport
apps/node/src/mesh-outbound-helper.ts - Inbound handlers
apps/node/src/cli-mesh-inbound-chat-room-message.ts - Peer node
apps/node/src/index.ts
Agent network
- Agent interface
apps/node/src/agent-runtime-envoy/index.ts - OpenClaw bridge
OpenClawExtension/src/channel.ts - Task orchestration
apps/node/src/node-service-chain-orchestration.ts - Agent workers
apps/node/src/chain-worker-executor.ts
Knowledge and content
- Feed and publishing
apps/node/src/feed-timeline.ts - Knowledge libraries
apps/node/src/knowledge-hub.ts - Local RAG
apps/node/src/rag-service.ts
Other components
- User
- External agent
Connections 22
- User → Social UI: uses
- Social UI → Node service client: invokes RPC
- EnvoyGo client → Node runtime: connects thin-client
- Node service client → Node runtime: sends WebSocket RPC
- Node runtime → Node services: dispatches
- Node services → Identity and trust: applies trust policy
- Node services → Chat and calls: handles messaging
- Chat and calls → Mesh transport: sends envelopes
- Mesh transport → Peer node: delivers P2P
- Peer node → Inbound handlers: sends envelopes
- Inbound handlers → Node services: dispatches requests
- Node services → Feed and publishing: serves feed and posts
- Node services → Knowledge libraries: queries knowledge
- Knowledge libraries → Local RAG: indexes and searches
- Node services → Agent interface: routes agent work
- Agent interface → OpenClaw bridge: bridges built-in agent
- Node services → Task orchestration: starts task chains
- Task orchestration → Agent workers: executes accepted tasks
- Task orchestration → Mesh transport: coordinates peers
- External agent → Agent interface: optional integration
- Node services → Local data: reads and writes
- Local RAG → Local data: persists indexes