Voice
Hindsight Openclaw Pro
Production-grade Hindsight memory plugin for OpenClaw β per-agent config, multi-bank recall, IaC bank management
Install
npm install -g
README
# π§ Hindsight OpenClaw Pro
> π Production-grade [Hindsight](https://vectorize.io/hindsight) memory plugin for [OpenClaw](https://openclaw.ai)
>
> Repository: `hindsight-openclaw-pro`





> **Based on [`@vectorize-io/hindsight-openclaw`](https://github.com/vectorize-io/hindsight/tree/main/hindsight-integrations/openclaw)** (MIT, Copyright (c) 2025 Vectorize AI, Inc.)
>
> This project is a production-grade rewrite of the original Hindsight OpenClaw plugin by [Vectorize](https://vectorize.io). The upstream plugin provides the foundation β two-hook architecture (`before_prompt_build` for recall, `agent_end` for retain), bank ID derivation, daemon lifecycle management, and memory formatting. We extend it with per-agent bank configuration, multi-bank recall, session start context, reflect-on-recall, IaC bank management via CLI, and full Hindsight API coverage.
Per-agent bank configuration via IaC template files, multi-bank recall, session start context injection, reflect-on-recall, and a Terraform-style CLI (`hoppro`) for managing bank configurations.
| | Feature | Description |
|---|---------|-------------|
| π | Per-agent config | Each agent gets a bank config template file β missions, entity labels, directives, dispositions |
| ποΈ | Infrastructure as Code | `hoppro plan` / `apply` / `import` β Terraform-style bank management |
| π | Multi-bank recall | `recallFrom` lets an agent query multiple banks per turn (Yoda pattern) |
| π§© | Session start context | Mental models loaded at session start β no cold start problem |
| πͺ | Reflect on recall | Disposition-aware reasoning via Hindsight reflect API |
| π | Bootstrap | First-run auto-apply of bank config to empty banks |
| π’ | Multi-server | Per-agent infrastructure overrides β private + shared Hindsight servers |
> [!IMPORTANT]
> This plugin replaces `@vectorize-io/hindsight-openclaw`.
> It is the **single memory provider** for the gateway β all agents must have a bank config.
---
## πΊοΈ Architecture
```mermaid
graph TD
GW["π OpenClaw Gateway"] --> PLUGIN["π§ hindsight-openclaw-pro"]
PLUGIN --> HOOKS["πͺ Hooks"]
PLUGIN --> SYNC["π Sync Engine"]
PLUGIN --> CLI["β‘ hoppro CLI"]
HOOKS --> RECALL["π₯ before_prompt_build<br/>recall / multi-bank / reflect"]
HOOKS --> RETAIN["π€ agent_end<br/>retain with tags + context"]
HOOKS --> SESSION["π¬ session_start<br/>mental models"]
SYNC --> PLAN["π plan β diff file vs server"]
SYNC --> APPLY["β
apply β push changes"]
SYNC --> IMPORT["π₯ import β pull server state"]
SYNC --> BOOTSTRAP["π bootstrap β first run"]
RECALL --> HS_HOME["π Hindsight (private)"]
RECALL --> HS_OFFICE["π’ Hindsight (shared)"]
RETAIN --> HS_HOME
RETAIN --> HS_OFFICE
style PLUGIN fill:#0f766e,color:#fff,stroke:#0f766e
style HS_HOME fill:#8b5cf6,color:#fff,stroke:#8b5cf6
style HS_OFFICE fill:#1d4ed8,color:#fff,stroke:#1d4ed8
```
---
## β‘ Quick Start
### 1οΈβ£ Install
From npm registry:
```bash
openclaw plugins install hindsight-openclaw-pro
```
Or install globally via npm:
```bash
npm install -g hindsight-openclaw-pro
```
Or from a local build:
```bash
openclaw plugins install /path/to/hindsight-openclaw-pro
```
### 2οΈβ£ Configure plugin
Add to `openclaw.json`:
```json5
{
"plugins": {
"entries": {
"hindsight-openclaw-pro": {
"enabled": true,
"config": {
"hindsightApiUrl": "https://hindsight.office.local",
"hindsightApiToken": "...",
"dynamicBankGranularity": ["agent"],
"bootstrap": true,
"agents": {
"yoda": { "bankConfig": "./banks/yoda.json5" },
"r4p17": { "bankConfig": "./banks/r4p17.json5" },
"bb8": { "bankConfig": "./banks/default.json5" }
}
}
}
}
}
}
```
### 3οΈβ£ Create bank config
Create `.openclaw/banks/yoda.json5`:
```json5
{
// Server-side config
"retain_mission": "Extract strategic decisions, priorities, risks, opportunities.",
"reflect_mission": "You are the strategic advisor. Challenge assumptions.",
"disposition_skepticism": 4,
"disposition_literalism": 2,
"disposition_empathy": 3,
"entity_labels": [...],
"directives": [
{ "name": "cross_department_honesty", "content": "Flag contradictions explicitly." }
],
// Multi-bank recall
"recallFrom": ["yoda", "r4p17", "bb9e", "bb8"],
"recallBudget": "high",
"recallMaxTokens": 2048,
// Session start context
"sessionStartModels": [
{ "type": "mental_model", "bankId": "yoda", "modelId": "strategic-position", "label": "Strategic Position" }
]
}
```
### 4οΈβ£ Apply & start
```bash
hoppro plan --all # preview changes
hoppro apply --all # apply to Hindsight server
openclaw gateway # start with memory
```
---
## ποΈ Configuration
### π¦ Two-Level Config System
```text
openclaw.json (plugin config) banks/r4p17.json5 (bank config template)
βββ Daemon (global only) βββ Server-side (agent-only)
β apiPort, embedPort, embedVersion β retain_mission, reflect_mission
β embedPackagePath, daemonIdleTimeoutβ dispositions, entity_labels, directives
β β
βββ Defaults (overridable per-agent) βββ Infrastructure overrides (optional)
β hindsightApiUrl, hindsightApiToken β hindsightApiUrl, hindsightApiToken
β dynamicBankGranularity, bankIdPfx β dynamicBankGranularity, bankIdPrefix
β llmProvider, llmModel β
β autoRecall, autoRetain, ... βββ Behavioral overrides (optional)
β β recallBudget, retainTags, llmModel, ...
βββ Bootstrap: true|false β
β βββ Multi-bank: recallFrom [...]
βββ Agent mapping βββ Session start: sessionStartModels [...]
agents: { id: { bankConfig } } βββ Reflect: reflectOnRecall, reflectBudget
```
Resolution: `pluginDefaults β bankFile` β shallow merge, bank file wins.
### π Plugin Config Reference
| Option | Default | Per-agent | Description |
|--------|---------|-----------|-------------|
| `hindsightApiUrl` | β | β
| Hindsight API URL |
| `hindsightApiToken` | β | β
| Bearer token for API auth |
| `apiPort` | `9077` | β | Port for local daemon (embed mode only) |
| `embedVersion` | `"latest"` | β | `hindsight-embed` version |
| `embedPackagePath` | β | β | Local `hindsight-embed` path (development) |
| `daemonIdleTimeout` | `0` | β | Daemon idle timeout (0 = never) |
| `dynamicBankId` | `true` | β
| Derive bank ID from context |
| `dynamicBankGranularity` | `["agent","channel","user"]` | β
| Fields for bank ID derivation |
| `bankIdPrefix` | β | β
| Prefix for derived bank IDs |
| `autoRecall` | `true` | β
| Inject memories before each turn |
| `autoRetain` | `true` | β
| Retain conversations after each turn |
| `recallBudget` | `"mid"` | β
| Recall effort: `low`, `mid`, `high` |
| `recallMaxTokens` | `1024` | β
| Max tokens injected per turn |
| `recallTypes` | `["world","experience"]` | β
| Memory types to recall |
| `retainRoles` | `["user","assistant"]` | β
| Roles captured for retention |
| `retainEveryNTurns` | `1` | β
| Retain every Nth turn |
| `llmProvider` | auto | β
| LLM provider for extraction |
| `llmModel` | provider default | β
| Model name |
| `bootstrap` | `false` | β | Auto-apply bank configs on first run |
| `agents` | `{}` | β | Per-agent bank config registration |
### π Bank Config File Reference
| Field | Type | Scope | Description |
|-------|------|-------|-------------|
| `retain_mission` | string | π§ Server | Guides fact extraction during retain |
| `observations_mission` | string | π§ Server | Controls observation consolidation |
| `reflect_mission` | string | π§ Server | Prompt for reflect operations |
| `retain_extraction_mode` | string | π§ Server | Extraction strategy (`concise`, `verbose`) |
| `disposition_skepticism` | 1β5 | π§ Server | How skeptical during extraction |
| `disposition_literalism` | 1β5 | π§ Server | How literally statements are interpreted |
| `disposition_empathy` | 1β5 | π§ Server | Weight given to emotional content |
| `entity_labels` | EntityLabel[] | π§ Server | Custom entity types for classification |
| `directives` | `{name,content}[]` | π§ Server | Standing instructions for the bank |
| `retainTags` | string[] | π·οΈ Tags | Tags added to all retained facts |
| `retainContext` | string | π·οΈ Tags | Source label for retained facts |
| `retainObservationScopes` | string \| string[][] | π·οΈ Tags | Observation consolidation scoping |
| `recallTags` | string[] | π·οΈ Tags | Filter recall results by tags |
| `recallTagsMatch` | `any\|all\|any_strict\|all_strict` | π·οΈ Tags | Tag filter mode |
| `recallFrom` | string[] | π Multi-bank | Banks to query (parallel recall) |
| `sessionStartModels` | SessionStartModelConfig[] | π§© Session | Mental models loaded at session start |
| `reflectOnRecall` | boolean | πͺ Reflect | Use reflect instead of recall |
| `reflectBudget` | `low\|mid\|high` | πͺ Reflect | Reflect effort level |
| `reflectMaxTokens` | number | πͺ Reflect | Max tokens for reflect response |
All plugin-level behavioral options can also be overridden per-agent in the bank config file.
---
## π Multi-Server Support
Per-agent infrastructure overrides enable connecting different agents to different Hindsight servers:
```text
Gateway
βββ π r4p17 (private) β hindsightApiUrl: "https://hindsight.home.local"
βββ π l337 (health) β hindsightApiUrl: "https://hindsight.home.local"
βββ π’ bb8 (company) β hindsightApiUrl: "https://hindsight.office.local"
βββ π’ bb9e (company) β hindsightAp
... (truncated)
voice
Comments
Sign in to leave a comment