Skip to content

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 JavaScript
OpenClaw: 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:

MEMORY.md
# 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 commit

OpenClaw 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

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:

OpenViking Memory Architecture
+------------------+
| 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:

CategoryOwnerWhat It StoresMergeable
profileuserName, role, identityYes
preferencesuserCoding style, tools, etc.Yes
entitiesuserProjects, people, thingsYes
eventsuserDecisions, eventsNo
casesagentProblem + solution pairsNo
patternsagentReusable patternsYes

Setup with the helper script:

setup-openviking.sh
# Navigate to OpenViking
cd /path/to/OpenViking
# Run the setup helper
npx ./examples/openclaw-memory-plugin/setup-helper
# Start OpenClaw gateway
openclaw gateway

Manual setup (local mode):

manual-setup.sh
# Create extension directory
mkdir -p ~/.openclaw/extensions/memory-openviking
# Copy plugin files
cp examples/openclaw-memory-plugin/* ~/.openclaw/extensions/memory-openviking/
# Install dependencies
cd ~/.openclaw/extensions/memory-openviking && npm install
# Enable the plugin
openclaw config set plugins.enabled true
openclaw config set plugins.slots.memory memory-openviking
openclaw 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:

Hardware Requirements
GPU: NVIDIA with 12GB+ VRAM
RAM: 32GB system memory
Disk: 50GB+ SSD for models

Setup process:

ollama-embeddings.sh
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull embedding model
ollama pull nomic-embed-text
# Configure OpenClaw to use local embeddings
openclaw 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 MemoryWith Memory
Every session blankContext accumulates
Restate preferences every timePreferences learned automatically
Repeats same mistakesLearns from errors
No relationship buildingUnderstands user patterns
Generic responsesPersonalized to your context

After I configured memory with OpenViking, my sessions looked like this:

Session 1:
Me: I prefer TypeScript over JavaScript
OpenClaw: I'll note that preference. [profile.preferences updated]
Session 2 (next day):
Me: Add a new API endpoint
OpenClaw: 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 vs Right
WRONG: Using default memory-core (no persistence)
RIGHT: Install and configure memory plugin

The default memory-core provides session memory only. It doesn’t persist across sessions.

Mistake 2: Empty or Minimal MEMORY.md

Wrong: Minimal Memory File
# Memory
- I like clean code

This is too vague. Be specific:

Right: Structured Memory File
# 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 tests

Mistake 3: Missing Embedding API Keys

If using cloud embeddings (OpenAI, Anthropic), ensure API keys are configured:

check-api-keys.sh
# Verify configuration
openclaw 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:

verify-memory.sh
# Check memory status at startup
openclaw memory status
# Should show active memory plugin and stats
# Memory Plugin: memory-openviking
# Memories stored: 47
# Last updated: 2026-03-23

Checkpoint 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:

Checkpoint Request
Write a checkpoint file for our current progress:
- What we've completed
- What's in progress
- Next steps
- Key decisions made

This 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:

  1. MEMORY.md - Simple, manual, works immediately
  2. OpenViking - Automatic, semantic search, recommended
  3. 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