Skip to content

fix(memory): Reuse semantic preference duplicates - #973

Merged
dcramer merged 6 commits into
mainfrom
codex/memory-semantic-deduplication
Jul 22, 2026
Merged

dcramer merged 6 commits into
mainfrom
codex/memory-semantic-deduplication

Conversation

@dcramer

@dcramer dcramer commented Jul 22, 2026 •

Copy link
Copy Markdown
Member

Personal preference candidates that restate an active memory now reuse the
existing record instead of creating another recallable copy. Preference
adjudication distinguishes duplicates, replacements, additive preferences,
and uncertainty. Its bounded comparison window reserves space for the nearest
semantic memories and fills by recency, keeping records with missing
best-effort embeddings eligible.

Duplicate reuse preserves idempotent retries and the existing supersession
lifecycle. The memory evals separately assert the user-facing acknowledgement
and active durable state across explicit and passive memory paths. The public
supersession API names remain unchanged.

Classify duplicate preferences alongside replacements and additive preferences, then return the existing active memory instead of storing another copy.

Keep semantic adjudication available without embeddings and assert active recall state in evals.
@vercel

vercel Bot commented Jul 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Jul 22, 2026 1:38am

Request Review

Preserve the strongest lexical and vector candidates when building the bounded preference comparison set.

Cover same-topic additions and explicit duplicate UX, and keep structured model schemas provider-compatible.
Accept duplicate_id from free-form judge output before validating the structured duplicate decision.
Comment thread packages/junior-memory/src/store.ts Resolved
Keep the newest active preference in the bounded model input when weak lexical matches saturate candidate retrieval without embeddings.
Use vector similarity when embeddings exist and recency when they do not. Normalize adjudication outcomes with a discriminated union and centralize duplicate reuse.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f55354d. Configure here.

Comment thread packages/junior-memory/src/store.ts Resolved
Reserve semantic candidate slots and fill the remaining adjudication window by recency so best-effort embedding gaps cannot hide active preferences.
@dcramer
dcramer marked this pull request as ready for review July 22, 2026 01:59
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Jul 22, 2026
@dcramer
dcramer merged commit 2e8ba56 into main Jul 22, 2026
37 of 42 checks passed
@dcramer
dcramer deleted the codex/memory-semantic-deduplication branch July 22, 2026 02:20

This branch was successfully deployed

1 active deployment
Preview – junior-docs — fae28c68 Deployed Jul 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant