From cc09ce87c2c8ec6ac7e6429f7e0197eb12fc39c0 Mon Sep 17 00:00:00 2001 From: Yiorgis Gozadinos Date: Tue, 18 Nov 2025 14:35:57 +0200 Subject: [PATCH] Increase reranking candidate retrieval multiplier from 3x to 10x for improved result quality --- CHANGELOG.md | 2 ++ docs/configuration.md | 2 +- haiku_rag_slim/haiku/rag/client.py | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c422de..2281297f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Changelog ## [Unreleased] +- Increase reranking candidate retrieval multiplier from 3x to 10x for improved result quality + ## [0.17.0] - 2025-11-17 ### Added diff --git a/docs/configuration.md b/docs/configuration.md index 26961fb7..70291d6f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -476,7 +476,7 @@ See the [Pydantic AI documentation](https://ai.pydantic.dev/models/) for the com ## Reranking -Reranking improves search quality by re-ordering the initial search results using specialized models. When enabled, the system retrieves more candidates (3x the requested limit) and then reranks them to return the most relevant results. +Reranking improves search quality by re-ordering the initial search results using specialized models. When enabled, the system retrieves more candidates (10x the requested limit) and then reranks them to return the most relevant results. Reranking is **disabled by default** (`provider: ""`) for faster searches. You can enable it by configuring one of the providers below. diff --git a/haiku_rag_slim/haiku/rag/client.py b/haiku_rag_slim/haiku/rag/client.py index f26f611b..1cac8faa 100644 --- a/haiku_rag_slim/haiku/rag/client.py +++ b/haiku_rag_slim/haiku/rag/client.py @@ -466,8 +466,8 @@ class HaikuRAG: # No reranking - return direct search results return await self.chunk_repository.search(query, limit, search_type, filter) - # Get more initial results (3X) for reranking - search_limit = limit * 3 + # Get more initial results (10X) for reranking + search_limit = limit * 10 search_results = await self.chunk_repository.search( query, search_limit, search_type, filter )