~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix(search): honor search.max_results in Library/Collection RAG engines (#4496)
LearningCircuitfa741fdcab7f
diff --git a/src/local_deep_research/web_search_engines/engines/search_engine_library.py b/src/local_deep_research/web_search_engines/engines/search_engine_library.pyindex 8a89ec97e3..9f806896bc 100644--- a/src/local_deep_research/web_search_engines/engines/search_engine_library.py+++ b/src/local_deep_research/web_search_engines/engines/search_engine_library.py@@ -292,14 +292,17 @@ class LibraryRAGSearchEngine(BaseSearchEngine):def _get_previews(self,query: str,- limit: int = 10,+ limit: Optional[int] = None,llm_callback=None,extra_params: Optional[Dict[str, Any]] = None,) -> List[Dict[str, Any]]:"""Get preview results for the query.- Delegates to the search method.+ Delegates to the search method, using the configured max_results+ when no explicit limit is provided."""+ if limit is None:+ limit = self.max_resultsreturn self.search(query, limit, llm_callback, extra_params)def _get_full_content(diff --git a/tests/web_search_engines/engines/test_search_engine_library.py b/tests/web_search_engines/engines/test_search_engine_library.pyindex 5651472ee6..4f4c7dea0a 100644--- a/tests/web_search_engines/engines/test_search_engine_library.py+++ b/tests/web_search_engines/engines/test_search_engine_library.py@@ -274,6 +274,37 @@ class TestGetPreviews:mock_search.assert_called_once()assert results == [{"title": "Test"}]+ def test_get_previews_uses_max_results_when_no_limit(self):+ """Without an explicit limit, the configured max_results is used.++ Regression test for #4428: the base class run() calls+ _get_previews(query) without a limit, so the configured+ search.max_results must be forwarded to search() instead of a+ hardcoded default.+ """+ from local_deep_research.web_search_engines.engines.search_engine_library import (+ LibraryRAGSearchEngine,+ )++ with patch(+ "local_deep_research.web_search_engines.engines.search_engine_library.get_setting_from_snapshot",+ return_value=None,+ ):+ with patch(+ "local_deep_research.web_search_engines.engines.search_engine_library.get_server_url",+ return_value="http://localhost:5000",+ ):+ engine = LibraryRAGSearchEngine(max_results=30)++ with patch.object(+ engine, "search", return_value=[]+ ) as mock_search:+ engine._get_previews("test query")++ mock_search.assert_called_once_with(+ "test query", 30, None, None+ )+# Note: _get_full_content tests are skipped due to a bug in the source code# where `from ... import search_config` doesn't work (search_config is in