A source document is edited — sequence the incremental index-update steps
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Detect the change, delete the old chunks for that doc id, re-chunk and re-embed, upsert the new vectors, then refresh derived caches — delete before write so stale and fresh copies never coexist.
Imagine updating one recipe card in a recipe box. First you notice the card changed. Then you pull out the old card so nobody grabs the outdated version by mistake. You write the new card, slot it back in, and finally tear up any sticky notes that summarized the old recipe. If you slipped the new card in before pulling the old one, the box would hold two versions of the same recipe and a hungry cook might grab the wrong one. That is why the order matters: remove the stale copy first, add the fresh copy, and clean up the notes last.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
45s: give the order — detect, delete, re-embed, upsert, refresh caches; stress deleting before the upsert to avoid coexisting versions; note re-chunking shifts ids; mention the missing-document window and the versioned-pointer fix; close on caches being derived state refreshed last.
| Step | Why it is here | What breaks if skipped or moved |
|---|---|---|
| Detect change (hash/id) | Gate the costly re-embed | Re-embed everything every sync; wasted cost |
| Delete old chunks | Clean replace before write | Stale and fresh copies coexist in search |
| Re-chunk and re-embed | Produce current vectors | Index never reflects the new content |
| Upsert new vectors | Make new version searchable | Document missing from results |
| Refresh derived caches | Rebuild against fresh vectors | Cache keeps serving stale answers |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Upserting new chunks before deleting the old ones. For a brief window the index holds both versions, so retrieval can surface stale and current text for the same document and the model may answer from the outdated copy.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.