-
Notifications
You must be signed in to change notification settings - Fork 1
Feature: Deduplication
github-actions[bot] edited this page Sep 19, 2026
·
1 revision
Agent-driven detection and resolution of duplicate memories. The system surfaces candidates; the agent decides what to do.
-
find_duplicatestool: cosine similarity pairs, grouped into connected-component clusters -
dedup_mark_checkedtool: records a pairwise verdict sofind_duplicatesstops re-reporting - Automatic verdict clearing: overwriting either memory clears the verdict
-
thatch-dedup-classifierskill: classifies the relationship and reconciles pairs
- Parameters:
store(optional, default project store),threshold(optional, default 0.85) - Finds memory pairs whose embeddings exceed the cosine similarity threshold
- Groups related pairs into connected-component clusters: a cluster of 3+ labels usually means one topic fragmented across entries that should be consolidated
- Pairs already resolved via
dedup_mark_checkedare skipped - Output: clustered rendering — "Cluster of N:" then
[score:N] labelA <-> labelBlines - Read-only
- Parameters:
label_a,label_b(both required),status(one ofduplicate,supplement,contradiction,unrelated),store(optional) - Records a pairwise verdict so
find_duplicatesstops re-reporting that pair - Labels are slugified internally
- Overwriting either memory later clears the verdict automatically
(DB-level: the
remember()andforgetEntry()functionsDELETEfromdedup_pairsfor the affected slug) - Returns
[checked] store :: a <-> b -> status
-
find_duplicatessurfaces a pair above threshold - Agent loads the
thatch-dedup-classifierskill - Agent classifies the pair:
duplicate(merge),supplement(keep both),contradiction(resolve),unrelated(mark and ignore) - For duplicates: agent merges via
memory_remember(overwrite: true)+memory_forgetthe other entry - Agent calls
dedup_mark_checkedfor the surviving pair - Overwriting either memory clears the verdict → the pair can re-flag if the merge created a new similarity
- PK:
(store, slug_a, slug_b)— slugs stored sorted (a < b) for canonical matching - No FK to entries (slugs are compared by string, not by FK constraint)
- Overwriting or forgetting an entry clears all verdicts involving that slug
(
DELETEinremember()andforgetEntry())
- Shared skill (
artifacts/skills/thatch-dedup-classifier.md) - Classifies the relationship between two similar memory entries
- Provides a structured process: read both entries, compare content, decide verdict, reconcile
- Can be dispatched as a sub-agent by the extraction pipeline or loaded directly by the agent
-
Memory store:
find_duplicatessearches stored memories; merging usesmemory_remember(overwrite)+memory_forget. -
Hygiene: hygiene report counts pending dedup pairs (same
underlying
db.findDuplicates). - Skills:
thatch-dedup-classifieris the skill that guides the reconciliation process. - Extraction: extraction can trigger the dedup cycle when write-time duplicate detection fires.
-
src/db.ts—findDuplicates,markChecked,dedup_pairstable -
src/tool-defs.ts— 2 dedup tools (find_duplicates,dedup_mark_checked) -
artifacts/skills/thatch-dedup-classifier.md— classifier skill
dedup_pairs(store, slug_a, slug_b, status, checked_at, PK(store, slug_a, slug_b))
-
find_duplicatesgroups pairs into clusters (connected components). A cluster of 3+ should be consolidated into one memory. - Verdicts are automatically cleared when either memory is overwritten or forgotten. This is intended — a merge can create a new similarity that should re-flag.
- The threshold (0.85) is higher than the recall nudge threshold (0.55) because "duplicate" is a stronger claim than "relates to".
- Slugs in
dedup_pairsare stored sorted (a < b) for canonical matching regardless of argument order.
User
- Guide: Behavior Engine
- Guide: Cli
- Guide: Code Review
- Guide: Commands
- Guide: Cross Session Chat
- Guide: Deduplication
- Guide: Default Behaviors
- Guide: Extraction
- Guide: Hygiene
- Guide: Memory
- Guide: Notifications
- Guide: Prediction Engine
- Guide: Overview
- Guide: Setup
- Guide: Skills
- Guide: Watchers
Developer
Dev Feature Guides
- Feature: Behavior Engine
- Feature: Cicd
- Feature: Cli
- Feature: Commands
- Feature: Compaction Recovery
- Feature: Cross Session Chat
- Feature: Database
- Feature: Deduplication
- Feature: Extraction
- Feature: Hygiene
- Feature: Memory Store
- Feature: Multi Host
- Feature: Notifications
- Feature: Nudge Pipeline
- Feature: Opencode Plugin
- Feature: Prediction Engine
- Feature: Qa System
- Feature: Overview
- Feature: Repo Identity
- Feature: Session Lifecycle
- Feature: Setup
- Feature: Sideband
- Feature: Watchers