local-deep-research 0.2.0__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- local_deep_research/advanced_search_system/strategies/parallel_search_strategy.py +261 -139
- local_deep_research/advanced_search_system/strategies/source_based_strategy.py +407 -0
- local_deep_research/api/research_functions.py +72 -90
- local_deep_research/citation_handler.py +16 -17
- local_deep_research/defaults/search_engines.toml +1 -1
- local_deep_research/report_generator.py +19 -5
- local_deep_research/search_system.py +20 -3
- local_deep_research/web/routes/settings_routes.py +0 -9
- local_deep_research/web/services/research_service.py +4 -0
- local_deep_research/web_search_engines/engines/search_engine_searxng.py +1 -1
- {local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/METADATA +2 -2
- {local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/RECORD +15 -14
- {local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/WHEEL +0 -0
- {local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/entry_points.txt +0 -0
- {local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/licenses/LICENSE +0 -0
@@ -98,7 +98,7 @@ search_language = "English"
|
|
98
98
|
[searxng]
|
99
99
|
module_path = ".engines.search_engine_searxng"
|
100
100
|
class_name = "SearXNGSearchEngine"
|
101
|
-
requires_api_key =
|
101
|
+
requires_api_key = false
|
102
102
|
api_key_env = "SEARXNG_INSTANCE"
|
103
103
|
reliability = 0.9
|
104
104
|
strengths = [
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import importlib
|
2
2
|
from typing import Dict, List
|
3
3
|
|
4
|
+
from langchain_core.language_models import BaseChatModel
|
5
|
+
|
4
6
|
# Fix circular import by importing directly from source modules
|
5
7
|
from .config.llm_config import get_llm
|
6
8
|
from .search_system import AdvancedSearchSystem
|
7
|
-
|
8
|
-
# from . import utilities
|
9
9
|
from .utilities import search_utilities
|
10
10
|
|
11
11
|
|
@@ -19,10 +19,24 @@ def get_report_generator(search_system=None):
|
|
19
19
|
|
20
20
|
|
21
21
|
class IntegratedReportGenerator:
|
22
|
-
def __init__(
|
23
|
-
self
|
22
|
+
def __init__(
|
23
|
+
self,
|
24
|
+
searches_per_section: int = 2,
|
25
|
+
search_system=None,
|
26
|
+
llm: BaseChatModel | None = None,
|
27
|
+
):
|
28
|
+
"""
|
29
|
+
Args:
|
30
|
+
searches_per_section: Number of searches to perform for each
|
31
|
+
section in the report.
|
32
|
+
search_system: Custom search system to use, otherwise just uses
|
33
|
+
the default.
|
34
|
+
llm: Custom LLM to use, otherwise just uses the default.
|
35
|
+
|
36
|
+
"""
|
37
|
+
self.model = llm or get_llm()
|
24
38
|
# Use provided search_system or create a new one
|
25
|
-
self.search_system = search_system or AdvancedSearchSystem()
|
39
|
+
self.search_system = search_system or AdvancedSearchSystem(llm=self.model)
|
26
40
|
self.searches_per_section = (
|
27
41
|
searches_per_section # Control search depth per section
|
28
42
|
)
|
@@ -13,12 +13,16 @@ from .advanced_search_system.strategies.parallel_search_strategy import (
|
|
13
13
|
ParallelSearchStrategy,
|
14
14
|
)
|
15
15
|
from .advanced_search_system.strategies.rapid_search_strategy import RapidSearchStrategy
|
16
|
+
from .advanced_search_system.strategies.source_based_strategy import (
|
17
|
+
SourceBasedSearchStrategy,
|
18
|
+
)
|
16
19
|
from .advanced_search_system.strategies.standard_strategy import StandardSearchStrategy
|
17
20
|
from .citation_handler import CitationHandler
|
18
21
|
from .config.config_files import settings
|
19
22
|
from .config.llm_config import get_llm
|
20
23
|
from .config.search_config import get_search
|
21
24
|
from .utilities.db_utils import get_db_setting
|
25
|
+
from .web_search_engines.search_engine_base import BaseSearchEngine
|
22
26
|
|
23
27
|
logger = logging.getLogger(__name__)
|
24
28
|
|
@@ -30,10 +34,11 @@ class AdvancedSearchSystem:
|
|
30
34
|
|
31
35
|
def __init__(
|
32
36
|
self,
|
33
|
-
strategy_name: str = "
|
37
|
+
strategy_name: str = "source-based",
|
34
38
|
include_text_content: bool = True,
|
35
39
|
use_cross_engine_filter: bool = True,
|
36
40
|
llm: BaseChatModel | None = None,
|
41
|
+
search: BaseSearchEngine | None = None,
|
37
42
|
):
|
38
43
|
"""Initialize the advanced search system.
|
39
44
|
|
@@ -43,12 +48,16 @@ class AdvancedSearchSystem:
|
|
43
48
|
use_cross_engine_filter: Whether to filter results across search
|
44
49
|
engines.
|
45
50
|
llm: LLM to use. If not provided, it will use the default one.
|
51
|
+
search: Search engine to use. If not provided, it will use the
|
52
|
+
default one.
|
46
53
|
"""
|
47
54
|
# Get configuration
|
48
|
-
self.search = get_search()
|
49
55
|
self.model = llm
|
50
56
|
if llm is None:
|
51
57
|
self.model = get_llm()
|
58
|
+
self.search = search
|
59
|
+
if search is None:
|
60
|
+
self.search = get_search(llm_instance=self.model)
|
52
61
|
self.max_iterations = get_db_setting(
|
53
62
|
"search.iterations", settings.search.iterations
|
54
63
|
)
|
@@ -70,6 +79,14 @@ class AdvancedSearchSystem:
|
|
70
79
|
if strategy_name.lower() == "iterdrag":
|
71
80
|
logger.info("Creating IterDRAGStrategy instance")
|
72
81
|
self.strategy = IterDRAGStrategy(model=self.model, search=self.search)
|
82
|
+
elif strategy_name.lower() == "source-based":
|
83
|
+
logger.info("Creating SourceBasedSearchStrategy instance")
|
84
|
+
self.strategy = SourceBasedSearchStrategy(
|
85
|
+
model=self.model,
|
86
|
+
search=self.search,
|
87
|
+
include_text_content=include_text_content,
|
88
|
+
use_cross_engine_filter=use_cross_engine_filter,
|
89
|
+
)
|
73
90
|
elif strategy_name.lower() == "parallel":
|
74
91
|
logger.info("Creating ParallelSearchStrategy instance")
|
75
92
|
self.strategy = ParallelSearchStrategy(
|
@@ -90,7 +107,7 @@ class AdvancedSearchSystem:
|
|
90
107
|
|
91
108
|
# For backward compatibility
|
92
109
|
self.questions_by_iteration = {}
|
93
|
-
self.progress_callback = None
|
110
|
+
self.progress_callback = lambda _1, _2, _3: None
|
94
111
|
self.all_links_of_system = list()
|
95
112
|
|
96
113
|
# Configure the strategy with our attributes
|
@@ -349,10 +349,6 @@ def save_all_settings():
|
|
349
349
|
400,
|
350
350
|
)
|
351
351
|
|
352
|
-
# Export settings to file for each type
|
353
|
-
for setting_type in settings_by_type:
|
354
|
-
get_settings_manager(db_session).export_to_file(setting_type)
|
355
|
-
|
356
352
|
# Get all settings to return to the client for proper state update
|
357
353
|
all_settings = []
|
358
354
|
for setting in db_session.query(Setting).all():
|
@@ -525,11 +521,6 @@ def reset_to_defaults():
|
|
525
521
|
|
526
522
|
setup_settings(db_session)
|
527
523
|
|
528
|
-
# Also export the settings to file for consistency
|
529
|
-
settings_mgr = get_settings_manager(db_session)
|
530
|
-
for setting_type in SettingType:
|
531
|
-
settings_mgr.export_to_file(setting_type)
|
532
|
-
|
533
524
|
# Return success
|
534
525
|
return jsonify(
|
535
526
|
{
|
@@ -690,6 +690,10 @@ def run_research_process(
|
|
690
690
|
# Handle error
|
691
691
|
error_message = f"Research failed: {str(e)}"
|
692
692
|
logger.error(error_message)
|
693
|
+
import traceback
|
694
|
+
|
695
|
+
logger.error("Exception occurred:" + str(traceback.print_exc()))
|
696
|
+
|
693
697
|
try:
|
694
698
|
# Check for common Ollama error patterns in the exception and provide more user-friendly errors
|
695
699
|
user_friendly_error = str(e)
|
@@ -65,7 +65,7 @@ class SearXNGSearchEngine(BaseSearchEngine):
|
|
65
65
|
# 2. SEARXNG_INSTANCE environment variable
|
66
66
|
# 3. instance_url parameter
|
67
67
|
# 4. Default to None, which will disable the engine
|
68
|
-
self.instance_url = api_key or os.getenv("SEARXNG_INSTANCE") or instance_url
|
68
|
+
self.instance_url = api_key or os.getenv("SEARXNG_INSTANCE") or instance_url or "http://localhost:8080"
|
69
69
|
|
70
70
|
# Add debug logging for instance URL
|
71
71
|
logger.info(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: local-deep-research
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.3
|
4
4
|
Summary: AI-powered research assistant with deep, iterative analysis using LLMs and web searches
|
5
5
|
Author-Email: LearningCircuit <185559241+LearningCircuit@users.noreply.github.com>, HashedViking <6432677+HashedViking@users.noreply.github.com>
|
6
6
|
License: MIT License
|
@@ -124,7 +124,7 @@ A powerful AI-powered research assistant that performs deep, iterative analysis
|
|
124
124
|
|
125
125
|
## Windows Installation
|
126
126
|
|
127
|
-
Download the [Windows Installer](https://github.com/LearningCircuit/local-deep-research/releases/download/v0.
|
127
|
+
Download the [Windows Installer](https://github.com/LearningCircuit/local-deep-research/releases/download/v0.1.0/LocalDeepResearch_Setup.exe) for easy one-click installation.
|
128
128
|
|
129
129
|
**Requires Ollama (or other model provider configured in .env).**
|
130
130
|
Download from https://ollama.ai and then pull a model
|
@@ -1,7 +1,7 @@
|
|
1
|
-
local_deep_research-0.2.
|
2
|
-
local_deep_research-0.2.
|
3
|
-
local_deep_research-0.2.
|
4
|
-
local_deep_research-0.2.
|
1
|
+
local_deep_research-0.2.3.dist-info/METADATA,sha256=46N1CYIqxccMSv3Iaq-Tm8gEFtnuc1ATUJqfM720HkE,19797
|
2
|
+
local_deep_research-0.2.3.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
|
3
|
+
local_deep_research-0.2.3.dist-info/entry_points.txt,sha256=GcXS501Rjh-P80S8db7hnrQ23mS_Jg27PwpVQVO77as,113
|
4
|
+
local_deep_research-0.2.3.dist-info/licenses/LICENSE,sha256=Qg2CaTdu6SWnSqk1_JtgBPp_Da-LdqJDhT1Vt1MUc5s,1072
|
5
5
|
local_deep_research/__init__.py,sha256=tczbsYNZQqfPAuVtz6OFyo-uUqjNQLelEIT2G7mPTwA,870
|
6
6
|
local_deep_research/__main__.py,sha256=LIxK5iS6aLAKMFBDpUS3V-jDcxchqi3eSUsI2jAZUXk,371
|
7
7
|
local_deep_research/advanced_search_system/__init__.py,sha256=sGusMj4eFIrhXR6QbOM16UDKB6aI-iS4IFivKWpMlh0,234
|
@@ -21,8 +21,9 @@ local_deep_research/advanced_search_system/repositories/__init__.py,sha256=cCjAR
|
|
21
21
|
local_deep_research/advanced_search_system/strategies/__init__.py,sha256=upbslnB6Ns8RJ0-b1bH74-f5gZbo7evpx1dRrKEkzHA,35
|
22
22
|
local_deep_research/advanced_search_system/strategies/base_strategy.py,sha256=cK5DqvsjGlFyqKRtpl0-dI6cip32UIbGS8eqsuL9SjI,3781
|
23
23
|
local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py,sha256=eKCyxNVRnN7pOr-8LEzREbRkHX6ffa9hmjGwBYHHDDc,18129
|
24
|
-
local_deep_research/advanced_search_system/strategies/parallel_search_strategy.py,sha256=
|
24
|
+
local_deep_research/advanced_search_system/strategies/parallel_search_strategy.py,sha256=dA5KgS5G_1O82MLhWx1UOZi5P4c7hqWdQPRdtt1B49U,19006
|
25
25
|
local_deep_research/advanced_search_system/strategies/rapid_search_strategy.py,sha256=fiLTqCfpyoNlP_rRZB96gdi3KoOkCWk-Nw5fb7E9an4,10389
|
26
|
+
local_deep_research/advanced_search_system/strategies/source_based_strategy.py,sha256=PW5gHhpayon3d716Ooo02UITkoxfBGvgzrm7kFITWWo,17312
|
26
27
|
local_deep_research/advanced_search_system/strategies/standard_strategy.py,sha256=FbZAHiRAhfFCtA46Im0KxF5QNzursiz0SqhimvNiaXs,12747
|
27
28
|
local_deep_research/advanced_search_system/tools/__init__.py,sha256=73jLuCKigwc9lJQ0uD3_F16dgCg4pL-F2cwC6tk9-oc,30
|
28
29
|
local_deep_research/advanced_search_system/tools/base_tool.py,sha256=jEs4eroCvo0dHP_uF-5kLiQP7OfkD1YzNAD650a8Ktk,2865
|
@@ -30,9 +31,9 @@ local_deep_research/advanced_search_system/tools/knowledge_tools/__init__.py,sha
|
|
30
31
|
local_deep_research/advanced_search_system/tools/question_tools/__init__.py,sha256=73jLuCKigwc9lJQ0uD3_F16dgCg4pL-F2cwC6tk9-oc,30
|
31
32
|
local_deep_research/advanced_search_system/tools/search_tools/__init__.py,sha256=73jLuCKigwc9lJQ0uD3_F16dgCg4pL-F2cwC6tk9-oc,30
|
32
33
|
local_deep_research/api/__init__.py,sha256=-tJQp7Qm1aPg6fgfuw-w9dfNo8GzrJLOy2i3dG8Drl8,441
|
33
|
-
local_deep_research/api/research_functions.py,sha256=
|
34
|
+
local_deep_research/api/research_functions.py,sha256=8Q_Rzfc0Qj2oLxzvFJIA4ms10uQC0a5SBHkIkSoPcw4,10908
|
34
35
|
local_deep_research/app.py,sha256=U_92UX0dpVAQoaXciVNy_By_AyDEWGlXSeTwFpohALQ,155
|
35
|
-
local_deep_research/citation_handler.py,sha256=
|
36
|
+
local_deep_research/citation_handler.py,sha256=NoEvnpf7jqCAJX6H-H8i2Hz69CVPW6UBg12cBRYtVdA,4396
|
36
37
|
local_deep_research/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
38
|
local_deep_research/config/config_files.py,sha256=k6ptAKIvqGrhnRsfRjT9uD2xBLAiD0vqXoYxggF5mik,10041
|
38
39
|
local_deep_research/config/llm_config.py,sha256=KhuDbxjndU939rMCKmeYDctsx7fRoXMoQRv1AgtZKI4,16536
|
@@ -41,11 +42,11 @@ local_deep_research/defaults/.env.template,sha256=_eVCy4d_XwpGXy8n50CG3wH9xx2oqJ
|
|
41
42
|
local_deep_research/defaults/__init__.py,sha256=C_0t0uZmtrVB4rM9NM9Wx8PJU5kFcT-qOHvws5W2iOg,1352
|
42
43
|
local_deep_research/defaults/local_collections.toml,sha256=zNa03PVnFrZ757JdZOuW6QDxkOc6ep5tG8baGBrMmXM,1778
|
43
44
|
local_deep_research/defaults/main.toml,sha256=4PfSKHXzPjesdh7IzLprJ_oaCxqum9PvuKEaxr_-iJI,1940
|
44
|
-
local_deep_research/defaults/search_engines.toml,sha256=
|
45
|
+
local_deep_research/defaults/search_engines.toml,sha256=XBnqCxzFvXa1HoKLcb_Jg4EGXMlgYOw1sm_CicSdYDM,8285
|
45
46
|
local_deep_research/main.py,sha256=umGmaQmW7bpx27wUAgSNjNr4oSHV6mDX5hoyfb22HEY,7033
|
46
47
|
local_deep_research/migrate_db.py,sha256=S1h6Bv0OJdRW4BaH7MIMrUXBRV_yqgH2T6LVOZKTQjI,4634
|
47
|
-
local_deep_research/report_generator.py,sha256
|
48
|
-
local_deep_research/search_system.py,sha256=
|
48
|
+
local_deep_research/report_generator.py,sha256=-G3KDEbsuU3PdxDfuo5v28DIX7RE1yJCCBU2KgRbNzI,9084
|
49
|
+
local_deep_research/search_system.py,sha256=YmXu9ui-aB5kGb9rqQWUb7qSvd-iHfp3PvRenPwCdDA,7604
|
49
50
|
local_deep_research/setup_data_dir.py,sha256=7MJa2MMdDUnktJVHwMpyNL2079-qylpIyyLpVbF5AUY,1134
|
50
51
|
local_deep_research/test_migration.py,sha256=cXY9WbpxLslNEa1vFwLMvcvKBbUe7Wosm--AqmPIPYM,6459
|
51
52
|
local_deep_research/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -67,8 +68,8 @@ local_deep_research/web/models/settings.py,sha256=rXBI9vY5k3ndR8dPd3fZJy-6HwYltQ
|
|
67
68
|
local_deep_research/web/routes/api_routes.py,sha256=S0UdCmfm0v1GEM4UiSbI0PE3xUOxiGaYFR2ZOE0256U,19075
|
68
69
|
local_deep_research/web/routes/history_routes.py,sha256=6a_8nX349viuvi1zP5S7BaPPpAh133eTi1NVWO545A8,12622
|
69
70
|
local_deep_research/web/routes/research_routes.py,sha256=JlzaP1z-7XAP3E0nkEjLIfYj_NKf5qDcrjxBmUouAhM,23492
|
70
|
-
local_deep_research/web/routes/settings_routes.py,sha256=
|
71
|
-
local_deep_research/web/services/research_service.py,sha256=
|
71
|
+
local_deep_research/web/routes/settings_routes.py,sha256=rEvvFCVWJ80zchnzXBv9SAnDXMvDPLGDjSUfLRlCCi0,60012
|
72
|
+
local_deep_research/web/services/research_service.py,sha256=0tFx3wactXhZjFuZDHC3aAFgpDTtjfm_c-1HsZLxaos,39656
|
72
73
|
local_deep_research/web/services/resource_service.py,sha256=yKgOC6GEOmHqRoGzwf52e19UaGCCS1DbDbOIXgWGvGc,4378
|
73
74
|
local_deep_research/web/services/settings_manager.py,sha256=ybnhSlByuKA2oJPElN2WI8bh-ZzC6lP08x0Gsz8Ycbk,24310
|
74
75
|
local_deep_research/web/services/settings_service.py,sha256=1XHvNBNs9gzor2AxOEDrqL-JsKyXKk5izCnoXAV78u8,5064
|
@@ -124,7 +125,7 @@ local_deep_research/web_search_engines/engines/search_engine_guardian.py,sha256=
|
|
124
125
|
local_deep_research/web_search_engines/engines/search_engine_local.py,sha256=7s2qcyslMNiwXQynYjm_9t8nL_MDfue8wuDrBhfpcEg,40506
|
125
126
|
local_deep_research/web_search_engines/engines/search_engine_local_all.py,sha256=zg963qnwg8XwUqc9DeBrFaDSEHVr-j7Bv76WhaEuyi8,5785
|
126
127
|
local_deep_research/web_search_engines/engines/search_engine_pubmed.py,sha256=O99qfbSz7RHqinAP_C0iod-ZaEGE5tyBbh1DJi2-VhQ,38495
|
127
|
-
local_deep_research/web_search_engines/engines/search_engine_searxng.py,sha256=
|
128
|
+
local_deep_research/web_search_engines/engines/search_engine_searxng.py,sha256=wPYIl22SgXjIDYzcq62glGH2JZywCnZR31he1i7U1cE,18053
|
128
129
|
local_deep_research/web_search_engines/engines/search_engine_semantic_scholar.py,sha256=jYs_TRM0izMfldsZ8NkCQsP-o6vCPXUjyxt0nIsxOVI,22799
|
129
130
|
local_deep_research/web_search_engines/engines/search_engine_serpapi.py,sha256=OnoYL89WX1qWC6mOosSdgbJ-rXcIFmCVdrd6-qg7xes,8711
|
130
131
|
local_deep_research/web_search_engines/engines/search_engine_wayback.py,sha256=rfRs7WJxa-H1DXSyduFHBMfpFwWEVRXLd8s_78iU8gU,17894
|
@@ -132,4 +133,4 @@ local_deep_research/web_search_engines/engines/search_engine_wikipedia.py,sha256
|
|
132
133
|
local_deep_research/web_search_engines/search_engine_base.py,sha256=PLU_sAWhWKTOQWcv32GINuhLdIwB0sEQy-pp9oG9Ggo,9835
|
133
134
|
local_deep_research/web_search_engines/search_engine_factory.py,sha256=mkIf6F-8-aooS47iqb8SanJ9shnl0UOVia8hr2xX0b0,12751
|
134
135
|
local_deep_research/web_search_engines/search_engines_config.py,sha256=GmwpCT6vfeq1wrdr1R-zu6WRQ5XxyE7921HPsgGm3gI,2771
|
135
|
-
local_deep_research-0.2.
|
136
|
+
local_deep_research-0.2.3.dist-info/RECORD,,
|
File without changes
|
{local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/entry_points.txt
RENAMED
File without changes
|
{local_deep_research-0.2.0.dist-info → local_deep_research-0.2.3.dist-info}/licenses/LICENSE
RENAMED
File without changes
|