spotify / voyager

🛰️ An approximate nearest-neighbor search library for Python and Java with a focus on ease of use, simplicity, and deployability.
https://spotify.github.io/voyager/
Apache License 2.0
1.26k stars 51 forks source link

Why not able directly return look up labels as well with index and distances? #66

Closed Ibrokhimsadikov closed 1 month ago

Ibrokhimsadikov commented 3 months ago

Thank you for Voyager, really loving it!

`from voyager import Index, Space
index = Index(Space.Cosine, num_dimensions=1024)
index.add_items(embeddings)

ids, distances = index.query(query_embedding, k=20)`

only returns ids, and then I need use labels[ids] to look up for labels, Can I just directly get labels rather than index

I have to always load labels for mapping, can .voy file while first initiation already contain labels so that I do not need to bring them always, which would also make easier to deploy as sagemaker endpoint

markkohdev commented 1 month ago

Hey @Ibrokhimsadikov (sorry about the late reply! We're working on getting some more maintainer staffing on this project). This is something we'll be addressing as part of #11, so I'm going to close this as duplicate.