Write-time reconciliation
New writes reconcile against what the store already knows — repetition strengthens the canonical entry instead of appending a duplicate.
An append-only memory degrades in a predictable way: every reflection cycle re-states the same stable lesson, every conversation re-states the same fact, and after a month the store holds ten copies of each — bloating retrieval candidates and splitting outcome history across duplicates that should have been one strengthening entry. Write-time reconciliation checks each incoming write against similar existing entries and decides whether it is genuinely new. Use this pattern when your agents run repeatedly over the same domain — which is exactly when memory is worth having.
How it works
Three mechanisms, from fully automatic to fully explicit:
1. Lesson reconciliation (on by default). When reflection extracts a lesson that near-duplicates an existing lesson in the same run, the write becomes a recurrence bump on the canonical entry — its recurrence_count rises — instead of a new stored copy. Candidates are proposed by semantic search and confirmed by a deterministic normalized-token gate, so paraphrase restatements ("100-row limit for batch uploads" vs "maximum batch size of 100 rows per upload") reconcile while unrelated lessons about the same system do not. Recurrence is also the signal the promotion ladder reads, so repetition feeds directly into scope promotion — see The learning loop.
2. Fact reconciliation (opt-in instance feature). When enabled, each ingested fact is compared against similar non-stale facts in the same scope and one of four operations is chosen:
| Operation | When | Effect |
|---|---|---|
ADD | The fact is unrelated to anything stored | Stored as a new entry (the common path — no LLM call) |
NOOP | A restatement of an existing fact | Confirmation bump on the canonical entry; no new row |
UPDATE | A refinement of an existing fact | The stored entry is updated in place |
SUPERSEDE | A changed value that contradicts the stored fact | New entry stored; the old one is marked is_stale with superseded_by (see Bi-temporal memory) |
Near-exact restatements short-circuit to NOOP deterministically; anything subtler goes to a cheap op-decider model. A malformed decision always degrades to ADD — reconciliation is an optimization, never a gate that can lose a write.
3. Explicit developer control. When you know two writes are the same logical record, don't make the store guess:
upsert_keyonremember()(and on raw ingest items) — an existing entry with the same key in the same session/user scope is updated in place instead of duplicated. Deterministic update-in-place for records with a natural identity ("acme").deduplicate: trueon a rawbatch_insert— collapses exact duplicates (same text, source, and metadata) within that one request, so a retried or naively assembled batch doesn't double-write.
Walkthrough
Nimbus's flaky CSV-export bug generates near-identical tickets for weeks. Ari resolves each one and reflects; without reconciliation, every resolution would pin another copy of the same lesson.
When not to use it
| Situation | Reach for instead |
|---|---|
| Every restatement is itself evidence (e.g. counting how often customers report an issue) | Plain appends — reconciliation would collapse the signal you're measuring. Keep each report as its own entry and aggregate at query time |
| The record has a natural identity you already know | upsert_key — deterministic beats similarity-gated every time |
| You need the old value queryable after a change | You already have it: SUPERSEDE keeps history (see Bi-temporal memory); nothing extra to do |
| Duplicates already accumulated before reconciliation was on | Sleep-time consolidation merges near-duplicate guidance missed at write time |
Related
- The learning loop — where reflection-extracted lessons come from, and how recurrence feeds promotion
- Bi-temporal memory — what
SUPERSEDEdoes with the old belief - Sleep-time consolidation — the idle-time counterpart that catches what write-time missed
- The memory model — lessons, facts, and the rest of the entry taxonomy
- Trust, confidence, and staleness — how a single strengthened entry earns
knowledge_confidencethat split duplicates never could
Configuration. These are instance features. Lesson reconciliation is on by default (MUBIT_CL_WRITE_RECONCILE=0 disables it; MUBIT_CL_RECONCILE_MIN_SIM tunes the recurrence gate, default 0.5). Fact reconciliation is opt-in (MUBIT_CL_FACT_RECONCILE=1; MUBIT_CL_FACT_RECONCILE_MIN_SIM sets the candidate floor, default 0.75 — deliberately conservative because UPDATE rewrites stored content in place). upsert_key and deduplicate need no configuration.