gemini-cli

Memory Tool (save_memory)

This document describes the save_memory tool for the Gemini CLI.

Description

Use save_memory to save and recall information across your Gemini CLI sessions. With save_memory, you can direct the CLI to remember key details across sessions, providing personalized and directed assistance.

Arguments

save_memory takes one argument:

How to use save_memory with the Gemini CLI

The tool appends the provided fact to a special GEMINI.md file located in the user’s home directory (~/.gemini/GEMINI.md). This file can be configured to have a different name.

Once added, the facts are stored under a ## Gemini Added Memories section. This file is loaded as context in subsequent sessions, allowing the CLI to recall the saved information.

Usage:

save_memory(fact="Your fact here.")

save_memory examples

Remember a user preference:

save_memory(fact="My preferred programming language is Python.")

Store a project-specific detail:

save_memory(fact="The project I'm currently working on is called 'gemini-cli'.")

Important notes