feat(skills): /add-hindsight — bundled MCP wrapper for Hindsight memory#2420
feat(skills): /add-hindsight — bundled MCP wrapper for Hindsight memory#2420carstenf wants to merge 1 commit into
Conversation
e2a9764 to
d9029ef
Compare
Adds an opt-in /add-hindsight skill that wires NanoClaw agent groups to a running [Hindsight](https://github.com/vectorize-io/hindsight) memory engine. Bundles the MCP wrapper directly in this repo (under hindsight-mcp/) so users don't need to clone external repos. .claude/skills/add-hindsight/SKILL.md Operator-facing 5-phase setup: build the bundled wrapper via docker compose, extract dist+node_modules to a host path NanoClaw can mount, register the path in the mount allowlist, wire each group via `ncl groups config add-mcp-server` + sqlite UPDATE for the mount, verify. container/skills/hindsight/SKILL.md In-container discipline skill: when to recall, when to retain, what NOT to retain (secrets, pleasantries, speculation), common anti-patterns (phantom-retain, retain-everything, cross-group leakage). Loaded automatically by the agent on first turn. hindsight-mcp/ Self-contained MCP wrapper. Two transports — HTTP (multi-tenant, Bearer-token auth) and stdio (single-tenant via env). Both share src/tools.ts which implements memory_recall, memory_retain, memory_reflect by proxying to Hindsight's HTTP API. Wrapper-only docker-compose (no engine — assumes engine is running separately). Hindsight engine deployment itself is out of scope — users follow the upstream Hindsight install before running /add-hindsight. Pairs as a sibling to /add-mnemon (different memory backend); pick one. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Validation summaryThis PR has been tested end-to-end on a real NanoClaw v2.0.56 install (running Andy on Discord). Three full passes through the SKILL.md flow confirmed it works as documented. Pass 1 — fresh migration on
|
Summary
Adds an opt-in
/add-hindsightskill that wires NanoClaw v2 agent groups to a Hindsight long-term memory engine. The MCP wrapper that bridges Hindsight's HTTP API to MCP is bundled in this PR (underhindsight-mcp/) — operators don't need to clone external repos to install the skill.Each wired agent group gets a per-group memory bank with three MCP tools:
mcp__hindsight__memory_recall— semantic search across past memoriesmcp__hindsight__memory_retain— persist a durable factmcp__hindsight__memory_reflect— synthesise an answer with evidenceRelationship to existing memory skills
/add-mnemonalready exists for graph-based memory. This is a sibling option backed by Vectorize.io's Hindsight engine — different backend, different operational characteristics (Hindsight extracts entities + links them into a queryable knowledge graph server-side).Operators should pick one — running both is redundant. The skill mentions this in its Credits section.
Structure
.claude/skills/add-hindsight/SKILL.md— operator setup (5 phases: build wrapper, extract stdio binary to host path, register mount, wire each group viancl groups config add-mcp-server, verify).container/skills/hindsight/SKILL.md— in-container memory discipline (when to recall, when to retain, anti-patterns).hindsight-mcp/— self-contained TypeScript wrapper. Two transports (HTTP + stdio), shared tool implementation. Wrapper-only docker-compose (engine deployment is out of scope; assumes operator already has Hindsight running).Prereq (out of scope for this skill)
The Hindsight engine itself is not deployed by this skill. Operator follows the upstream Hindsight install first, then points the wrapper at it via
HINDSIGHT_URL.This split mirrors
/add-gmail-tool,/add-gcal-tooletc. — the skill handles the NanoClaw-side integration; the external service is the operator's responsibility.What's deliberately not in this PR
/add-hindsight, not automatic for every new group.ncl groups config add-mount. The skill currently uses a direct sqlite UPDATE to add the wrapper-binary mount to a group'scontainer_configs.additional_mounts. Happy to drop the SQL oncenclgrows anadd-mountverb (separate PR).Testing
Verified on a NanoClaw v2.0.56 install with a Hindsight engine reachable on
localhost:3850:cd hindsight-mcp && cp .env.example .env && [edit] && docker compose up -d→ wrapper healthy at127.0.0.1:3852/healthnpm install && npm run buildinsidehindsight-mcp/produces a cleandist/ncl groups config add-mcp-server+ sqlite UPDATE for the mount → group respawn → agent seesmcp__hindsight__*tools in its allowlistmemory_retain/memory_recall/memory_reflectagainst the engineconfig remove-mcp-server+ sqlite UPDATE to drop the mount + group restart) cleans upTest plan for reviewers
.claude/skills/add-hindsight/SKILL.mdend-to-end — confirm operator can follow without prior knowledgecontainer/skills/hindsight/SKILL.md— confirm no install-specific examplescd hindsight-mcp && npm install && npm run build— confirm wrapper builds cleanlycd hindsight-mcp && docker compose build— confirm wrapper image builds🤖 Generated with Claude Code