Skip to main content

Bridge

Your AIs talk to each other.

Your AIs can send messages, search each other’s memory, and coordinate work. Claude Code talks to OpenClaw. OpenClaw talks back. Everything stays on your computer.

Three Protocols, One System

LDM OS uses three complementary protocols. Bridge is one of them.
Bridge (Bridge)ACP-ClientACP-Comm
WhatAI-to-AI messaging + shared memoryIDE-to-AI communicationAI-to-AI over the internet
ProtocolMCP (JSON-RPC over stdio)JSON-RPC over stdio + WebSocketREST/HTTP
Built byWIP ComputerZed IndustriesIBM / Linux Foundation
In LDM OSCore (v0.3.0+)Available via OpenClawPlanned (Cloud Relay)
What it connectsYour AIs to each otherCode editors to AIsCloud AIs to each other
Memory accessYes (search + read across AIs)NoNo
Tool sharingYes (OpenClaw tools available to all AIs)NoNo
Where it runsYour computer onlyLocal (stdio) + remote (WebSocket)Cloud (HTTP)
Bridge is how your AIs talk to each other and share memory. ACP-Client is how code editors talk to AIs (OpenClaw already supports this). ACP-Comm is how AIs would talk across the internet (planned for Cloud Relay).

Tools

ToolWhat it does
lesa_send_messageSend a message to your OpenClaw AI. Get a response.
lesa_check_inboxCheck for messages your AI sent to you.
lesa_conversation_searchSearch across past conversations by meaning.
lesa_memory_searchSearch across workspace files by keyword.
lesa_read_workspaceRead a file from your AI’s workspace.
oc_skills_listList all available OpenClaw tools.
oc_skill_*Run any OpenClaw tool with scripts.

Session Discovery

Multiple Claude Code sessions can discover each other automatically. On startup, Recall registers each session at ~/.ldm/sessions/. Any session can list all running sessions with ldm sessions. The registry tracks which AI, its process ID, working directory, and start time. Stale sessions (dead processes) are cleaned up automatically.

Message Flow

Claude Code to OpenClaw:
CC  --lesa_send_message-->  OpenClaw Gateway (localhost:18789)  -->  Your AI
CC  <--lesa_check_inbox---  HTTP Inbox (localhost:18790)        <--  Your AI
Claude Code to Claude Code: Multiple Claude Code sessions communicate via the file-based message bus and session registry at ~/.ldm/sessions/. Each session registers on startup and can discover peers. No background service needed. Both directions are live. Everything stays on your computer. No cloud.

Technical Details

Architecture

Claude Code CLI (any session)
  |
  |-- On boot --> registerSession() --> ~/.ldm/sessions/{name}.json
  |
  |-- MCP stdio --> wip-bridge MCP server (single process)
  |                   |
  |                   |-- lesa_send_message --> HTTP POST localhost:18789
  |                   |-- lesa_check_inbox --> HTTP GET localhost:18790
  |                   |-- lesa_conversation_search --> SQLite (context-embeddings.sqlite)
  |                   |-- lesa_memory_search --> filesystem (workspace/*.md)
  |                   |-- oc_skill_* --> exec scripts in extensions

Config Resolution

Bridge finds its config in two steps:
  1. LDM OS path (~/.ldm/config.json): checks for openclawDir, workspaceDir, dbPath
  2. Legacy path (OPENCLAW_DIR env or ~/.openclaw): fallback
Two modes:
  1. Smart search (if OpenAI API key available): embeds your query, computes similarity against all conversation chunks, applies recency weighting (recent conversations rank higher)
  2. Text search (fallback): keyword matching against conversation text

Inbox Server

Bridge starts a localhost-only HTTP server on port 18790:
  • POST /message: push a message (from your OpenClaw AI)
  • GET /status: check pending count
Messages are held in memory. lesa_check_inbox drains the queue.

Tool Sharing

On startup, Bridge scans OpenClaw’s tool directories and makes them available to Claude Code. Your Claude Code AI gets the same tools your OpenClaw AI has.
  1. Scans tool directories
  2. Reads each tool’s description and requirements
  3. Tools with a scripts/ folder get registered as executable oc_skill_{name} tools
  4. All tools show up in oc_skills_list

CLI Usage

lesa send "What are you working on?"     # Message your OpenClaw AI
lesa search "API key resolution"          # Smart search (recency-weighted)
lesa memory "compaction"                  # Keyword search across workspace files
lesa read MEMORY.md                       # Read a workspace file
lesa status                               # Show bridge configuration
lesa diagnose                             # Check gateway, inbox, DB, tools health

Ports

PortServiceBound to
18789OpenClaw gatewaylocalhost (managed by OpenClaw)
18790Bridge inboxlocalhost (managed by Bridge)

Environment Variables

VariableRequiredDefaultDescription
OPENCLAW_DIRYes~/.openclawPath to OpenClaw installation
OPENAI_API_KEYFor smart searchResolved from 1PasswordOpenAI API key for embeddings
LESA_BRIDGE_INBOX_PORTNo18790Inbox HTTP server port

Part of LDM OS

Bridge ships with LDM OS v0.3.0+.