Updating and Deleting Vectors
Keep the index in sync with the source: upsert on document change, delete on removal, and handle re-embeddings.
The Index Is Not Frozen
Real documents change. The index must keep up:
- New docs added
- Existing docs edited
- Old docs deleted or archived
Upsert (Insert or Update)
Most vector DBs support upsert — write the vector with a given ID, replacing the old one if it exists:
index.upsert([
('doc-42', new_vector, {'source': 'a.pdf', 'updated_at': now})
])
# If doc-42 already exists, it is overwritten.