Skip to content

Smarter auto-capture: LLM-based importance scoring and summarization #5

Description

@hd719

Problem

Auto-capture uses regex pattern matching (MEMORY_TRIGGERS) which is brittle:

  • Misses important context that doesn't match patterns (e.g., 'My dog is named Rex')
  • Captures noise that happens to match (e.g., 'I like this color' in a throwaway comment)
  • No summarization — stores raw user text which may be verbose or contain irrelevant detail
  • Category detection is also regex-based and frequently miscategorizes

Proposal

Add an optional LLM-based capture pipeline:

  1. Importance scoring: After regex pre-filter, send candidate messages to a lightweight LLM call to score importance (0-1) and decide whether to store
  2. Summarization: Distill the raw message into a clean, concise memory statement before embedding
  3. Better categorization: Let the LLM classify into categories with higher accuracy
  4. Context-aware capture: Include the assistant's response for context (currently only user messages are evaluated)

Config

{
  "autoCapture": true,
  "captureMode": "llm",  // or "regex" (default, current behavior)
  "captureModel": "gpt-4o-mini",
  "captureMinImportance": 0.6
}

Tradeoffs

  • Adds API cost per conversation (mitigate with batch/cheap models like gpt-4o-mini or Gemini Flash)
  • Regex mode stays as default for zero-cost operation
  • LLM mode would be opt-in

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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