Prerequisite: Install the
engram binary first via Homebrew or binary download.One-Command Setup (Recommended)
- Registers
mcpServers.engramin~/.gemini/settings.json(Windows:%APPDATA%\gemini\settings.json) - Writes
~/.gemini/system.mdwith the Engram Memory Protocol - Ensures
~/.gemini/.envcontainsGEMINI_SYSTEM_MD=1so Gemini loads the system prompt
What Gets Configured
MCP Server Registration
Adds to~/.gemini/settings.json:
Memory Protocol System Prompt
Writes the full Memory Protocol to~/.gemini/system.md:
Environment Variable
Adds to~/.gemini/.env:
system.md on every session start.
Manual Setup (Alternative)
If you prefer to configure manually:Add MCP Server
Edit~/.gemini/settings.json (Windows: %APPDATA%\gemini\settings.json):
Add Memory Protocol
Copy the Memory Protocol from DOCS.md to~/.gemini/system.md.
Enable System Prompt
Add to~/.gemini/.env:
Compaction Recovery
The Memory Protocol insystem.md includes compaction recovery instructions:
Platform-Specific Notes
Windows
engram setup gemini-cli writes to:
- MCP config:
%APPDATA%\gemini\settings.json - System prompt:
%APPDATA%\gemini\system.md - Environment:
%APPDATA%\gemini\.env
macOS / Linux
engram setup gemini-cli writes to:
- MCP config:
~/.gemini/settings.json - System prompt:
~/.gemini/system.md - Environment:
~/.gemini/.env
Memory Protocol Behavior
With the Memory Protocol insystem.md, the agent:
- Saves proactively after bugfixes, decisions, discoveries, patterns
- Searches reactively when you say “remember” or “what did we do”
- Searches proactively when starting work that might overlap past sessions
- Closes sessions with
mem_session_summarybefore saying “done” - Recovers state after compaction with
mem_context
Troubleshooting
MCP tools not available
Check MCP server registration:Agent doesn’t use memory
Check thatsystem.md exists and GEMINI_SYSTEM_MD=1 is set:
Server not running
Manually start the server:Next Steps
- Learn about the Memory Protocol
- Explore MCP Tools
- Set up Git Sync for team memory sharing