Blue-green re-index with an alias
The two groups of words stand in for two embedding models. With a real model you would measure the hit rate on your test set in the same way.
Ready-to-copy recipes for any vector store: a schema and index template, a query template with parameters, the sizing function, a compaction trigger, a migration overlap check and a blue-green re-index.
Change the code and press Run (Ctrl+Enter). Predict what will happen first, then break it on purpose and read what changes. Your edits are saved and match the lesson page.
Ready for more? This phase has 5 hands-on exercises with automatic checks.
Practice questions
Write the code in the editor, run it, then open the model answer to compare.
Write overlap_at_k(old, new) and print it for ["D1", "D6", "D2"] against ["D1", "D2", "D9"] with 2 decimals.
Write switch_alias(aliases, name, new_collection, new_rate, old_rate) that points the alias to the new collection only if new_rate > old_rate and returns the collection now served. Print the result for rates 0.9 and 0.8, then for 0.7 and 0.8.
Explain it without notes
Give the steps of a blue-green re-index and what each protects against.
What does an overlap check tell you, and what does it not?
Why does the schema fix the vector length?
What should a vector-store canary set contain?
Expected output
serving: lumen_v1, hit rate 0.67
built lumen_v2, hit rate 1.00
switched alias: lumen -> lumen_v2 (lumen_v1 kept for rollback)
top answer for the refund question now: D1