cachly← All posts
Integration · Release

OpenClaw + cachly: one Brain across every channel

OpenClaw runs your AI across 22 channels simultaneously — WhatsApp, Telegram, Slack, Discord, and more. Until now, each channel started from scratch. Today that changes: @cachly-dev/openclaw ships a Brain Bridge that shares the same compounding lesson store as Claude Code, Cursor, and the IDE plugins.

The problem: 22 channels, 22 blank slates

OpenClaw's multi-channel architecture is genuinely impressive — one agent codebase, every platform. But memory has always been the weak point. A lesson learned on Slack didn't help the Telegram channel. A fact stored in a session on Tuesday was gone by Wednesday. The agent was stateless at the level that actually matters: knowledge.

The same problem exists in developer tooling: Claude Code learns something, then Cursor starts fresh. cachly has solved this for coding tools by giving every tool access to the same Brain. We've now built the same bridge for OpenClaw.

How the Brain Bridge works

The bridge reads and writes to the same cachly:lesson:best:* keys on your instance that Claude Code, Cursor, and the VS Code plugin already use. No separate service, no extra auth — just your existing cachly Redis/Valkey connection.

Three primitives, all you need:

  • recall(query) — keyword-ranked lesson retrieval. Embedding-free, so it works on the free tier. Bumps recall_count so telemetry stays accurate across tools.
  • learn({ topic, outcome, whatWorked, … }) — stores a lesson with Cachly's confidence calibration (+0.1 reinforce / −0.15 erode), identical to what the MCP server writes.
  • briefingMiddleware() — drop-in LLM middleware that pre-briefs the system prompt with relevant lessons before every call.
openclaw.config.ts
import { createCachlyBrain } from '@cachly-dev/openclaw/brain'
import { createCachlyOpenClawConfig } from '@cachly-dev/openclaw'

const brain = createCachlyBrain({ url: process.env.CACHLY_URL! })

export default {
  // All channels share session storage, LLM cache, and memory:
  ...(await createCachlyOpenClawConfig({
    url:     process.env.CACHLY_URL!,
    embedFn: embed,
  })),

  // Pre-brief every LLM call with relevant Brain lessons:
  llmMiddleware: brain.briefingMiddleware(),
}

What actually compounds

The lessons worth sharing aren't abstract. They're the specific things your agent has already figured out:

  • The support question that always means the user hasn't confirmed their email — even though they phrase it five different ways.
  • The product answer that needs to include the pricing caveat or people cancel.
  • The escalation pattern: if this topic comes up twice in a session, route to human.

Every time your agent learns one of these and calls brain.learn(), it's available instantly on every channel — and to Claude Code or Cursor next time a developer session opens. The knowledge belongs to the Brain, not to the channel.

Confidence calibration — the detail that matters

Storing a lesson once is easy. Knowing when to trust it is hard. The Brain Bridge uses the same calibration the rest of cachly uses:

  • Same outcome as before → confidence +0.1, capped at 0.99
  • Different outcome (flipped) → confidence −0.15, floored at 0.05, guidance overwritten

A lesson that's been confirmed ten times in a row has 0.99 confidence. One that keeps flip-flopping stays near 0.05 and the agent learns to treat it with appropriate uncertainty. This is the same logic that brain_confirm_ci uses on the developer side — a single calibration model across every entry point.

Getting started

npm install @cachly-dev/[email protected]

The Brain Bridge is the ./brain export. It requires only your existing CACHLY_URL — no vector API, no embeddings, no extra setup. If you're already running other cachly adapters, the Brain Bridge plugs into the same Redis connection automatically.

Full API docs: cachly.dev/docs/openclaw

cachly.dev

For everyone building with Claude Code, Cursor, Copilot and Windsurf

Solve it once. From then on, your AI knows.

Every fix, every decision and every dead end becomes experience your AI uses at the right moment. You build faster — and your team builds on what you figured out.

Servers in the EU · one command, fully set up · 1 project free

Four ways to install

Claude Code
/plugin marketplace add cachly-dev/cachly-mcp
/plugin install cachly-brain@cachly

Then turn on auto-update once: /plugin → Marketplaces → cachly → Enable auto-update

Any MCP editor
npx @cachly-dev/mcp-server@latest autopilot