Three Memory Upgrades You Need for Your OpenClaw Agents

A practical OpenClaw memory stack using lossless-claw, QMD, and ByteRover.
Author

Will James

Published

June 12, 2026

OpenClaw memory systems

If you are building on OpenClaw, context and memory can be confusing. This article offers a rich memory setup that will improve agent performance and yet is easy to install.

In this article, I am going to show you why I picked three layers to manage memory in my OpenClaw implementation. That architecture is made up of three key parts:

My OpenClaw is modified with 3 context /memory upgrades, each providing a different enhancement. Here are the 3 key updates and why they matter:

In this OpenClaw deployment, those three parts work together to separate raw history, working memory, and institutional knowledge instead of forcing one layer to do every job.

Three-tier OpenClaw memory stack

I will explain why I’m using each upgrade and how to install it into your OpenClaw.

Lossless-claw for raw source of truth

The first upgrade is lossless-claw because default OpenClaw behavior becomes destructive once a session gets long: older messages are compacted into summaries and the raw detail falls out of active context just when exact specifics may still matter. lossless-claw changes that tradeoff by storing every message in SQLite, building layered summaries as a DAG, and keeping pointers back to the underlying detail so older context can be re-expanded later instead of being irreversibly discarded. In my own setup, that archive has grown to about 2.0 GB after roughly two months of active use, almost all of it in lcm.db, which has been a modest storage cost for preserving a non-destructive raw history layer.

Default compaction compared with lossless-claw recovery

Simple setup instructions for Lossless Claw

lossless-claw is available as a plugin and is very easy to install using the plugin installer that comes with OpenClaw. The source repo is also available on GitHub.

openclaw plugins install @martian-engineering/lossless-claw
openclaw plugins inspect lossless-claw --json

Then make sure OpenClaw uses it as the context engine in ~/.openclaw/openclaw.json. Keep its state in ~/.openclaw/lcm.db and ~/.openclaw/lcm-files/.

{
  "plugins": {
    "slots": {
      "contextEngine": "lossless-claw"
    },
    "entries": {
      "lossless-claw": {
        "enabled": true
      }
    }
  }
}

From there, you can tune lossless-claw per agent and per session type. Some agents should stay fully stateful so their history is preserved normally, some can be marked stateless so OpenClaw treats them as temporary working sessions, and some background sessions such as cron or heartbeat can be ignored entirely. If you are not sure which pattern fits each of your agents, ask your OpenClaw agent to recommend a lossless-claw layout for your specific agent roster.

ByteRover for topical memory

The last enhancement I added to my OpenClaw is topical memory. Instead of organizing everything around sessions, transcripts, or time-based summaries, the third layer is organized around reusable ideas, patterns, and facts.

I use ByteRover to build a knowledge base around the ideas, patterns, and lessons that emerge from all the work I process through OpenClaw agents.

Base OpenClaw gives you conversation history and per-agent memory, but it does not by itself give you a strong historic knowledge layer for cross-session knowledge that has already been judged worth keeping. Without that extra layer, the same lessons have to be rediscovered, rewritten into agent memory, or pulled back out of old chats over and over again.

There are several other efforts aimed at a similar benefit, from Andrej Karpathy’s LLM Wiki gist to Garry Tan’s gbrain and its launch post on X. They are all reaching toward some version of a knowledge graph or topical knowledge layer that is easy for the model to query over time, while also preserving relationships between ideas so the agent can build deeper awareness around a subject.

That is the gap ByteRover fills in this stack. It gives OpenClaw a dedicated place to promote useful patterns, decisions, and operating facts out of temporary working memory and into a reusable knowledge base.

Here is how to install ByteRover for OpenClaw.

Start with ByteRover’s OpenClaw setup script:

curl -fsSL https://byterover.dev/openclaw-setup.sh | sh

The installer checks the local prerequisites, installs brv if it is missing, registers the OpenClaw connector, installs the ByteRover skill, backs up the OpenClaw config, and then asks which integration features to enable.

When the installer asks if you want to install the context engine, reply No. That would overwrite the lossless-claw context configuration.

When the installer asks about Automatic Memory Flush: Yes. This will enable capture of topics from all sessions.

The setup also updates the workspace instruction files so agents know ByteRover is available. In AGENTS.md, the installer appends a knowledge protocol block like this:

## Knowledge Protocol (ByteRover)
This agent uses ByteRover (`brv`) as its long-term structured memory.
You MUST use this for gathering contexts before any work. This is a Knowledge management for AI agents. Use `brv` to store and retrieve project patterns, decisions, and architectural rules in .brv/context-tree.
1.  **Start:** Before answering questions, run `<brv-path> query "<topic>"` to load existing patterns.
2.  **Finish:** After completing a task, run `<brv-path> curate "<summary>"` to save knowledge.
3.  **Don't Guess:** If you don't know anything, query it first.
4.  **Response Format:** When using knowledge, optionally cite it or mention storage:
    - "Based on brv contexts at `.brv/context-trees/...` and my research..."
    - "I also stored successfully knowledge to brv context-tree."

In TOOLS.md, it appends the short command reference agents can use when they need ByteRover:

## ByteRover (Memory)
- **Query:** `<brv-path> query "auth patterns"` (Check existing knowledge)
- **Curate:** `<brv-path> curate "Auth uses JWT in cookies"` (Save new knowledge)
- **Sync:** `<brv-path> pull` / `<brv-path> push` (Sync with team - requires login)

After the OpenClaw integration is installed, connect ByteRover to the model provider used by OpenClaw.

Here is an example for a Codex/OpenAI setup using GPT-5.5:

brv providers connect openai --oauth --model gpt-5.5

Once that provider setup is in place, normal OpenClaw sessions can feed ByteRover through the installed auto-flow, and agents can search ByteRover whenever durable knowledge is useful. You can also ask your agent to search ByteRover for you.

The storage split is the important part:

  • ~/.openclaw/lcm.db for raw conversation truth
  • each agent’s MEMORY.md and memory/ for local working memory
  • ByteRover for curated durable knowledge

Closing

Taken together we can see the connection between these examples and the three tier solution for OpenClaw.. There is a broader industry move toward layered memory systems that preserve truth, restore useful context, and promote durable knowledge without collapsing those jobs into one surface. If you have questions about using OpenClaw this way, contact me and I am happy to help.