DenchClaw Memory System: How Your AI Remembers Everything
How DenchClaw's memory system (MEMORY.md + daily logs) gives your AI agent persistent context across sessions — explained in depth.
DenchClaw Memory System: How Your AI Remembers Everything
Every AI conversation starts fresh unless you give the AI a way to remember. DenchClaw's memory system solves this with a file-based persistence model: the agent writes to markdown files on your local filesystem, reads them at the start of each session, and maintains context across every conversation — regardless of how much time has passed or how many sessions you've had.
This is what makes DenchClaw feel like a persistent AI assistant rather than a stateless chatbot.
The Two Layers of Memory#
DenchClaw uses two complementary memory files:
1. MEMORY.md — Long-Term Memory#
~/.openclaw-dench/workspace/MEMORY.md
This is the AI's curated, long-term knowledge base about you, your work, your preferences, and your context. Think of it as the AI's equivalent of a person's working knowledge — the things they'd just know without having to look up.
What MEMORY.md typically contains:
- Who you are, what you do, your role and company
- Your key relationships and ongoing projects
- Your preferences (communication style, tool preferences, priorities)
- Important decisions you've made and why
- Ongoing strategic context the AI needs to give relevant advice
- Lessons learned and things to avoid repeating
Important: MEMORY.md is loaded only in your main session (direct 1:1 chat with your agent). It's not loaded in shared contexts like Discord servers or group chats, where sharing personal context with strangers would be inappropriate.
2. Daily Notes — Short-Term Logs#
~/.openclaw-dench/workspace/memory/YYYY-MM-DD.md
A new file is created each day. The AI logs raw notes here during sessions — things that happened, context from conversations, things to follow up on, observations.
Daily notes are like a session journal. They're less curated than MEMORY.md — they capture everything with timestamps. The AI reads today's and yesterday's daily notes at the start of each session for recent context.
Over time, the agent performs memory maintenance: reads through accumulated daily notes, distills the significant things, and updates MEMORY.md with the insights worth keeping long-term.
How Memory is Used Each Session#
At the start of each main session, the DenchClaw agent:
- Reads MEMORY.md — loads all long-term context
- Reads today's daily note — picks up recent activity
- Reads yesterday's daily note — recent context (yesterday may have important continuations)
- Loads CRM schema — knows your current objects, fields, and data structure
This happens before any user message. By the time you type "good morning," the AI already knows:
- Who you are
- What projects you're working on
- What happened yesterday
- What you're likely to ask about
The result is continuity that feels natural — like talking to a colleague who works with you every day, not resetting to a blank slate each session.
How the AI Writes Memory#
During sessions, the AI writes to memory proactively:
Automatically:
- At the end of a session (or periodically during long sessions), the AI writes a summary to today's daily note
- Important decisions, new context, or significant events are logged immediately
On instruction:
- "Remember that Sarah Chen at Stripe is my main champion for the enterprise deal" → AI adds this to MEMORY.md
- "Note that we decided to pivot from monthly to quarterly reviews" → AI logs this immediately
- "Update your memory: the Jenkins account is no longer viable" → AI removes or updates the Jenkins context
In background heartbeat sessions:
- Periodically, the agent runs a memory maintenance cycle: reads recent daily notes, distills insights, updates MEMORY.md with what's worth keeping, removes outdated entries
Anatomy of a MEMORY.md File#
Here's what a real MEMORY.md might look like:
# MEMORY.md
Last updated: March 26, 2026
## About Kumar
- Founder of Dench (dench.com), YC S24
- Co-founder Mark handles marketing and content
- Building DenchClaw — local-first AI CRM on top of OpenClaw
- Main challenge: distribution and SEO, working on content strategy
- Uses Telegram as primary channel; web chat for detailed work
## Current Projects
- **Blog content series**: Writing 700 SEO articles across 14 batches
- Currently on batch 7b (articles 651-700), niche verticals + feature deep dives
- Target: published: false until review, then scheduled over 6 months
- **DenchClaw v2**: Working on multi-user support and cloud sync
- **YC network**: Planning a demo day follow-up campaign in April
## Key Relationships
- **Garry Tan** (YC President) — tweeted about us, warm relationship
- **Peter Steinberger** — OpenClaw creator, key technical partnership
- **Sarah Chen** (Stripe) — interested in enterprise DenchClaw, follow up March 28
## Technical Context
- Main blog repo: /Users/kumareth/Documents/projects/ironclaw-cloud
- Content lives in content/blog/ as .mdx files
- Workspace is at ~/.openclaw-dench/workspace/
## Preferences
- Prefer Telegram for casual questions, web chat for complex tasks
- Likes direct answers without excessive preamble
- Interested in SEO-optimized content strategies
- Values privacy and local-first architecture
## Lessons Learned
- Batch write blog articles in parallel subagents (much faster)
- Always verify file was actually written before proceeding
- Template.md files need to be read before spawning writing subagentsThis file gives the AI all the context it needs to be genuinely useful from the very first message in any session.
Editing MEMORY.md Directly#
MEMORY.md is a plain markdown file. You can edit it directly:
- Open it in the DenchClaw file tree:
workspace/MEMORY.md - Add, update, or remove any section
- Save — the AI uses the updated version in the next session
Or ask the AI to update it: "Update your memory — I've moved from San Francisco to Austin, and the Q1 product launch is now scheduled for April 15."
Memory Maintenance Heartbeat#
DenchClaw's heartbeat system runs periodic memory maintenance. During a heartbeat cycle, the agent may:
- Read through the last 7 days of daily notes
- Identify significant events, decisions, and new context
- Update MEMORY.md with distilled insights
- Remove outdated or superseded entries
- Archive old daily notes to a compressed format
This keeps MEMORY.md fresh and relevant without growing infinitely large.
Privacy and Security#
MEMORY.md may contain sensitive personal and professional context. DenchClaw handles this carefully:
- Never loaded in group/shared contexts — only in direct 1:1 sessions
- Stored locally — never sent to a cloud server
- AI model privacy — the contents of MEMORY.md are included in AI context windows, so they're subject to your AI model provider's privacy policy (same as your prompts)
- For full privacy: Use a local model (via Ollama) so no context leaves your machine
Frequently Asked Questions#
What if the AI remembers something incorrectly?#
Just tell it: "That's not right — update your memory: the meeting with Sarah was postponed to April 10." Or edit MEMORY.md directly and correct it. You have full control over what the AI knows.
How much context can MEMORY.md contain?#
Practically, keep MEMORY.md under 2,000-3,000 words. Larger memory files consume more tokens per session (since the file is loaded into context each time). Curate aggressively — keep the most relevant context and remove stale information. The daily notes files have no size limit.
Can I create separate MEMORY.md files for different contexts?#
DenchClaw uses one MEMORY.md per workspace. If you need separate memory contexts (e.g., one for work, one personal), run separate DenchClaw workspaces on different profiles. Each has its own MEMORY.md.
Does the AI ever forget things from MEMORY.md?#
The AI reads MEMORY.md fresh at the start of each session, so it can't "forget" it. However, if the file becomes too large, the AI may not act on every detail due to context window limitations. Keep MEMORY.md concise and curated for best results.
Can I share MEMORY.md across machines?#
Copy the file to your other machine, or sync it with a cloud drive. The AI will load and use it on any machine running your DenchClaw workspace. For secure sync, use encrypted cloud storage or a private git repository.
Ready to try DenchClaw? Install in one command: npx denchclaw. Full setup guide →
