Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible support for add_with_ids? #3

Closed
clarkware opened this issue Apr 10, 2023 · 2 comments
Closed

Possible support for add_with_ids? #3

clarkware opened this issue Apr 10, 2023 · 2 comments

Comments

@clarkware
Copy link

I'm new to Faiss so this request might be misguided, but I'm curious if you have plans to support an index that has an add_with_ids method as described here.

The use case would be to assign ids to table records so you could fetch associated records using the ids returned by the search method. For example, I'd like to store text content and the embedding (vector representation) of that content. Unless I'm overlooking something, I'd need to store the original content outside of Faiss in a relational database or such and store the embedding vectors in Faiss. After performing a Faiss search, I then need to fetch the content associated with the matching embeddings. And while it's possible to use the auto-generated Faiss ids, it would be really convenient to be able to provide ids in addition to the vectors when calling the add method.

If it helps, the ex_faiss Elixir bindings have an add_with_ids function.

Anyway, just wondering if that's something that could be supported without a lot of effort. :-)

Thanks!

ankane added a commit that referenced this issue Apr 10, 2023
@ankane ankane closed this as completed in 6774876 Apr 10, 2023
@ankane
Copy link
Owner

ankane commented Apr 10, 2023

Hey @clarkware, thanks for the suggestion. Added both the IndexIDMap class and add_with_ids method in the commits above.

@clarkware
Copy link
Author

Excellent, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants