← Back to Plugins
Voice

Hindclaw

mrkhachaturov By mrkhachaturov ⭐ 5 stars 👁 4 views ▲ 0 votes

Production-grade Hindsight memory plugin for OpenClaw β€” per-agent config, multi-bank recall, IaC bank management

GitHub

Install

openclaw plugins install hindclaw

README

<p align="center">
  <img src=".github/assets/hindclaw.png" alt="HindClaw">
</p>

<p align="center">
  Self-hosted Hindsight management platform β€” multi-tenant access control, user/group permissions, client integrations, and infrastructure tooling for AI agent memory.
</p>

<p align="center">
  <a href="https://www.npmjs.com/package/hindclaw"><img src="https://img.shields.io/npm/v/hindclaw?style=flat-square&color=0f766e" alt="npm"></a>
  <a href="https://pypi.org/project/hindclaw-extension/"><img src="https://img.shields.io/pypi/v/hindclaw-extension?style=flat-square&color=0f766e" alt="PyPI"></a>
  <img src="https://img.shields.io/badge/license-MIT-10b981?style=flat-square" alt="License">
</p>

<p align="center">
  <a href="https://hindclaw.pro">Documentation</a> &middot;
  <a href="https://hindsight.vectorize.io">Hindsight</a> &middot;
  <a href="https://openclaw.ai">OpenClaw</a>
</p>

---

## Why HindClaw?

Built on [Hindsight](https://hindsight.vectorize.io) β€” the highest-scoring agent memory system on the [LongMemEval benchmark](https://vectorize.io/#:~:text=The%20New%20Leader%20in%20Agent%20Memory).

The official Hindsight plugin gives you auto-capture and auto-recall. HindClaw adds what you need to run it in production β€” two orthogonal dimensions that combine per-message:

**WHO** (permissions) β€” resolved through 4 layers, each can override any field:
- Global config defaults β†’ group merge β†’ bank group override β†’ bank user override
- Not just `recall: true/false` β€” LLM model, token budget, extraction depth, tag visibility, retention frequency. 11 configurable fields at every layer.

**HOW** (strategies) β€” resolved per topic:
- Each conversation topic routes to a named strategy with its own extraction mission, mode, and entity labels
- Strategies are orthogonal to permissions β€” a blocked user never reaches strategy resolution

```mermaid
graph TD
    MSG["πŸ’¬ Message: user + bank + topic"] --> PERM["πŸ” Resolve permissions<br/>for THIS user on THIS bank"]
    MSG --> STRAT["🎯 Resolve strategy<br/>for THIS topic on THIS bank"]
    PERM --> R{"recall?"}
    PERM --> W{"retain?"}
    R -->|true| RECALL["πŸ“₯ Recall<br/>budget, tokens, tag filters<br/>from resolved permissions"]
    R -->|false| NO_R["🚫 No recall"]
    W -->|true| RETAIN["πŸ“€ Retain<br/>roles, tags, LLM model<br/>+ topic strategy"]
    W -->|false| NO_W["🚫 No retain"]
    STRAT --> RETAIN

    style MSG fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style PERM fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style STRAT fill:#c2410c,color:#fff,stroke:#c2410c
    style RECALL fill:#10b981,color:#fff,stroke:#10b981
    style RETAIN fill:#10b981,color:#fff,stroke:#10b981
    style NO_R fill:#ef4444,color:#fff,stroke:#ef4444
    style NO_W fill:#f59e0b,color:#fff,stroke:#f59e0b
```

Every combination of **(user Γ— bank Γ— topic)** can produce different behavior β€” different access flags, different LLM model, different recall budget, different extraction strategy.

---

### πŸ” Per-User Access & Behavioral Overrides

The same user gets different behavior on different agents. Every parameter is configurable per group, overridable per bank and per user.

```mermaid
graph TD
    MSG["πŸ’¬ Message"] --> ID["πŸ” Resolve identity"]
    ID --> GROUPS["πŸ‘₯ Merge group permissions"]
    GROUPS --> BANK{"🏦 Bank overrides?"}
    BANK -->|group override| BG["βš™οΈ Bank group permissions"]
    BANK -->|user override| BU["πŸ‘€ Bank user permissions"]
    BANK -->|none| GLOBAL["πŸ“‹ Global defaults"]
    BG --> RESOLVED["βœ… Resolved permissions"]
    BU --> RESOLVED
    GLOBAL --> RESOLVED
    RESOLVED --> TOPIC{"🎯 Topic?"}
    TOPIC -->|mapped| STRATEGY["πŸ“ Named strategy"]
    TOPIC -->|unmapped| DEFAULT["πŸ“ Bank defaults"]

    style MSG fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style ID fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style GROUPS fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style BG fill:#c2410c,color:#fff,stroke:#c2410c
    style BU fill:#c2410c,color:#fff,stroke:#c2410c
    style GLOBAL fill:#c2410c,color:#fff,stroke:#c2410c
    style RESOLVED fill:#0f766e,color:#fff,stroke:#0f766e
    style STRATEGY fill:#10b981,color:#fff,stroke:#10b981
    style DEFAULT fill:#f59e0b,color:#fff,stroke:#f59e0b
```

**Override chain** (most specific wins):

```
config.json5 defaults β†’ group β†’ bank group β†’ bank user
```

**Configurable at every level:** `recall`, `retain`, `retainRoles`, `retainTags`, `retainEveryNTurns`, `recallBudget`, `recallMaxTokens`, `recallTagGroups`, `llmModel`, `llmProvider`, `excludeProviders`

**Same user, different agents:**

| | agent-1 (strategic) | agent-2 (financial) |
|---|---|---|
| **user-1** (executive) | recall + retain, high budget, no filters | recall + retain, high budget, no filters |
| **user-2** (dept-head) | recall only, mid budget, filtered | recall + retain, high budget (user override) |
| **user-3** (staff) | blocked (no entry β†’ `_default`) | recall only, low budget, filtered |
| **anonymous** | blocked | blocked |

### πŸ”€ Cross-Agent Recall

One agent queries multiple banks in parallel. Permissions checked per-bank.

```mermaid
graph LR
    Q["πŸ” agent-1 recall query"] --> B1["🏦 bank: agent-1"]
    Q --> B2["🏦 bank: agent-2"]
    Q --> B3["🏦 bank: agent-3"]
    B1 -->|recall: true| R1["πŸ“₯ results"]
    B2 -->|recall: true| R2["πŸ“₯ results"]
    B3 -->|recall: false| SKIP["🚫 skipped"]
    R1 --> MERGE["πŸ”€ Merge + interleave"]
    R2 --> MERGE
    MERGE --> INJECT["πŸ’‰ Inject into prompt"]

    style Q fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style B1 fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style B2 fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style B3 fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style R1 fill:#10b981,color:#fff,stroke:#10b981
    style R2 fill:#10b981,color:#fff,stroke:#10b981
    style SKIP fill:#ef4444,color:#fff,stroke:#ef4444
    style MERGE fill:#0f766e,color:#fff,stroke:#0f766e
    style INJECT fill:#0f766e,color:#fff,stroke:#0f766e
```

### 🎯 Named Retain Strategies

Different conversation topics routed to different extraction strategies.

```mermaid
graph LR
    MSG["πŸ’¬ Incoming message"] --> TOPIC{"🎯 Topic ID?"}
    TOPIC -->|280304| DEEP["πŸ”¬ deep-analysis"]
    TOPIC -->|280418| LIGHT["⚑ lightweight"]
    TOPIC -->|other| DEFAULT["πŸ“‹ bank default"]
    DEEP --> RETAIN1["πŸ“ Verbose extraction"]
    LIGHT --> RETAIN2["πŸ“ Concise extraction"]
    DEFAULT --> RETAIN3["πŸ“ Standard extraction"]

    style MSG fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style DEEP fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style LIGHT fill:#f59e0b,color:#fff,stroke:#f59e0b
    style DEFAULT fill:#c2410c,color:#fff,stroke:#c2410c
    style RETAIN1 fill:#10b981,color:#fff,stroke:#10b981
    style RETAIN2 fill:#10b981,color:#fff,stroke:#10b981
    style RETAIN3 fill:#10b981,color:#fff,stroke:#10b981
```

### πŸ—οΈ Infrastructure as Code

`hindclaw plan` shows what will change. `hindclaw apply` syncs it. Like Terraform for memory banks.

```mermaid
graph LR
    FILE["πŸ“‚ Bank config files"] --> PLAN["πŸ“‹ hindclaw plan"]
    PLAN --> DIFF{"πŸ” Changes?"}
    DIFF -->|none| OK["βœ… Up to date"]
    DIFF -->|yes| SHOW["πŸ“„ Show diff"]
    SHOW --> APPLY["⚑ hindclaw apply"]
    APPLY --> CONFIRM{"❓ Confirm?"}
    CONFIRM -->|yes| SYNC["πŸš€ Sync to Hindsight"]
    CONFIRM -->|no| CANCEL["❌ Cancelled"]

    style FILE fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style PLAN fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style APPLY fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style OK fill:#10b981,color:#fff,stroke:#10b981
    style SHOW fill:#f59e0b,color:#fff,stroke:#f59e0b
    style SYNC fill:#10b981,color:#fff,stroke:#10b981
    style CANCEL fill:#ef4444,color:#fff,stroke:#ef4444
```

### 🧩 Session Start Context

Mental models loaded before the first message β€” no cold start.

```mermaid
graph LR
    START["🎬 Session starts"] --> LOAD["πŸ“¦ Load mental models"]
    LOAD --> M1["🧠 Project context"]
    LOAD --> M2["πŸ‘€ User preferences"]
    M1 --> INJECT["πŸ’‰ Inject into system prompt"]
    M2 --> INJECT
    INJECT --> READY["βœ… Agent ready with full context"]
    READY --> MSG1["πŸ’¬ First user message"]

    style START fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style LOAD fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style M1 fill:#c2410c,color:#fff,stroke:#c2410c
    style M2 fill:#c2410c,color:#fff,stroke:#c2410c
    style INJECT fill:#0f766e,color:#fff,stroke:#0f766e
    style READY fill:#10b981,color:#fff,stroke:#10b981
    style MSG1 fill:#10b981,color:#fff,stroke:#10b981
```

### πŸͺž Reflect on Recall

Instead of raw memory retrieval, the agent reasons over its memories.

```mermaid
graph LR
    Q["πŸ’¬ User question"] --> MODE{"πŸͺž Reflect enabled?"}
    MODE -->|yes| REFLECT["🧠 Hindsight reflect API"]
    MODE -->|no| RECALL["πŸ“₯ Hindsight recall API"]
    REFLECT --> REASON["πŸ’‘ LLM reasons over memories"]
    REASON --> ANSWER["βœ… Grounded response"]
    RECALL --> RAW["πŸ“‹ Raw memory list"]
    RAW --> ANSWER

    style Q fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style REFLECT fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style RECALL fill:#c2410c,color:#fff,stroke:#c2410c
    style REASON fill:#0f766e,color:#fff,stroke:#0f766e
    style RAW fill:#f59e0b,color:#fff,stroke:#f59e0b
    style ANSWER fill:#10b981,color:#fff,stroke:#10b981
```

### 🌐 Multi-Server Support

Per-agent infrastructure routing β€” one gateway, multiple Hindsight servers.

```mermaid
graph LR
    GW["🌐 Gateway"] --> A1["πŸ€– agent-1"]
    GW --> A2["πŸ€– agent-2"]
    GW --> A3["πŸ€– agent-3"]
    GW --> A4["πŸ€– agent-4"]
    A1 --> HOME["🏠 Home server"]
    A2 --> HOME
    A3 --> OFFICE["🏒 Office server"]
    A4 --> LOCAL["πŸ’» Local daemon"]

    style GW fill:#0f766e,color:#fff,stroke:#0f766e
    style A1 fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style A2 fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style A3 fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style A4 fill:#1d4ed8,color:#fff,stroke:#1d4ed8
    style HOME fill:#8b5cf6,color:#fff,stroke:#8b5cf6
    style OFFICE fill:#c2410c,color:#fff,st

... (truncated)
voice

Comments

Sign in to leave a comment

Loading comments...