asg017 / sqlite-vss

A SQLite extension for efficient vector search, based on Faiss!
MIT License
1.59k stars 59 forks source link

Restructuring, getting rid of more memory leaks, and improving readability #70

Open polterguy opened 1 year ago

polterguy commented 1 year ago

Much better structure. Among some of the things I have done are;

More work needs to be done, especially on the "xyz.h" files, that really should have associated "xyz.cpp" files, but at least it's a start. I tried to implement memory cache on the faiss indexes, and I had everything working, but didn't understand why the cache mechanism didn't work, until I realised SQLite will dynamically load the library on every connection, resulting in that my static std::map would be deleted, and hence my approach to caching was useless. I removed these parts, but you can see the idea in the history if interested.

Psst, you'll have to check out the branch in its entirety. There's no way you can make sense of the pull request by looking at the diff.