Skip to content

fix(l1): drop ungrounded extracted memories#266

Open
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-post-extraction-validation
Open

fix(l1): drop ungrounded extracted memories#266
YOMXXX wants to merge 1 commit into
TencentCloud:mainfrom
YOMXXX:fix/l1-post-extraction-validation

Conversation

@YOMXXX

@YOMXXX YOMXXX commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a conservative post-LLM validation pass for L1 extraction output.
  • Drops extracted memories whose significant tokens have too little overlap with their source messages, preventing obvious hallucinated facts from reaching L1 storage.
  • Keeps normal paraphrases/rewrites by using a low overlap threshold and falling back to the whole qualified batch when source IDs are missing.

Why

Issue #82 notes that LLM extraction output currently goes directly to dedup/storage without quality validation. A model can emit plausible but unsupported persona/instruction facts, and those facts then become durable memory. This PR adds a narrow source-grounding gate before dedup/write.

Tests

  • npm test -- src/core/record/l1-extractor.test.ts
  • npm test
  • npm run build

Refs #82

@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

We have received multiple PRs submitted by you. Thank you for your consistent contributions. We will review them one by one and provide feedback accordingly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants