From a73543526cf13beacba9764d5f8b69d65144911a Mon Sep 17 00:00:00 2001 From: Pankaj Telang Date: Mon, 6 Jan 2025 14:25:12 -0500 Subject: [PATCH] Reduce false positive matches by reducing the similarity distance --- src/codegate/pipeline/codegate_context_retriever/codegate.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/codegate/pipeline/codegate_context_retriever/codegate.py b/src/codegate/pipeline/codegate_context_retriever/codegate.py index 9bbd8565..eafaa080 100644 --- a/src/codegate/pipeline/codegate_context_retriever/codegate.py +++ b/src/codegate/pipeline/codegate_context_retriever/codegate.py @@ -90,7 +90,8 @@ async def process( user_messages = re.sub(r"```.*?```", "", user_messages, flags=re.DOTALL) # Vector search to find bad packages - bad_packages = await storage_engine.search(query=user_messages, distance=0.8, limit=100) + storage_engine = StorageEngine() + searched_objects = await storage_engine.search(query=user_messages, distance=0.5, limit=100) # All bad packages all_bad_packages = bad_snippet_packages + bad_packages