Skip to content

~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.

Added option to disable quality check

LearningCircuitd2e685272521
diff --git a/citation_handler.py b/citation_handler.py
index f94c2f5732..15db344966 100644
--- a/citation_handler.py
+++ b/citation_handler.py
@@ -47,7 +47,7 @@ class CitationHandler:
documents = self._create_documents(search_results)
formatted_sources = self._format_sources(documents)
-
+ print(formatted_sources)
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}
@@ -71,6 +71,7 @@ Provide a detailed analysis with citations and always keep URLS. Example format:
"""Process follow-up analysis with citations."""
documents = self._create_documents(search_results)
formatted_sources = self._format_sources(documents)
+ print(formatted_sources)
# Add fact-checking step
fact_check_prompt = f"""Analyze these sources for factual consistency:
1. Cross-reference major claims between sources
diff --git a/config.py b/config.py
index d0e430db6c..7362afd7d4 100644
--- a/config.py
+++ b/config.py
@@ -11,7 +11,7 @@ import os
load_dotenv()
# LLM Configuration
-DEFAULT_MODEL = "deepseek-r1:14b"
+DEFAULT_MODEL = "deepseek-r1:14b" # try to use the largest model that fits into your GPU memory
DEFAULT_TEMPERATURE = 0.7
MAX_TOKENS = 8000
@@ -24,8 +24,10 @@ SEARCHES_PER_SECTION = 5
CONTEXT_CUT_OFF = 10000
# citation handler
-ENABLE_FACT_CHECKING = False # comes with pros and cons.
+ENABLE_FACT_CHECKING = False # comes with pros and cons. Maybe works better with larger LLMs?
+# DDG FACT CHECK URLs
+QUALITY_CHECK_DDG_URLS = True # Keep this True it improves quality of the results in my experiance.
# Search Configuration
MAX_SEARCH_RESULTS = 40 # DuckDuckGoSearch seems to return only 4 results anyways.
diff --git a/full_duck_duck_go_search_results.py b/full_duck_duck_go_search_results.py
index 55f45e0ca3..d459dcd507 100644
--- a/full_duck_duck_go_search_results.py
+++ b/full_duck_duck_go_search_results.py
@@ -7,7 +7,7 @@ from typing import List, Dict
import json, os
from utilities import remove_think_tags
from datetime import datetime
-
+import config
class FullDuckDuckGoSearchResults:
def __init__(
@@ -102,7 +102,10 @@ class FullDuckDuckGoSearchResults:
raise ValueError("Expected the search results in list format.")
# Step 2: Filter URLs using LLM
- filtered_results = self.check_urls(search_results, query)
+ if config.QUALITY_CHECK_DDG_URLS:
+ filtered_results = self.check_urls(search_results, query)
+ else:
+ filtered_results = search_results
# Extract URLs from filtered results
urls = [result.get("link") for result in filtered_results if result.get("link")]