Skip to main content
o4 can remember things between sessions, such as your preferences, project conventions, and decisions you made together. The next time you start o4 in the same project, the model gets those memories as part of its context, so you don’t have to repeat yourself. Memory is on by default. To have the model remember something, ask for it:
To make it forget something, ask for that too:
o4 has two kinds of memory: memory files that the model edits like any other file, and a memory database that the model reads and writes with memory tools.

Memory files

Each project has a memory directory in your home directory:
<project-id> is a hash of the project’s path, so each project gets its own directory. Run /memory to see the exact path. The main file is MEMORY.md. At the start of each session, o4 adds its contents to the model’s context, along with the directory path. Only the first 200 lines, up to 16 KiB of text, are used, so keep the file short. The model can put details in other files in the same directory, such as debugging.md, and link to them from MEMORY.md. While memory is on, o4 gives the model guidelines for these files:
  • Save stable facts: conventions, key file paths, architecture decisions, your preferences, and fixes for recurring problems.
  • Don’t save details of the current task, unverified guesses, or anything that repeats your project instructions.
  • When you ask it to remember something, save it right away. When you ask it to forget something, remove it.
  • Update wrong or outdated entries instead of adding duplicates.
The model writes these files with its normal write and edit tools, so the edits go through your usual approvals. You can also edit MEMORY.md yourself in any editor. For instructions that belong to the project and should be shared with your team, use project instructions instead. If your project has Markdown files in .o4/memory/, o4 can also tell the model their names at the start of a session, so it can read them with its read tool when they’re relevant. It doesn’t load their contents. In o4 0.2.74 this list only appears when there are no preference memories to load from the memory database, because those take its place.

The memory database

o4 also keeps memories in SQLite databases: Each memory has a type: fact, decision, pattern, preference, or session_summary. At the start of each session, o4 adds up to five of your most recently updated preference memories to the model’s context, global ones first. The model uses these tools with the database: Every memory tool call asks for your approval in the default approval mode. The project scope is the default. The model uses the global scope only when it asks for it explicitly.
The global database holds memories from all your projects. o4 opens it only in workspaces you trust, so an untrusted repository can’t read or change it. See workspace trust.

Session summaries

When you quit a session that had at least one exchange, o4 saves a short session_summary memory in the project database. It lists the files the model changed with write or edit and up to five sentences where the model stated a decision.

See and clear memory

Run /memory to open the Memory pane. It shows:
  • the memory directory for the current project,
  • whether memory is enabled,
  • the number of lines in MEMORY.md, or not found,
  • the other files in the directory and their sizes,
  • a Clear memory row that shows the command below. Selecting it does nothing; type the command yourself.
To delete every file in the project’s memory directory, run:
o4 reports how many files it removed and updates the model’s context.
/memory clear deletes the memory files, including MEMORY.md, and there’s no undo. It doesn’t touch the memory databases. To remove entries from a database, ask the model to forget them, or delete .o4/memory/memory.db or ~/.o4/memory/global.db yourself.

Turn memory off

Open /config, and on the General tab toggle Auto memory. You can also set memory_enabled in ~/.o4/settings.json, or in .o4/settings.json for one project:
With memory off, o4 doesn’t load MEMORY.md or database memories into the model’s context, doesn’t give the model the memory guidelines, and doesn’t save session summaries. The memory tools are still available to the model.

Your own notes: /remember and /recall

/remember and /recall keep a small key and value store for you. The model never sees it, and it has nothing to do with the memory above. Save a value with = or : between the key and the value:
o4 saves it in .o4/session-memory.json in your project, so it’s still there in later sessions. /recall deploy-cmd shows the value, and /recall on its own lists the saved keys. These commands aren’t listed in /help. Two more unlisted commands help you look at memory:

Agent memory

A custom agent can have its own memory. Set memory in the agent’s front matter to one of these scopes: When the agent starts, o4 adds that directory’s MEMORY.md to its system prompt. o4 ignores the user scope for agents that come from plugins. See subagents.