docs/cli/auto-memory.md
Auto Memory is an experimental feature that mines your past Gemini CLI sessions in the background and proposes durable memory updates and reusable Agent Skills. You review each candidate before it becomes available to future sessions: apply memory updates, promote skills, or discard anything you do not want.
<!-- prettier-ignore -->[!NOTE] This is an experimental feature currently under active development.
Every session you run with Gemini CLI is recorded locally as a transcript. Auto
Memory scans those transcripts for durable facts, preferences, workflow
constraints, and procedural patterns that recur across sessions. It can draft
memory updates as unified diff .patch files and draft reusable procedures as
SKILL.md files. All candidates are held in a project-local inbox until you
approve or discard them.
You'll use Auto Memory when you want to:
SKILL.md by hand.Auto Memory complements—but does not replace—the
save_memory tool, which captures single facts into
GEMINI.md when the agent explicitly calls it. Auto Memory infers candidates
from past sessions, writes reviewable patches or skill drafts, and never applies
them without your approval.
Auto Memory is off by default. Enable it in your settings file:
Open your global settings file at ~/.gemini/settings.json. If you only
want Auto Memory in one project, edit .gemini/settings.json in that
project instead.
Add the experimental flag:
{
"experimental": {
"autoMemory": true
}
}
Restart Gemini CLI. The flag requires a restart because the extraction service starts during session boot.
Auto Memory runs as a background task on session startup. It does not block the UI, consume your interactive turns, or surface tool prompts.
~/.gemini/tmp/<project>/chats/. Sessions are eligible only if they have
been idle for at least three hours and contain at least 10 user messages.GEMINI.md files.Use the /memory inbox slash command to open the inbox dialog at any time:
Command: /memory inbox
The dialog groups pending items into new skills, skill updates, and memory updates. From there you can:
SKILL.md body before deciding.~/.gemini/skills/) or workspace
(.gemini/skills/) directory..patch proposal against an existing skill.~/.gemini/GEMINI.md file.Promoted skills become discoverable in the next session and follow the standard skill discovery precedence. Applied memory patches update the underlying memory files and reload memory for the current session.
To turn off background extraction, set the flag back to false in your settings
file and restart Gemini CLI:
{
"experimental": {
"autoMemory": false
}
}
Disabling the flag stops the background service immediately on the next session
start. Existing inbox items remain on disk; you can either drain them with
/memory inbox first or remove the project memory directory manually.
GEMINI.md files are not
auto-extractable. Auto Memory can propose private project memory, global
personal memory, and skills.GEMINI.md workflows.