spotify/annoy ? reverse-engineered prompt

Reverse engineered prompt

Build me a small library for finding nearest neighbors in a big set of vectors, with both a C++ core and Python support. I want it to let me add items, build an index, save it to disk, and then load it back very fast with memory mapping so multiple processes can share the same data.

It should support common distance types like angular or cosine, Euclidean, Manhattan, Hamming, and dot product. I also want a simple way to ask for the closest items to a given vector or item id, and to optionally get the distances back too. Make it work well for large datasets and keep memory use low.

Please include a clean README with a basic example, plus a few tests so I can see it working. If you need to check the latest build or packaging details, look up the current docs online and follow the usual setup for a modern Python extension and C++ library.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab