From f2a34d682135770eb66ec92991670fca7f4e0e6a Mon Sep 17 00:00:00 2001 From: heiko-braun Date: Tue, 12 Dec 2023 20:02:16 +0100 Subject: [PATCH] MMR with top k:5 --- agent.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/agent.py b/agent.py index c5de2c9..531b3a6 100644 --- a/agent.py +++ b/agent.py @@ -46,9 +46,9 @@ def configure_retriever(collection_name): embeddings=OpenAIEmbeddings()) # top k and threshold settings see https://python.langchain.com/docs/modules/data_connection/retrievers/vectorstore - return qdrant.as_retriever( - search_type="similarity_score_threshold", - search_kwargs={"score_threshold": .5} + return qdrant.as_retriever( + search_type="mmr", + search_kwargs={"k": 5} ) comp_ref_tool = create_retriever_tool(