Wood Chen

An Introduction to openclaw: Its Memory System and Recommended Memory Settings

0 comments217 views1.3k words

This post was translated from Chinese by AI. If anything reads oddly, the Chinese original is authoritative. 中文原文

This article does not cover code. I'll try to explain the facts without technical jargon.

Introduction

openclaw's worldwide popularity caught everyone off guard: its founder, programmers, and non-programmers alike. How did it suddenly get more github stars than linux? Some of that is down to promotion by content creators, but the project itself must have some real value too.

I was probably among the first people doing vibe coding. I first learned about generative models through gpt-3.5-turbo—later than many experts, but earlier than most people. I'd consider myself an early adopter. This is the earliest blog post of mine I could find:

Pasted image 20260308172002.png

Haha, I later wrote openai-billing-query. It only has 128 stars, but for someone who knew just a little html, css, and js at the time, it was an amazing first experience.

Back to the point

The concept of agents didn't start with openclaw. Once AI models began showing 涌现, people started looking for ways to use them. Conversation alone cannot deliver transformative value.

openclaw is now widely known because it can do many things: edit files, operate applications, and use applescript on mac to access apple Reminders, apple Calendar, apple email, and so on.

These are actually fairly basic tricks. claude code can do them too, including browser control, which also builds on existing technology.

Integrating with chat apps is straightforward too. That has been possible since the gpt-3.5-turbo era.

As for computer use, although some models now support it natively, openclaw doesn't use those capabilities, so it can run even with low-quality models.

Personally, I think openclaw's biggest breakthrough—and perhaps the one most people agree on—is combining a RAG memory system with all those capabilities.

This isn't simply piling up context. It's a carefully designed, layered, persistent memory architecture.

Why Memory Systems Matter So Much for Agents

claude code can do a lot: write code, edit files, troubleshoot servers, and run scripts. But it has no memory. That's why it has a global CLAUDE.md, and each project needs /init to create its own CLAUDE.md. This was already a huge innovation over earlier coding tools, drawing many users away from cursor. Why hasn't claude code become as widely known as openclaw? Beyond its focus on programming, the memory system may be the less obvious reason.

A quick aside: if a model's context is long enough, do we still need a memory system?

At least for now, we do, for the following reasons:

  1. The newly released gpt-5.4 has a 1050k context window. Sounds huge, right? In practice, hallucinations become severe at around 80-105k, based on my own testing and experience. Even the strongest model's ability to recall information within its context can't fix this. It's a hard limitation.
  2. Beyond hallucinations, there's the cost. With global energy and computing resources under strain, freely using huge contexts is still a long way off.

What a Memory System Does

Memory lets openclaw act like a virtual person.

  • It knows who it is, what its name is, and how it approaches tasks.
  • It knows who you are, your relationship with someone else, your work, your hobbies, and your preferences.
  • After making a mistake and being corrected, it can be less likely to repeat that mistake.
  • It can retain specific memories. For example, you only need to tell it, "Post this article to xxx platform and xxx forum," and it can do so directly. You don't have to provide the posting procedure, api endpoints, api keys, and so on every time.

This is the fundamental reason openclaw took off. It is starting to not just do things, but learn too.

Exploring openclaw's Default Memory System Layout

openclaw uses a dual-track RAG memory model by default. It doesn't use vector databases like Milvus or Pinecone, which have commonly been used for AI.

  1. Local-first: prioritizes privacy, transparency, and user control.
  2. File-first: markdown is the single source of truth. This makes it easy to include in context, and lets users edit and correct it manually at any time.
  3. A local sqlite engine: sqlite is a local database used in many applications, including mobile apps such as WeChat and qq. We also use it frequently in software development. openclaw uses sqlite (with the vec extension) to build an extremely lightweight rag engine. It chunks markdown documents, generates embeddings, and stores them in local sqlite for fast retrieval. This index + details architecture balances speed and quality, while local sqlite storage also protects privacy.
  4. Hybrid retrieval: combines semantic vectors with keyword matching (BM25), searching by both meaning and individual words to balance recall and precision.
  5. AI-controlled memory retrieval: even with a well-designed history and index architecture, long-running conversations are still too large for the context window. So openclaw exposes the system through memory_search and memory_get: one searches, the other reads. Based on our conversation, the AI decides which memories it needs to "recall."
  6. Smart caching and incremental synchronization: existing memories need caching, and new memories need updating. You can't wipe everything and rebuild it each time. So openclaw only regenerates embeddings for newly added content in memory files. Combined with debouncing, this reduces embedding model costs and system cpu usage.
  7. Embedding models: supports local and cloud models, with automatic fallback.
  8. **Memory files are split into short-term working memory (memory/2026-03-06.md) and refined long-term memory (MEMORY.md, SOUL.md, USER.md, etc.).
  9. Supports multi-Agent routing, allowing different channels to use separate memory spaces.
  10. Uses layered trust&sandbox isolation&selective forgetting to resist prompt injection and memory contamination.

This model hides complex technology behind basic markdown files, providing long-term memory while accounting for privacy and cost.

A Brief Configuration Overview of the n Ways to Handle memory

The Default memory-core + memorySearch

The keys to making this setup work are:

  1. Configure a memorySearch model
  2. **Have heartbeat tasks record important information from conversations in that day's memory file
  3. Periodically review the previous day's records and extract long-term facts, memories, personal preferences, and so on into long-term memory files

The memory-lancedb Plugin + lancedb Vector Database

The keys to making this setup work are:

  1. Manually configure an appropriate chunk.
  2. By default, it retrieves 3 memories and includes their full contents.

After a few days of hands-on use and around 400 dollars spent, I don't think it's a good fit. Here's why:

  1. Irrelevant retrieval: because it uses only a basic recall algorithm, a prompt like 请继续 can retrieve roughly 300 Chinese characters about forum configuration, my programming preferences, my wife's relationships... This pollutes the context and makes the AI's answers less accurate. Once the context gets longer and hallucinations worsen, it can suddenly lose track of how to respond.
  2. High usage: irrelevant retrieval bloats the context (18w tokens of input for a single conversation), and embedding costs add up, making it very expensive.

High cost and poor results. I'd suggest skipping it.

Other External Memory Systems I Haven't Tested

  1. Graphiti temporal knowledge graph: has strong awareness of time. For references such as yesterday, three days ago, or last week, it can accurately retrieve the corresponding memories.
  2. VecLite: extremely lightweight, even lighter than sqlite+embedding. It may suit devices like a Raspberry Pi.

If you want to test one, consider adding a separate instance outside your main openclaw device to evaluate it. Switching memory systems affects existing memories and usually requires clearing and rebuilding the vector database.

Configuration Screenshots

For reference only.

Pasted image 20260308182255.png

Pasted image 20260308182505.png

Closing Thoughts

It's Sunday today. I stayed up all night tweaking memory settings until 10 in the morning, studying the documentation and the logic. I didn't sleep until noon, then got up at 4 in the afternoon to write all this, based on my limited understanding. I hope it gives you something useful to refer to.

Related posts

Comments 0