Find answers from the community

Updated 3 months ago

is there a way to select the number of

is there a way to select the number of retrieved nodes in an index different depending on the score? so that in a question if 5 nodes are very relevant include all them but in other question only one is relevant.

cohere_rerank = CohereRerank(api_key=api_key, model="rerank-multilingual-v2.0", top_n=2)

# Crear motor de chat con la colección seleccionada
chat_engine = index.as_chat_engine(
service_context=service_context,
similarity_top_k=10,
node_postprocessors=[cohere_rerank],
chat_mode="context",
memory=memory,
)
L
1 comment
There is a score threshold post-processor. Or you could write your own custom postprocessor and set the top-k higher
Add a reply
Sign up and join the conversation on Discord