OpenWalrusOpenWalrus

Protocol

The OpenWalrus wire protocols — walrus.proto for clients, ext.proto for extensions, dual UDS and TCP transport.

OpenWalrus uses two protobuf protocols over two transports. Clients (CLI, gateway) speak walrus.proto. Extensions (memory, search) speak ext.proto.

Two protocols

walrus.proto (client-daemon)

Used by walrus attach, the gateway service, and custom clients:

  • Send chat messages to agents
  • Stream responses (text deltas, tool calls, completions)
  • Manage sessions, config, and agent state

ext.proto (daemon-extension)

Used by extensions (walrus-search, custom extensions):

  • Capability handshake at startup
  • Tool schema registration
  • Tool call dispatch and results
  • Lifecycle callbacks (BuildAgent, BeforeRun, Compact, EventObserver, AfterRun, Infer, AfterCompact)

Transport

Unix domain socket

The daemon listens on ~/.openwalrus/walrus.sock. The CLI connects to this socket by default:

walrus attach ──→ walrus.sock ──→ walrus daemon

Override the socket path:

walrus --socket /path/to/custom.sock attach

TCP

The daemon also listens on TCP (localhost by default). The port is written to ~/.openwalrus/walrus.tcp:

walrus attach --tcp

TCP is used by the gateway service and enables remote connections.

Extension kinds

KindProtocolDirectionExample
extensionext.proto (UDS)Daemon → extensionwalrus-search
gatewaywalrus.proto (TCP)Service → daemonwalrus-telegram

Capabilities handshake

Extensions declare capabilities at startup via ExtReady:

CapabilityDescription
ToolsProvides tool schemas that agents can call
BuildAgentEnriches agent config at creation
BeforeRunInjects context before each agent execution
CompactEnhances context compaction prompts
EventObserverObserves agent lifecycle events
AfterRunRuns after each agent execution completes
InferRequests LLM inference from the daemon
AfterCompactRuns after context compaction completes
QueryResponds to structured queries

Wire format

Both protocols use length-prefixed protobuf 3 frames over the transport. The walrus-socket and walrus-tcp crates handle framing and codec.

Building on the protocol

Connect directly using the walrus-socket crate:

use walrus_socket::WalrusClient;

let client = WalrusClient::connect("/path/to/walrus.sock").await?;

What's next

  • CLI reference — commands that use the protocol
  • Event loop — how the daemon processes messages
  • Extensions — extension architecture and lifecycle
  • Hooks — how hooks compose with extensions

On this page