Skip to content

Long Term Memory

SpdrByte edited this page Mar 4, 2026 · 2 revisions

Long-Term Memory

In a standard AI session, once you close the window or run /clear, the AI forgets everything. Gemma CLI solves this with a Persistent Fact Storage system, allowing Gemma to learn about you, your preferences, and your projects over time.


🧠 How Memory Works

Gemma CLI manages memory through two distinct actions: Storing and Recalling.

1. Storing Memories (remember tool)

Gemma is instructed to proactively use the remember tool whenever you state a clear fact or preference.

  • Example: "I prefer using dark mode for my code blocks."
  • Action: Gemma calls remember(fact='User prefers dark mode for code blocks', category='preference').
  • Storage: The fact is saved to %APPDATA%\GemmaCLI\memory.json.

2. Recalling Memories (/recall command)

Because token budgets are limited, the CLI does not load your entire life story on every launch. Instead, you can use the /recall command to inject your saved history into the current session.


🚀 The /recall Workflow

  1. Launch the CLI: Start a fresh session.
  2. Type /recall: The CLI scans your memory file and displays a beautiful summary box of everything it knows.
  3. Injection: The facts are automatically appended to the conversation history as a "MEMORY CONTEXT" block.
  4. Acknowledgment: Gemma acknowledges the context and begins using your preferences immediately.

📂 Data Structure

Your memories are stored locally in a simple, human-readable JSON format.

Location: C:\Users\YourUser\AppData\Roaming\GemmaCLI\memory.json

Example Entry:

[
  {
    "date": "2026-03-01 14:20",
    "category": "personal",
    "fact": "The user is working on a GitHub organization privilege audit."
  },
  {
    "date": "2026-03-01 15:45",
    "category": "preference",
    "fact": "The user prefers Pester for PowerShell unit testing."
  }
]

💡 Best Practices

  • Be Explicit: If you want Gemma to never forget something, say "Gemma, remember that I use Node.js version 20 for this project."
  • Categories: Gemma uses categories (e.g., personal, project, preference) to organize your memories. You can see these groupings when you run /recall.
  • Cleanup: To delete a memory, currently you must manually edit the memory.json file in a text editor.

Next Steps: Check out the Interactive Commands reference for other advanced utilities.

Clone this wiki locally