Skip to content

feat: heuristic pre-screening before LLM consolidation #53

@salishforge

Description

@salishforge

Summary

Use text-overlap detection and polarity checking before invoking the LLM for consolidation. Reduces cost and latency for simple cases.

Design

  • Before LLM summarization, run heuristic checks:
    • Text overlap >35% between memories → merge candidate (concat without LLM)
    • Polarity mismatch detection (enabled/disabled, true/false, before/after) → flag contradiction
    • Exact duplicate detection → skip
  • Only invoke LLM for complex batches that need semantic understanding
  • Track LLM cost savings from heuristic bypass

Inspiration

Inspired by hippo-memory (MIT) 35% overlap merge threshold and claude-code-toolkit (MIT) deterministic-vs-probabilistic philosophy.

Closes #53

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestperformancePerformance improvements

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions