I created a TypeScript function to perform a KNN search on an ontology object with an embedding vector field. This function uses text-embedding-ada-002
for encoding the input text (this is the same model used for generating the vector fields in pipeline builder for creating the ontology object). Additionally, I developed a similar function in AIP to compare the results and performance.
When comparing the results, I noticed that the same input yields different outcomes between the AIP implementation and the TypeScript function. Specifically, when analyzing the top 100 resulting embedding vectors from each function against the input embedding vector, the AIP function produces results with higher dot product and cosine similarity than the TypeScript results.
Could there be a reason why the TypeScript implementation of the KNN search function returns different results compared to the AIP logic implementation of the same function?