Skip to main content

How Memory Works

Your UltraClaw agent doesn’t forget. Every conversation is stored, indexed, and recalled when relevant — giving your agent persistent context that grows more useful over time.
Your memory is stored on your own private virtual server — completely isolated from other users. Your conversation logs, MEMORY.md, and all stored context belong only to you.

The Layered Memory System

Your agent’s memory has three layers that work together to give it both immediate recall and long-term knowledge.

Daily Logs

Every conversation is saved as a daily log, organized by date. Your agent loads today’s and yesterday’s logs automatically at the start of each session.

Long-Term Memory

Important facts, preferences, and context are stored in a curated MEMORY.md file that loads with every session — giving your agent instant access to what matters most.

Vector Search

When your agent needs to recall something from weeks or months ago, it searches across all past conversations using semantic similarity — finding relevant context even if you don’t remember the exact words.

What Loads Automatically

At the start of each session, your agent loads:
  1. MEMORY.md — your curated long-term facts
  2. Today’s conversation log — everything discussed so far today
  3. Yesterday’s conversation log — recent context from the day before
This means your agent always knows who you are, what you’ve been working on recently, and what you’ve told it to remember.

Saving to Long-Term Memory

Want your agent to remember something important? Just say it naturally:
  • “Remember that my QuickBooks company ID is 12345”
  • “Save to memory: I prefer morning briefings at 7am Pacific”
  • “Add to memory that Sarah’s birthday is March 15th”
Your agent writes these facts to MEMORY.md, where they persist across every future conversation.
Keep MEMORY.md focused on curated facts — not full transcripts. Think contact details, preferences, account numbers, and key decisions. A lean memory file means faster, more efficient sessions.

Compaction

As conversations grow, the context window fills up. Compaction summarizes older parts of the conversation to free up space while retaining the key information.
Your agent automatically compacts the conversation when the context reaches approximately 40,000 tokens. This happens seamlessly — you won’t notice any interruption.
During compaction, your agent:
  1. Summarizes the conversation so far
  2. Preserves key facts, decisions, and action items
  3. Frees up the context window for new messages
Compaction doesn’t delete anything. Your full conversation logs are always stored in daily logs and remain searchable via vector search.

Best Practices

1

Curate Your MEMORY.md

Periodically review what’s in your agent’s long-term memory. Remove outdated facts and keep it focused. Ask your agent: “Show me what’s in MEMORY.md”
2

Use 'Save to Memory' Deliberately

Don’t save everything — save the things that matter across conversations. Preferences, important dates, account details, recurring instructions.
3

Compact Before Switching Topics

If you’ve had a long conversation about one topic and want to pivot, run /compact first. Your agent will carry forward what matters and free up space.
4

Trust Vector Search for Old Conversations

You don’t need to memorize everything. If your agent needs context from a conversation three weeks ago, it can search for it automatically.

Checking Your Context

Use the /context slash command to see how much of the context window is currently being used. This helps you understand when a compaction might be beneficial.