Closed hydrosquall closed 3 weeks ago
thanks for the detailed bug report, this does make sense and should be accounted for.
We track the dimensions for the embedding in the scope.json ( along with all the other metadata from the process) so I think it would be fine for the front end to call the nearest neighbor endpoint with the dims. The API needs to be updated to then pass the dimensions to the model. The providers that support matroyshka take it as a parameter to embed.
Sounds good, I think the fix is straightforward 👍 . The API appears to already have a setting to read the dimensions if the frontend provides them.
Bug reproduction steps
open-ai-text-embedding-3-small
model, but don't use the default feature size of1536
, change it to something smaller768
./datasets/<DATASET_NAME>/explore/<SCOPE_NAME>
route , and use the "nearest neighbor search" featureBug explanation
I think the error message demonstrates why the button has no effect . The search term was embedded with the default model size of
1536
instead of with the size of the embeddings it'll be matched against https://github.com/enjalot/latent-scope/blob/b07a27bc6685f3b4b4287251bf094ee8e1767dc2/latentscope/server/search.py#L62For nearest neighbors search to work, the query term's vector has to match the size of the embeddings for this scope
Possible fixes
dimensions
as a query parameter.https://github.com/enjalot/latent-scope/blob/b07a27bc6685f3b4b4287251bf094ee8e1767dc2/web/src/pages/Explore.jsx#L359