Gemini CLI¶
Connect Gemini CLI to HydraMem for local, verified memory.
Prerequisites¶
- HydraMem on
$PATH(hydramem --version). - Gemini CLI installed and configured.
Connect (MCP)¶
Register HydraMem as a user-scoped MCP server:
Use the console script
hydramem resolves to the installed console script (isolated environment).
If Gemini launches from a context without your $PATH, use the absolute path
to the hydramem binary (which hydramem).
Manual config — ~/.gemini/settings.json
Optional: auto-save hook¶
Gemini CLI can run a command before context compression. Use it to re-ingest your knowledge directory (see the script in Claude Code retention):
{
"hooks": {
"PreCompress": [{
"matcher": "*",
"hooks": [{ "type": "command", "command": "/absolute/path/to/.hydramem/hooks/save.sh" }]
}]
}
}
Usage¶
Once connected, Gemini CLI will:
- Start the HydraMem MCP server on launch.
- Use
hydra_search_toolto find relevant past context. - Call
rememberto persist decisions (when prompted to).
Verify¶
In a Gemini CLI session:
/mcp list— confirmhydramemis CONNECTED.- From a terminal:
hydramem search "…"andhydramem stats --last-7d.