0Pricing
AI Agents · Lesson

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.

All lessons in this course

  1. Pinecone, Weaviate, Qdrant: Comparison
  2. Metadata Filtering for Hybrid Search
  3. Updating and Deleting Vectors
  4. Choosing Distance Metrics (cosine, L2, dot)
← Back to AI Agents