Metadata-Version: 2.4
Name: hindsight-roo-code
Version: 0.1.0
Summary: Roo Code integration for Hindsight - persistent long-term memory for Roo Code via MCP
Project-URL: Homepage, https://github.com/vectorize-io/hindsight
Project-URL: Documentation, https://github.com/vectorize-io/hindsight/tree/main/hindsight-integrations/roo-code
Project-URL: Repository, https://github.com/vectorize-io/hindsight
Author-email: Vectorize <support@vectorize.io>
License: MIT
License-File: LICENSE
Keywords: agents,ai,hindsight,mcp,memory,roo,roo-code
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# hindsight-roo-code

Persistent long-term memory for [Roo Code](https://github.com/RooVetGit/Roo-Code) via [Hindsight](https://github.com/vectorize-io/hindsight).

Run the installer once and every Roo Code session automatically recalls past context before tasks and retains learnings after.

## What It Does

- **Before each task** — Roo Code recalls relevant memories from Hindsight and includes them as context
- **During a task** — agents can store important decisions and discoveries immediately via `retain`
- **After each task** — agents summarize and retain what was accomplished for future sessions

## Prerequisites

> ✨ **Recommended:** [Hindsight Cloud](https://ui.hindsight.vectorize.io/signup) — sign up free, get an API key, and skip the self-hosting setup entirely.

**Self-hosting alternative** — run Hindsight locally:

```bash
pip install hindsight-all
export HINDSIGHT_API_LLM_API_KEY=your-openai-key
hindsight-api  # starts on http://localhost:8888
```

## Installation

```bash
pip install hindsight-roo-code
```

Then, from your project directory:

```bash
hindsight-roo-code install
```

Or with a custom API URL:

```bash
hindsight-roo-code install --api-url https://my-hindsight.example.com
```

Install globally (applies to all projects):

```bash
hindsight-roo-code install --global
```

This writes two files:
- `.roo/mcp.json` — registers the Hindsight MCP server with Roo Code
- `.roo/rules/hindsight-memory.md` — rules injected into every system prompt

## How It Works

```
New task starts
  └─ Roo Code rules instruct agent to call recall
       └─ Relevant memories injected into context

Agent working…
  └─ retain stores decisions/discoveries immediately

Task ends
  └─ Roo Code rules instruct agent to call retain with summary
       └─ Summary stored for future sessions
```

Hindsight exposes `recall` and `retain` as MCP tools via its built-in `/mcp` endpoint. The rules file in `.roo/rules/` tells Roo Code when to call them.

## Configuration

The installer writes to `.roo/mcp.json`:

```json
{
  "mcpServers": {
    "hindsight": {
      "type": "streamable-http",
      "url": "http://localhost:8888/mcp",
      "timeout": 30,
      "alwaysAllow": ["recall", "retain"]
    }
  }
}
```

To change the API URL after installation, edit `.roo/mcp.json` directly or re-run the installer:

```bash
hindsight-roo-code install --api-url https://new-url.example.com
```

## Verifying Setup

1. Start Hindsight (`hindsight-api` or Hindsight Cloud)
2. Open Roo Code in your project
3. Check **Settings → MCP Servers** — `hindsight` should show as connected
4. Start a task — you should see `recall` called automatically

## Development

```bash
uv sync
uv run pytest tests/ -v
```
