pj4533 / yourgoal

Swift implementation of BabyAGI
MIT License
50 stars 8 forks source link

Handle vector similarity locally #9

Open pj4533 opened 1 year ago

pj4533 commented 1 year ago

The embeddings are from OpenAIs API, and Pinecone is using a database with kNN search. So could I figure a way to do that with CoreML and keep it all local?

Found this:

https://github.com/cendaar/KNN-swift

But need to look more into the Accelerate framework, and CoreML in general. Might even be hints in previous WWDCs, especially around image classification. Only the vector dimension size would be different, it's all just numbers.

pj4533 commented 1 year ago

There is SearchKit https://developer.apple.com/documentation/coreservices/search_kit

It works on documents, but appears to use the same underlying technology? Investigate this more.

pj4533 commented 1 year ago

SearchKit is very old. How is the newer photo natural language search implemented locally on Mac/iOS?

pj4533 commented 1 year ago

I think I just wasn't understanding how this all worked. I need to create the embeddings from OpenAI, and I could even store them locally in Redis, similar to AutoGPT