~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 UTC timestamp to citation handlers to prevent rejection of current year dates (#642)
LearningCircuitaf68109025c4
diff --git a/src/local_deep_research/citation_handlers/forced_answer_citation_handler.py b/src/local_deep_research/citation_handlers/forced_answer_citation_handler.pyindex 6f144db75f..0d28f2599f 100644--- a/src/local_deep_research/citation_handlers/forced_answer_citation_handler.py+++ b/src/local_deep_research/citation_handlers/forced_answer_citation_handler.py@@ -3,6 +3,7 @@ Forced answer citation handler - optimized for BrowseComp-style questions.Always provides a specific answer, never returns "cannot determine"."""+from datetime import datetime, timezonefrom typing import Any, Dict, List, Unionfrom loguru import logger@@ -20,6 +21,10 @@ class ForcedAnswerCitationHandler(BaseCitationHandler):documents = self._create_documents(search_results)formatted_sources = self._format_sources(documents)+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Analyze the following information and provide a DIRECT answer to the question. Include citations using numbers in square brackets [1], [2], etc.Question: {query}@@ -27,6 +32,8 @@ Question: {query}Sources:{formatted_sources}+Current time is {current_timestamp} UTC for verifying temporal references in sources.+CRITICAL INSTRUCTIONS:1. Start your response with a direct answer to the question2. NEVER say "I cannot determine" or "insufficient information"@@ -79,6 +86,10 @@ New Sources:Return the most likely answer based on evidence consistency."""fact_check_response = self.llm.invoke(fact_check_prompt).content+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Using the previous knowledge and new sources, provide a DIRECT answer to the question. Include citations using numbers in square brackets.Previous Knowledge:@@ -89,6 +100,8 @@ Question: {question}New Sources:{formatted_sources}+Current time is {current_timestamp} UTC for verifying temporal references in sources.+Fact Analysis: {fact_check_response}CRITICAL INSTRUCTIONS:diff --git a/src/local_deep_research/citation_handlers/precision_extraction_handler.py b/src/local_deep_research/citation_handlers/precision_extraction_handler.pyindex 021c04fade..67f09b80ce 100644--- a/src/local_deep_research/citation_handlers/precision_extraction_handler.py+++ b/src/local_deep_research/citation_handlers/precision_extraction_handler.py@@ -10,6 +10,7 @@ It includes specialized extractors for:"""import re+from datetime import datetime, timezonefrom typing import Any, Dict, List, Unionfrom loguru import logger@@ -49,6 +50,10 @@ class PrecisionExtractionHandler(BaseCitationHandler):# Determine question type for targeted extractionquestion_type = self._identify_question_type(query)+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Analyze the following information and provide a PRECISE answer to the question. Include citations using numbers in square brackets [1], [2], etc.Question: {query}@@ -57,6 +62,8 @@ Question Type: {question_type}Sources:{formatted_sources}+Current time is {current_timestamp} UTC for verifying temporal references in sources.+PRECISION INSTRUCTIONS:1. Extract the EXACT answer as it appears in the sources2. For names: Include FULL names with all parts (first, middle, last)@@ -96,6 +103,10 @@ Format: Start with the direct, precise answer, then explain with citations."""# Extract key facts from previous knowledgekey_facts = self._extract_key_facts(previous_knowledge, question_type)+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Using the previous knowledge and new sources, provide a PRECISE answer to the question.Previous Key Facts:@@ -107,6 +118,8 @@ Question Type: {question_type}New Sources:{formatted_sources}+Current time is {current_timestamp} UTC for verifying temporal references in sources.+PRECISION REQUIREMENTS:1. Build on previous knowledge to provide the MOST COMPLETE answer2. If a full name was partially found before, complete it nowdiff --git a/src/local_deep_research/citation_handlers/standard_citation_handler.py b/src/local_deep_research/citation_handlers/standard_citation_handler.pyindex ee939195af..4901d78ee7 100644--- a/src/local_deep_research/citation_handlers/standard_citation_handler.py+++ b/src/local_deep_research/citation_handlers/standard_citation_handler.py@@ -2,6 +2,7 @@Standard citation handler - the original implementation."""+from datetime import datetime, timezonefrom typing import Any, Dict, List, Unionfrom .base_citation_handler import BaseCitationHandler@@ -15,6 +16,10 @@ class StandardCitationHandler(BaseCitationHandler):) -> Dict[str, Any]:documents = self._create_documents(search_results)formatted_sources = self._format_sources(documents)+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Analyze the following information concerning the question and include citations using numbers in square brackets [1], [2], etc. When citing, use the source number provided at the start of each source.Question: {query}@@ -22,6 +27,8 @@ Question: {query}Sources:{formatted_sources}+Current time is {current_timestamp} UTC for verifying temporal references in sources.+Provide a detailed analysis with citations. Do not create the bibliography, it will be provided automatically. Never make up sources. Never write or create urls. Only write text relevant to the question. Example format: "According to the research [1], ...""""@@ -62,6 +69,10 @@ New Sources:else:fact_check_response = ""+ current_timestamp = datetime.now(timezone.utc).strftime(+ "%Y-%m-%d %H:%M"+ )+prompt = f"""Using the previous knowledge and new sources, answer the question. Include citations using numbers in square brackets [1], [2], etc. When citing, use the source number provided at the start of each source. Reflect information from sources critically.Previous Knowledge:@@ -71,6 +82,9 @@ Question: {question}New Sources:{formatted_sources}++Current time is {current_timestamp} UTC for verifying temporal references in sources.+Reflect information from sources critically based on: {fact_check_response}. Never invent sources.Provide a detailed answer with citations. Example format: "According to [1], ..." """