Delta retain matches chunks by position, so an insertion near the top re-extracts the rest of the document
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Read hindsight_api/engine/retain/orchestrator.py around _classify_chunk_diff (lines 4064–4080) and the full-retain fallback around line 4310. Trace how stored and new chunks are matched and how chunk_id depends on the index; reproduce with the 20-paragraph document described in the issue. Done means inserting one paragraph at the start triggers extraction only for that new chunk, without the full-retain fallback.
Written by the indexing model from the issue text.
Description
Bug Description
_classify_chunk_diff compares each new chunk with the stored chunk at the same chunk_index (engine/retain/orchestrator.py L4064-L4080). Text inserted or removed early in a document shifts every later chunk to a new index, so chunks whose content_hash matches a stored chunk count as changed and are extracted again. If no chunk keeps its index, delta falls back to a full retain (L4310).
#6763 raised positional identity more broadly; #6807 fixed the stale-replace case and left the rest out of scope. This is the narrower case inside one document.
Steps to Reproduce
- Retain a document of 20 paragraphs of about 2,900 characters each (one chunk each at the default
retain_chunk_size). - Retain it again with one new paragraph inserted first.
- Read
GET /v1/default/banks/{bank_id}/llm-requests?scope=retain_extract_facts&document_id={document_id}for the second retain, and the worker log.
Expected Behavior
One extraction call, for the new chunk.
Matching by content_hash before index would avoid it; chunk_id is derived from the index, so a matched chunk that moves would need its id rewritten.
Actual Behavior
21 extraction calls, and the worker logs Delta retain: no unchanged chunks for {document_id}, falling back to full retain.
On one of our pages, 116 of 131 chunks had the same text as a stored chunk and were extracted again.
Version
1.3.1
LLM Provider
Gemini (Vertex AI)
- Dominant language
- Python
- Stars
- 45.2k
- Forks
- 5.9k
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vectorize-io/hindsight
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
vectorize-io/hindsight#7254 ·
-
Control Plane shows different calendar dates for the same occurrence in Constellation and TimelineOpencore
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
vectorize-io/hindsight#7240 · 1 comment ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vectorize-io/hindsight#7233 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
vectorize-io/hindsight#7231 ·
-
core
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
vectorize-io/hindsight#7228 · 1 comment ·
All issues in vectorize-io/hindsight
Similar issues
-
Test: to_hijri() accepts datetime.datetime and uses only the date partPossibly taken A pull request linked to this issue is open or already merged. Opengood first issue
Difficulty 1/5 Under an hour Newbie friendliness 95/100
omarelshamy25x/shamy-hijri#63 · 3 comments ·
Maintainers usually reply within 1 day
-
polish
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresPossibly taken @AshutoshSingh840 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
UKGovernmentBEIS/control-arena#992 ·
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
mvalentsev/awesome-free-ai-coding#70 ·
Maintainers usually reply within 1 day