-
-
Notifications
You must be signed in to change notification settings - Fork 674
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: SimilaritySearch with scoreThrehold not works with PgVector. #974
Comments
No one answered you so I will try...
That's only my experience. I should have investigated further but ...
|
|
thank you @chew-z , i look that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello.
I think there are an issue with the function SimilaritySearch (with scoreThrehold option).
When I use the SimilaritySearch function with PgVector and I add the 'scoreThreshold' option to 0.80, I have no documents returned.
If I remove the 'scoreThreshold' option, I have many documents returned with a score greater than 0.80.
According to my research and the github issues of the langhchain library, the problem comes from a confusion between the distance strategy.
See the issues:
I think the error is around this part of the code : langchaingo/vectorstores/pgvector
if scoreThreshold != 0 { whereQuerys = append(whereQuerys, fmt.Sprintf("data.distance < %f", 1-scoreThreshold)) }
If we look at the pgvector document :
the sql request should be like this : https://github.com/pgvector/pgvector
The text was updated successfully, but these errors were encountered: