ワンクリックで
hindsight
// Persistent agent memory via self-hosted Hindsight. Retain knowledge, recall context, reflect on patterns. Includes multi-bank routing architecture for agent orgs.
// Persistent agent memory via self-hosted Hindsight. Retain knowledge, recall context, reflect on patterns. Includes multi-bank routing architecture for agent orgs.
| name | hindsight |
| description | Persistent agent memory via self-hosted Hindsight. Retain knowledge, recall context, reflect on patterns. Includes multi-bank routing architecture for agent orgs. |
| pipeline-status | ["new"] |
Persistent, structured memory via the official Hindsight CLI (v0.4.14). Store knowledge during tasks, recall context before starting new ones, reflect to synthesize patterns.
Auto-detect bank from git repo name:
BANK=$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "general")
Or use the helper: BANK=$(./scripts/hs-bank-id.sh)
hindsight at ~/.local/bin/hindsight (official v0.4.14)~/.hindsight/config (TOML: api_url, api_key)https://api.hs.delo.sh (resolves to localhost via /etc/hosts)hindsight configure --api-url <url> --api-key <key>hindsight memory retain $BANK "npm test requires --experimental-vm-modules" \
--context "debugging"
Context categories: architecture, conventions, debugging, deployment, dependencies, preferences, session-summary, code-edit
With document tracking (same doc-id = upsert, replacing old facts):
hindsight memory retain $BANK "Project deadline extended to April 15" \
--context "conventions" --doc-id "sprint-notes-2026-03"
hindsight memory recall $BANK "What testing patterns does this project use?"
With options:
hindsight memory recall $BANK "How are auth and session management connected?" \
--budget high --max-tokens 8192 --fact-type world,observation
Budget levels: low (fast, shallow), mid (balanced, default), high (deep graph traversal)
JSON output for programmatic use:
hindsight memory recall $BANK "query" -o json | jq '.results[].text'
Reflect runs an agentic loop: autonomously searches memories, applies bank disposition, generates grounded response with citations.
hindsight memory reflect $BANK "What architectural decisions have shaped this project?"
With context and higher budget:
hindsight memory reflect $BANK "Should we migrate to event sourcing?" \
--context "architecture review" --budget high
Response includes based_on.memories, based_on.mental_models, based_on.directives for citation traceability.
Mental models are curated summaries checked first during reflect. Faster, more consistent answers for recurring topics. Top of the retrieval hierarchy.
hindsight mental-model create $BANK \
--name "Project Architecture" \
--source-query "What is the overall system architecture?"
hindsight mental-model list $BANK
hindsight mental-model refresh $BANK <mental_model_id>
hindsight mental-model delete $BANK <mental_model_id>
Always-enforced rules during reflect. Unlike disposition (soft personality influence), directives are strict behavioral constraints.
hindsight directive create $BANK \
--name "Code Style" \
--content "Always recommend Python type hints and strict typing"
hindsight directive list $BANK
hindsight directive update $BANK <directive_id> --active false
hindsight directive delete $BANK <directive_id>
Documents track where memories came from. Re-retaining with the same doc-id replaces old facts (upsert). Deleting a document removes all its extracted memories.
hindsight document list $BANK
hindsight document get $BANK <document_id>
hindsight document delete $BANK <document_id>
hindsight bank list
hindsight bank stats $BANK
hindsight bank disposition $BANK
hindsight bank disposition $BANK --skepticism 4 --literalism 3 --empathy 2
hindsight bank mission $BANK "Extract technical facts, conventions, and decisions."
Three traits (1-5 scale) that influence reflect behavior:
| Trait | Low (1) | High (5) |
|---|---|---|
| Skepticism | Trusting, accepts claims | Questions and doubts claims |
| Literalism | Flexible interpretation | Exact, literal interpretation |
| Empathy | Detached, fact-focused | Considers emotional context |
For multi-agent or multi-project setups, use domain-first routing to prevent cross-project pollution and recall noise.
wean, chorescore, 33god-coreexec-office for leadership decisions33GOD for org-wide contextAvoid agent-only banks as canonical memory. They drift when agents switch projects.
For each agent/session:
Retain automatically for:
Do NOT retain:
| Symptom | Cause | Fix |
|---|---|---|
| Cross-project pollution | writeBank too broad | Tighten routing to domain bank |
| Recall noise | Too many recallBanks or topK too high | Cap at 3-4 banks |
| Missed intent | Memory-intent regex too strict | Expand capture triggers |
| Latency spike | Recalling too many banks per prompt | Reduce recallBanks count |
The local OpenClaw plugin (workspace/.openclaw/extensions/hindsight-memory/) automates capture and recall so agents don't need to manually call hindsight. Config lives in openclaw.json under plugins.entries.hindsight-memory.
| Hook | Behavior |
|---|---|
before_prompt_build | Auto-recall from resolved banks, inject as context |
message_received | Capture explicit memory intent ("remember", "prefer", "always", "never") |
agent_end | Capture high-signal user messages from the run |
before_reset | Summarize last 16 messages before /new clears context |
before_compaction | Snapshot first 20 messages (initial requirements, arch decisions) before compression |
session_end | Capture session summary with git diff stats |
after_tool_call | Capture tool errors as debugging context |
The plugin resolves writeBank and recallBanks per-request through layered routing:
defaultBank + globalRecallBanksagentRoutes[agentId] overridesessionPrefixRoutes (longest-prefix match on session key)workspaceRoutes (substring match on workspace dir)channelRoutes (exact match on channel ID)maxRecallBanks (default: 4)The plugin skips: messages < 24 chars, slash commands, system messages, heartbeat pings, cron hooks, and upstream errors. The MEMORY_INTENT_RE pattern triggers immediate capture for explicit memory phrases.
| Setting | Default | Purpose |
|---|---|---|
recallTopK | 4 | Max memories per bank per recall |
maxPromptChars | 1200 | Truncation limit for recall queries |
maxCaptureChars | 1200 | Truncation limit for retained content |
maxItemsPerRun | 3 | Max user messages captured per agent run |
includeWriteBankInRecall | true | Auto-include writeBank in recall list |
The Claude Code analog of the OpenClaw plugin. Three hooks under ~/.claude/hooks/ auto-recall on every user prompt, auto-retain on every file edit, and emit a per-session journal at ~/.claude/.hindsight-journal/YYYY-mm-dd-h-m-s.md that explains in plain English what was searched, what bank was resolved, how effective the recall was, and what was retained (with LLM-synthesized rationale for the subjective parts).
| Hook (settings.json event) | Script | Behavior |
|---|---|---|
UserPromptSubmit | hindsight-recall.sh | Resolve bank, recall context, inject into prompt, log recall/recall_skipped event |
PostToolUse (Write|Edit|MultiEdit) | hindsight-retain.sh | Retain edited file context, log retain event |
Stop | hindsight-session-end.sh | Daemonize journal writer (setsid nohup), legacy session-summary retain |
The Stop hook must detach the journal writer with setsid nohup … </dev/null >/dev/null 2>&1 & — Claude Code reaps the hook's process group on return, killing any plain & background that's still waiting on the 30-second hindsight memory reflect call.
Full reference (event schema, env knobs, manual ops, failure modes): references/claude-code-journal.md.
This hindsight skill is the single canonical memory package. Keep governance here (do not split into a second memory-governance skill).
hindsight-memory plugin enabledautoRecall=trueautoCapture=truecaptureDirectIntent=truecaptureToolErrors=truedefaultBank and agentRoutesRun:
python3 /home/delorenj/.agents/skills/hindsight/scripts/audit_hindsight_memory.py
Expect PASS. Non-zero exit means policy drift.
Three independent clocks operate in the OpenClaw runtime. They must not be conflated:
If cron jobs duplicate heartbeat behavior, remove the cron jobs. If heartbeat tries to manage memory refresh timing, stop it.
The old pattern of writing daily logs to memory/YYYY-MM-DD.md and manually promoting to MEMORY.md is replaced by Hindsight's hierarchy:
| Old (file-based) | New (Hindsight) |
|---|---|
| Daily log entries | Raw facts (auto-captured by plugin) |
| Manual promotion review | Observations (auto-consolidated from facts) |
| Curated MEMORY.md | Mental models (user-created summaries) |
The plugin's before_compaction and session_end hooks ensure context survives session boundaries without manual intervention.
Integrate services or agent harnesses into the 33GOD bloodbank event bus. Covers event schemas via holyfields, producing events (NATS direct recommended; Dapr, HTTP /publish, hookd_bridge as alternatives), consuming events (NATS subscribe; Dapr, FastStream, event-toaster catch-all), and wiring agentic coder hooks (Claude Code via hookd, GitHub Copilot CLI via copilot-hooks). Use for adding event publish/consume to a 33GOD service, authoring a schema, integrating a new harness (OpenCode, Cursor, Aider, Codex CLI), or debugging missing envelopes. Triggers include bloodbank, event bus, fire/publish/subscribe bloodbank, NATS subject event., holyfields, CloudEvents, hookd, event-toaster, ntfy.delo.sh/bloodbank, copilot-hooks, agent.session.started, agent.tool.invoked, command.{agent}.{action}. Skip for generic RabbitMQ/NATS/Kafka, n8n (workflow-router), hindsight memory (hindsight), or non-event-bus 33GOD (33god). Biases NATS+holyfields, against hand-edited envelopes or bypassing the bus.
Decision skill for new automation work. Routes the request to the right tool (n8n, a Python service, a Claude skill, cron+bash, or extending an existing workflow) and queries the n8n registry first so existing workflows are not reinvented. Use when the user wants to build, create, wire up, automate, schedule, integrate, or trigger anything. Trigger phrases include "wire up", "automate", "when X happens do Y", "build a workflow", "n8n workflow", "schedule X", "integrate A with B", "webhook", "event-driven", "pipeline", "trigger". ALWAYS run BEFORE designing or implementing new automation, even if the user already named a specific tool. Owner Jarad DeLorenzo, n8n at https://n8n.delo.sh.
Entry-point agent for the tflo (Intelliforia Trello Flow) module. Owns the FSM (idle → implementing → verifying → pr-ready → idle, plus escalated escape) and orchestrates the triage → implement → verify → create-pr cycle by invoking the workflow SKILLs. Use when the user wants to start, resume, check status, abort, or autonomously loop through Intelliforia Trello tickets. Triggers on phrases like "tflo start", "what should I work on next on Intelliforia", "claim the next ticket", "resume the loop".
PR-creation workflow for the tflo (Intelliforia Trello Flow) module. Pushes the ticket branch, opens a PR with a type-aware body (QA instructions for code, summary of findings for discovery, design rationale for design, scannability notes for doc), generates a retro doc, mirrors learnings to Hindsight, moves the Trello card to In Review, and resets the FSM to idle.
Implementation workflow for the tflo (Intelliforia Trello Flow) module. Routes the active ticket through the appropriate subagent chain based on its detected type (code/bug/feature/refactor/discovery/design/doc), produces the deliverable artifacts (architect plan, test plan, dev story, code commits OR analysis doc OR design doc), and transitions the FSM from implementing to verifying. The type field in current-ticket.md determines which chain runs.
Idempotent setup workflow for the tflo (Intelliforia Trello Flow) module. Validates env vars, fetches the initial Trello board snapshot, scaffolds the memory bank skeleton, auto-detects the bot user, and (optionally) updates the project's commit-msg hook to accept tflo-prefixed commits. Re-runnable for re-config.