---
title: "Comment by Ahmet Özel on \"Building Search for BrainZen: From Embeddings to Hybrid Retrieval\" | Hashnode"
description: "The asynchronous embedding lifecycle needs a rule for completion order as well as content edits. If a note changes twice while two embedding jobs are in flight,"
url: "https://hashnode.com/posts/building-search-for-brainzen-from-embeddings-to-hybrid-retrieval/6ab19b401a06a536c5a4d52a/comment/6acb5b3455480046f6b89911"
---

[Discussion](https://hashnode.com/posts/building-search-for-brainzen-from-embeddings-to-hybrid-retrieval/6ab19b401a06a536c5a4d52a)

Comment [Building Search for BrainZen: From Embeddings to Hybrid Retrieval](https://hashnode.com/posts/building-search-for-brainzen-from-embeddings-to-hybrid-retrieval/6ab19b401a06a536c5a4d52a)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[Oct 11](https://hashnode.com/posts/building-search-for-brainzen-from-embeddings-to-hybrid-retrieval/6ab19b401a06a536c5a4d52a/comment/6acb5b3455480046f6b89911)

The asynchronous embedding lifecycle needs a rule for completion order as well as content edits. If a note changes twice while two embedding jobs are in flight, the older job may finish last and replace the newer vector even though every job succeeded.

I would attach the note revision to each job and accept its vector only if that revision still matches the current content. A test can deliberately finish the newer job first, then the older one, and assert that search remains tied to the latest revision. That turns stale-vector detection into a property of writes rather than a periodic cleanup hope.
