~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: Add proper rate limiting to all PubMed API requests
LearningCircuit0cc32d3dafe2
diff --git a/src/local_deep_research/web_search_engines/engines/search_engine_pubmed.py b/src/local_deep_research/web_search_engines/engines/search_engine_pubmed.pyindex 420279e741..0d152e48b3 100644--- a/src/local_deep_research/web_search_engines/engines/search_engine_pubmed.py+++ b/src/local_deep_research/web_search_engines/engines/search_engine_pubmed.py@@ -91,6 +91,16 @@ class PubMedSearchEngine(BaseSearchEngine):if self.api_key:params["api_key"] = self.api_key+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before search request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute search requestresponse = requests.get(self.search_url, params=params)response.raise_for_status()@@ -555,6 +565,16 @@ The default assumption should be that medical and scientific queries want RECENTparams["reldate"] = self.days_limitparams["datetype"] = "pdat" # Publication date+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before search request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute search requestresponse = requests.get(self.search_url, params=params)response.raise_for_status()@@ -600,6 +620,16 @@ The default assumption should be that medical and scientific queries want RECENTif self.api_key:params["api_key"] = self.api_key+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before summary request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute requestresponse = requests.get(self.summary_url, params=params)response.raise_for_status()@@ -678,6 +708,16 @@ The default assumption should be that medical and scientific queries want RECENTif self.api_key:params["api_key"] = self.api_key+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before fetch request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute requestresponse = requests.get(self.fetch_url, params=params)response.raise_for_status()@@ -756,6 +796,16 @@ The default assumption should be that medical and scientific queries want RECENTif self.api_key:params["api_key"] = self.api_key+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before link request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute requestresponse = requests.get(self.link_url, params=params)response.raise_for_status()@@ -810,6 +860,16 @@ The default assumption should be that medical and scientific queries want RECENTif self.api_key:params["api_key"] = self.api_key+ # Apply rate limiting before request+ if self.rate_tracker and self.rate_tracker.enabled:+ wait_time = self.rate_tracker.get_wait_time(self.engine_type)+ if wait_time > 0:+ logger.debug(+ f"PubMed waiting {wait_time:.2f}s before fetch request"+ )+ time.sleep(wait_time)+ self._last_wait_time = wait_time+# Execute requestresponse = requests.get(self.fetch_url, params=params)response.raise_for_status()@@ -894,9 +954,6 @@ The default assumption should be that medical and scientific queries want RECENT# Get article summariessummaries = self._get_article_summaries(pmid_list)- # Rate limit compliance (NCBI allows 10 requests per second with an API key, 3 without)- time.sleep(0.1 if self.api_key else 0.33)-# Format as previewspreviews = []for summary in summaries: