Skip to content

retrieval: Within-user pattern surfacing via search-time signals #292

@rdwj

Description

@rdwj

Summary

Detect patterns within a single user's memory stream and surface them during active sessions. When search results overlap with a cluster of recent memories (3+ with cosine similarity > 0.80 in 7-30 days), annotate the response with a pattern_signals block. Optional harness-level push (Option B+) runs pattern checks on every turn via UserPromptSubmit hook.

Design reference

  • planning/autonomous-curation-agents.md Section 7 (Within-user pattern surfacing, Option B+)

Scope

Search-time signals (Option B):

  • Lightweight clustering pass over user's recent memories (same domain, last 7-30 days) during search
  • If cluster exceeds threshold, annotate response with pattern_signals: pattern type, matching memory count, time window, representative ID, summary hint
  • Read-path enhancement only -- one additional pgvector query scoped to user's recent memories
  • No new agent, no new RBAC, no new infrastructure

Harness-level push (Option B+):

  • Agent harness embeds each turn and checks against user's recent memories
  • If cluster detected, inject <memory-pattern-signal> block into context for next turn
  • Claude Code integration via UserPromptSubmit hook (extends existing SessionStart pattern)
  • Cost: one embedding call + one pgvector query per turn
  • Configurable via .memoryhub.yaml: memory_loading.pattern_signals.enabled, min_cluster_size, time_window_days, similarity_threshold
  • Disabled by default

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions