Repository navigation
Re-extracting a document takes back the described things it made, so an unchanged document adds no second copy of them or their statements - #1568
Merged
Conversation
…an unchanged document adds no second copy of them or their statements One run already reuses one entity per description across a document's chunks. A re-extraction started that map empty, so every round of an unchanged document made a new described entity for each description and a new statement pointing at it (#1534: 12 -> 53 described entities over six rounds). The map now starts from the described things this document's live facts sit on, followed through merges, keyed by their exact description. They stay out of the prompt's known list and out of name recall, so a description still never crosses documents. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland@WaylanddeMacBook-Pro.local>
3 tasks
gedaiu
added a commit
to re-cinq/utopia
that referenced
this pull request
Dec 4, 2026
Sync upstream dev into re-dev (2026-12-03): deeplethe#1454 to deeplethe#1568
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the accumulation reported in #1534 (follow-up of #1532).
Why
One extraction run already reuses one entity per description across a document's chunks (
describedinextraction_open). A re-extraction started that map empty, so each round over an unchanged document made a new described entity for every description, plus a new statement pointing at it, because fact dedup keys on the object id. alitrack measured 12 → 53 described entities over six rounds of one 308-character contract, with 15 distinct descriptions.What changes
resolution::described_entities_of_documentreturns the described things this document's live facts sit on, followed through merges to the survivor, one per exact description (the earliest made).apply_open_extractionseedsdescribedfrom it, so a description the model lists again is taken back instead of created anew.docs/design/extraction.mdnotes it next to the 文档处理过程中可重复触发抽取,导致大量重复实体,以及抽取进度和性能问题 #1513 seed.Tests
reextracting_an_unchanged_document_reuses_what_it_described: two runs over the same replies keep onethe harbour officeand the same live fact count, and the rerun prompt still doesn't list it. It fails ondevwith "re-extract made another harbour office: 2".the_described_seed_is_this_documents_own: the same description made elsewhere in the base isn't seeded.utopia-server: 830 passed against Postgres (UTOPIA_TEST_REQUIRE_DB=1); fmt and clippy-D warningsare clean.🤖 Generated with Claude Code