Skip to content

feat(openclaw): Add excludeProviders config to skip memory retention for specific channels #331

@GodsBoy

Description

@GodsBoy

Problem

When using the OpenClaw plugin with dynamicBankId: true (default), Hindsight creates separate banks for every messageProvider type. This includes internal/system sessions like heartbeats and cron jobs, which create unknown-default and heartbeat-default banks.

These banks:

  • Accumulate noise ("checked email, nothing urgent", "calendar clear")
  • Waste LLM tokens on retain operations for low-value content
  • Need manual cleanup (via API DELETE) since they auto-recreate on every session

Proposed Solution

Add an excludeProviders (or excludeChannels) config option to the OpenClaw plugin that skips both retain and recall hooks for specified message providers.

{
  "plugins": {
    "entries": {
      "hindsight-openclaw": {
        "config": {
          "excludeProviders": ["unknown", "heartbeat"]
        }
      }
    }
  }
}

Implementation

In hindsight-integrations/openclaw/src/index.ts:

  1. Add excludeProviders?: string[] to PluginConfig in types.ts
  2. In the before_agent_start hook (auto-recall), check if ctx.messageProvider is in the exclude list and skip
  3. In the after_agent_reply hook (retain), same check before retaining

This would prevent bank creation entirely for excluded providers since banks are created lazily on first retain.

Alternatives Considered

  • dynamicBankId: false: Merges all channels into one bank, losing per-channel isolation
  • Manual cleanup: Works but banks recreate on every session, wasting tokens before deletion
  • Cron job to delete banks: Doesn't prevent the token waste from retain operations

Environment

  • hindsight-openclaw: 0.4.10
  • hindsight-embed: 0.4.10
  • OpenClaw: 2026.2.6-3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions