docs/cli/auto-memory.md
Auto Memory is an experimental feature that mines your past Gemini CLI sessions in the background and turns recurring workflows into reusable Agent Skills. You review, accept, or discard each extracted skill before it becomes available to future sessions.
<!-- 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 procedural patterns that recur across
sessions, then drafts each pattern as a SKILL.md file in a project-local
inbox. You inspect the draft, decide whether it captures real expertise, and
promote it to your global or workspace skills directory if you want it.
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. Auto Memory captures multi-step procedures into skills.
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.confucius)
reviews the session index, reads any sessions that look like they contain
repeated procedural workflows, and drafts new SKILL.md files. Its
instructions tell it to default to creating zero skills unless the evidence
is strong, so most runs produce no inbox items..patch file. Auto Memory dry-runs each patch and discards any that do not
apply cleanly.Use the /memory inbox slash command to open the inbox dialog at any time:
Command: /memory inbox
The dialog lists each draft skill with its name, description, and source sessions. From there you can:
SKILL.md body before deciding.~/.gemini/skills/) or workspace
(.gemini/skills/) directory..patch proposal against an existing skill.Promoted skills become discoverable in the next session and follow the standard skill discovery precedence.
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.
save_memory and GEMINI.md workflows.