-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
Conventional offset pagination as also used by other parts of this repo, won't work here because we use an expensive ranking such as measuring vector distance.
Solution
Use keyset pagination, storing the last (score, entity_id) and user embedded query, this will both prevent an extra embedding inference call as well as ensure stable rankings across pages.
(Embedding inference is not deterministic and the exact same word might yield different vectors)
In the future we probably need to use a snapshot as well, adding an indexed_at
field to ensure mutations do not alter the ranking while paginating.
Metadata
Metadata
Assignees
Labels
No labels