Roo Code
Persistent long-term memory for Roo Code via Hindsight. A one-command installer registers Hindsight's MCP server and injects custom rules that teach Roo to recall context before tasks and retain learnings after.
Quick Startβ
Sign up free β get an API key instantly, no infrastructure to run.
# Install the CLI
pip install hindsight-roo-code
# Install the integration into your project (defaults to Hindsight Cloud)
hindsight-roo-code install
# Restart Roo Code β memory is active
Self-hosting alternative:
# Start Hindsight locally first
pip install hindsight-all
export HINDSIGHT_API_LLM_API_KEY=your-openai-key
hindsight-api
# Then install with the local URL
hindsight-roo-code install --api-url http://localhost:8888
How It Worksβ
Roo Code has two primary extensibility mechanisms: MCP servers for tools and custom rules for system-prompt injection. This integration uses both.
New task starts
ββ Rules file instructs Roo to call recall
ββ Relevant memories injected into context automatically
Agent workingβ¦
ββ Agent calls retain for significant decisions/discoveries
Task ends
ββ Rules file instructs Roo to call retain with a summary
ββ Summary stored for future sessions
The installer writes:
.roo/mcp.jsonβ registers Hindsight's/mcpendpoint as an MCP server, withrecallandretainauto-approved.roo/rules/hindsight-memory.mdβ instructions injected into every Roo system prompt
Installation Optionsβ
Project-local install (default)β
Writes to .roo/ in the current directory β memory is scoped to this project:
hindsight-roo-code install
hindsight-roo-code install --api-url https://api.hindsight.vectorize.io # default (Hindsight Cloud)
hindsight-roo-code install --api-url http://localhost:8888 # self-hosted
hindsight-roo-code install --project-dir /path/to/project
Global installβ
Writes to ~/.roo/ β applies to all projects:
hindsight-roo-code install --global
Configurationβ
The MCP entry written to .roo/mcp.json:
{
"mcpServers": {
"hindsight": {
"type": "streamable-http",
"url": "http://localhost:8888/mcp",
"timeout": 30,
"alwaysAllow": ["recall", "retain"]
}
}
}
To update the API URL after installation, re-run the installer or edit .roo/mcp.json directly.
MCP Toolsβ
Hindsight exposes two tools via its /mcp endpoint:
| Tool | Description |
|---|---|
recall | Search memory for context relevant to a query |
retain | Store content in memory immediately |
The rules file instructs Roo to call these automatically at task start and end. Agents can also call them explicitly mid-task.
Verifying Setupβ
- Start Hindsight and run the installer
- Open Roo Code in your project
- Check Settings β MCP Servers β
hindsightshould show as connected - Start a task β you should see
recallinvoked in the tool call log
Prerequisitesβ
A running Hindsight instance:
Hindsight Cloud (recommended): Sign up β no self-hosting required.
Self-hosted:
pip install hindsight-all
export HINDSIGHT_API_LLM_API_KEY=your-api-key
hindsight-api # starts on http://localhost:8888