fleet-memory/hindsight-integrations/openclaw
Nicolò Boschi 6c695eb9f8
fix: improve openclaw test coverage (#396)
* fix: improve openclaw test coverage

* test(openclaw): export stripMemoryTags/extractRecallQuery and add hook integration tests

- Extract stripMemoryTags and extractRecallQuery as exported pure functions
  from index.ts so hooks share one implementation and tests cover the real code
- Update before_agent_start to call extractRecallQuery; update agent_end to
  call stripMemoryTags instead of duplicating the regex inline
- Rewrite index.test.ts to import the real functions (no more local duplicate)
  and add 11 tests for extractRecallQuery covering all envelope-stripping cases
- Add tests/hooks.integration.test.ts: loads the plugin via mock MoltbotPluginAPI
  in HTTP mode, spies on client.recall/retain, and exercises all hook behaviours:
  excluded providers, short messages, memory injection format, tag stripping,
  transcript formatting, array content blocks, metadata, document_id derivation
2026-02-18 14:10:33 +01:00
..
src fix: improve openclaw test coverage (#396) 2026-02-18 14:10:33 +01:00
tests fix: improve openclaw test coverage (#396) 2026-02-18 14:10:33 +01:00
.gitignore fix: rename openclawd to openclaw (#252) 2026-01-30 13:04:42 +01:00
install.sh fix: openclaw improve config setup (#258) 2026-01-30 17:36:49 +01:00
openclaw.plugin.json fix(openclaw): shell safety, HTTP dual-mode, lazy reinit, per-user banks (#388) 2026-02-18 13:09:02 +01:00
package-lock.json fix(openclaw): avoid memory retain recursion (#362) 2026-02-13 10:47:39 +01:00
package.json fix: improve openclaw test coverage (#396) 2026-02-18 14:10:33 +01:00
README.md feat: improve openclaw and hindisght-embed params (#279) 2026-02-03 09:39:04 +01:00
tsconfig.json fix: rename openclawd to openclaw (#252) 2026-01-30 13:04:42 +01:00
vitest.config.ts fix: rename openclawd to openclaw (#252) 2026-01-30 13:04:42 +01:00
vitest.integration.config.ts fix: improve openclaw test coverage (#396) 2026-02-18 14:10:33 +01:00

Hindsight Memory Plugin for OpenClaw

Biomimetic long-term memory for OpenClaw using Hindsight. Automatically captures conversations and intelligently recalls relevant context.

Quick Start

# 1. Configure your LLM provider for memory extraction
# Option A: OpenAI
export OPENAI_API_KEY="sk-your-key"

# Option B: Claude Code (no API key needed)
export HINDSIGHT_API_LLM_PROVIDER=claude-code

# Option C: OpenAI Codex (no API key needed)
export HINDSIGHT_API_LLM_PROVIDER=openai-codex

# 2. Install and enable the plugin
openclaw plugins install @vectorize-io/hindsight-openclaw

# 3. Start OpenClaw
openclaw gateway

That's it! The plugin will automatically start capturing and recalling memories.

Documentation

For full documentation, configuration options, troubleshooting, and development guide, see:

OpenClaw Integration Documentation

Development

To test local changes to the Hindsight package before publishing:

  1. Add embedPackagePath to your plugin config in ~/.openclaw/openclaw.json:
{
  "plugins": {
    "entries": {
      "hindsight-openclaw": {
        "enabled": true,
        "config": {
          "embedPackagePath": "/path/to/hindsight-wt3/hindsight-embed"
        }
      }
    }
  }
}
  1. The plugin will use uv run --directory <path> hindsight-embed instead of uvx hindsight-embed@latest

  2. To use a specific profile for testing:

# Check daemon status
uvx hindsight-embed@latest -p openclaw daemon status

# View logs
tail -f ~/.hindsight/profiles/openclaw.log

# List profiles
uvx hindsight-embed@latest profile list

License

MIT