How to Configure OpenClaw Memory So It Doesn't Forget
Problem
I spent 6 days configuring OpenClaw. I tweaked settings, installed plugins, and read documentation. But every time I started a new session, OpenClaw forgot everything.
Here’s what happened in each session:
Session 1:Me: I prefer TypeScript over JavaScriptOpenClaw: Got it, I'll use TypeScript for this project.
Session 2 (next day):Me: Can you add a new API endpoint?OpenClaw: Sure, I'll create it in JavaScript...Me: (sigh) I told you yesterday I prefer TypeScript.Every session was a blank slate:
- Preferences I stated? Forgotten.
- Mistakes I corrected? Repeated.
- Context I built? Invisible.
The Reddit user Maximum_Pick_5398 captured my frustration perfectly:
“Main thing I learned, configure its memory so it doesn’t forget.”
Six days of configuration, and the most important thing was something I hadn’t even set up.
What I Discovered
I searched for solutions and found three approaches. Here’s what each one does and how to set it up.
Strategy 1: MEMORY.md Workspace File (Simplest)
The fastest solution is a MEMORY.md file that OpenClaw reads every session.
I created this in my project root:
# Long-term Memory
## User Information- Name: Alex- Role: Backend Engineer- Primary projects: payment-service, user-api- Communication preference: Concise, technical
## Preferences- Code style: TypeScript over JavaScript- Testing: Jest with 80% coverage minimum- Git: Prefer rebase over merge for feature branches- Documentation: Inline comments, not separate docs
## Important Notes- Always check branch status before git operations- Never commit to main directly- Run linter before every commitOpenClaw reads this file at the start of every session. It works, but there’s a catch: you have to manually update it. If you tell OpenClaw something new, it won’t automatically remember it unless you edit the file.
This approach is best if you:
- Want zero setup complexity
- Don’t mind manual updates
- Have stable preferences that rarely change
Strategy 2: OpenViking Memory Plugin (Recommended)
OpenViking is a memory plugin that automatically extracts and stores information from conversations.
The key insight from Reddit user TorbenKoehn (57 upvotes):
“I let it configure its memory itself, using local Ollama embeddings.”
This means OpenClaw can self-configure its memory system. Here’s how it works:
+------------------+| Conversation |+--------+---------+ | v+------------------+| Memory Extractor | --> Extracts 6 categories automatically+--------+---------+ | v+------------------+| Embeddings | --> Semantic search for context retrieval+--------+---------+ | v+------------------+| Memory Tiers || L0 (active) | --> Current conversation| L1 (recent) | --> Last few sessions| L2 (long-term) | --> Compressed historical memory+------------------+OpenViking extracts six categories of memory:
| Category | Owner | What It Stores | Mergeable |
|---|---|---|---|
| profile | user | Name, role, identity | Yes |
| preferences | user | Coding style, tools, etc. | Yes |
| entities | user | Projects, people, things | Yes |
| events | user | Decisions, events | No |
| cases | agent | Problem + solution pairs | No |
| patterns | agent | Reusable patterns | Yes |
Setup with the helper script:
# Navigate to OpenVikingcd /path/to/OpenViking
# Run the setup helpernpx ./examples/openclaw-memory-plugin/setup-helper
# Start OpenClaw gatewayopenclaw gatewayManual setup (local mode):
# Create extension directorymkdir -p ~/.openclaw/extensions/memory-openviking
# Copy plugin filescp examples/openclaw-memory-plugin/* ~/.openclaw/extensions/memory-openviking/
# Install dependenciescd ~/.openclaw/extensions/memory-openviking && npm install
# Enable the pluginopenclaw config set plugins.enabled trueopenclaw config set plugins.slots.memory memory-openvikingopenclaw config set plugins.entries.memory-openviking.config.mode "local"After setup, OpenClaw automatically:
- Extracts facts from conversations
- Stores them with embeddings for semantic search
- Retrieves relevant context when needed
- Compresses old memories to save tokens
Strategy 3: Local Ollama Embeddings (Cost-Effective)
If you want zero API costs and maximum privacy, use local embeddings with Ollama.
Reddit user TorbenKoehn’s approach got 57 upvotes because it solves two problems:
- No API costs after initial setup
- Data never leaves your machine
Hardware requirements for decent performance:
GPU: NVIDIA with 12GB+ VRAMRAM: 32GB system memoryDisk: 50GB+ SSD for modelsSetup process:
# Install Ollamacurl -fsSL https://ollama.ai/install.sh | sh
# Pull embedding modelollama pull nomic-embed-text
# Configure OpenClaw to use local embeddingsopenclaw config set embeddings.provider "ollama"openclaw config set embeddings.model "nomic-embed-text"The tradeoff: you need decent hardware. Without a GPU, embeddings are slow. With the right hardware, it’s fast and free.
What Changed After Configuration
Here’s the difference memory makes:
| Without Memory | With Memory |
|---|---|
| Every session blank | Context accumulates |
| Restate preferences every time | Preferences learned automatically |
| Repeats same mistakes | Learns from errors |
| No relationship building | Understands user patterns |
| Generic responses | Personalized to your context |
After I configured memory with OpenViking, my sessions looked like this:
Session 1:Me: I prefer TypeScript over JavaScriptOpenClaw: I'll note that preference. [profile.preferences updated]
Session 2 (next day):Me: Add a new API endpointOpenClaw: Creating the endpoint in TypeScript based on your preference...No more repeating myself.
Common Mistakes
I made several mistakes along the way:
Mistake 1: No Memory Plugin Enabled
WRONG: Using default memory-core (no persistence)RIGHT: Install and configure memory pluginThe default memory-core provides session memory only. It doesn’t persist across sessions.
Mistake 2: Empty or Minimal MEMORY.md
# Memory- I like clean codeThis is too vague. Be specific:
# Memory
## Preferences- Language: TypeScript (strict mode)- Linter: ESLint with @typescript-eslint/recommended- Formatter: Prettier with 2-space indentation- Testing: Jest, prefer integration tests over unit testsMistake 3: Missing Embedding API Keys
If using cloud embeddings (OpenAI, Anthropic), ensure API keys are configured:
# Verify configurationopenclaw config list | grep embeddings
# Should show:# embeddings.provider = "openai"# embeddings.api_key = "(set)"Mistake 4: Not Verifying Memory Status
Always check that memory is working:
# Check memory status at startupopenclaw memory status
# Should show active memory plugin and stats# Memory Plugin: memory-openviking# Memories stored: 47# Last updated: 2026-03-23Checkpoint Files During Work
One more tip from Reddit user spooninmycrevis:
“Just talk to it and start building. Watch token usage. Make it write checkpoint files when you work.”
Even with persistent memory, long sessions can hit token limits. I have OpenClaw write checkpoint files during extended work:
Write a checkpoint file for our current progress:- What we've completed- What's in progress- Next steps- Key decisions madeThis creates a recoverable state if the session gets too long.
Summary
After 6 days of configuration struggles, I learned that memory setup is the single most important step. You have three options:
- MEMORY.md - Simple, manual, works immediately
- OpenViking - Automatic, semantic search, recommended
- Ollama embeddings - Private, free after setup, needs hardware
The Reddit insight that stuck with me:
“The real unlock was… giving it a memory file it reads every session so it doesn’t forget everything.” - MatrixClawAI
Configure memory first. Everything else is secondary.
Final Words + More Resources
My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me
Here are also the most important links from this article along with some further resources that will help you in this scope:
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments