local-deep-research 0.3.9__py3-none-any.whl → 0.3.11__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.
@@ -1 +1 @@
1
- __version__ = "0.3.9"
1
+ __version__ = "0.3.11"
@@ -3029,16 +3029,29 @@
3029
3029
  },
3030
3030
  "search.engine.web.searxng.default_params.safe_search": {
3031
3031
  "category": "searxng",
3032
- "description": "Setting for searxng.default_params.safe_search",
3032
+ "description": "Configure the safe search level",
3033
3033
  "editable": true,
3034
3034
  "max_value": null,
3035
3035
  "min_value": null,
3036
3036
  "name": "Safe Search",
3037
- "options": null,
3037
+ "options": [
3038
+ {
3039
+ "label": "Off",
3040
+ "value": "OFF"
3041
+ },
3042
+ {
3043
+ "label": "Moderate",
3044
+ "value": "MODERATE"
3045
+ },
3046
+ {
3047
+ "label": "Strict",
3048
+ "value": "STRICT"
3049
+ }
3050
+ ],
3038
3051
  "step": null,
3039
3052
  "type": "SEARCH",
3040
- "ui_element": "checkbox",
3041
- "value": 1,
3053
+ "ui_element": "select",
3054
+ "value": "OFF",
3042
3055
  "visible": true
3043
3056
  },
3044
3057
  "search.engine.web.searxng.full_search_class": {
@@ -530,7 +530,7 @@ def run_research_process(
530
530
  report_path = os.path.join(
531
531
  OUTPUT_DIR,
532
532
  f"quick_summary_{safe_query}_"
533
- f"{datetime.now().isoformat()}.md",
533
+ f"{int(datetime.now().timestamp())}.md",
534
534
  )
535
535
 
536
536
  # Send progress update for writing to file
@@ -643,7 +643,7 @@ def run_research_process(
643
643
  safe_query = safe_query.replace(" ", "_").lower()
644
644
  report_path = os.path.join(
645
645
  OUTPUT_DIR,
646
- f"detailed_report_{safe_query}_{datetime.now().isoformat()}.md",
646
+ f"detailed_report_{safe_query}_{int(datetime.now().timestamp())}.md",
647
647
  )
648
648
 
649
649
  with open(report_path, "w", encoding="utf-8") as f:
@@ -25,7 +25,7 @@ class FullSearchResults:
25
25
  max_results: int = 10,
26
26
  region: str = "wt-wt",
27
27
  time: str = "y",
28
- safesearch: str = "Moderate",
28
+ safesearch: str | int = "Moderate",
29
29
  ):
30
30
  self.llm = llm
31
31
  self.output_format = output_format
@@ -1,3 +1,4 @@
1
+ import enum
1
2
  import logging
2
3
  import os
3
4
  import time
@@ -15,6 +16,17 @@ logging.basicConfig(level=logging.INFO)
15
16
  logger = logging.getLogger(__name__)
16
17
 
17
18
 
19
+ @enum.unique
20
+ class SafeSearchSetting(enum.IntEnum):
21
+ """
22
+ Acceptable settings for safe search.
23
+ """
24
+
25
+ OFF = 0
26
+ MODERATE = 1
27
+ STRICT = 2
28
+
29
+
18
30
  class SearXNGSearchEngine(BaseSearchEngine):
19
31
  """
20
32
  SearXNG search engine implementation that requires an instance URL provided via
@@ -29,7 +41,7 @@ class SearXNGSearchEngine(BaseSearchEngine):
29
41
  categories: Optional[List[str]] = None,
30
42
  engines: Optional[List[str]] = None,
31
43
  language: str = "en",
32
- safe_search: int = 1,
44
+ safe_search: str = SafeSearchSetting.OFF.name,
33
45
  time_range: Optional[str] = None,
34
46
  delay_between_requests: float = 0.0,
35
47
  llm: Optional[BaseLLM] = None,
@@ -89,7 +101,14 @@ class SearXNGSearchEngine(BaseSearchEngine):
89
101
  self.categories = categories or ["general"]
90
102
  self.engines = engines
91
103
  self.language = language
92
- self.safe_search = safe_search
104
+ try:
105
+ self.safe_search = SafeSearchSetting[safe_search]
106
+ except ValueError:
107
+ logger.error(
108
+ "'{}' is not a valid safe search setting. Disabling safe search",
109
+ safe_search,
110
+ )
111
+ self.safe_search = SafeSearchSetting.OFF
93
112
  self.time_range = time_range
94
113
 
95
114
  self.delay_between_requests = float(
@@ -114,11 +133,7 @@ class SearXNGSearchEngine(BaseSearchEngine):
114
133
  max_results=max_results,
115
134
  region="wt-wt",
116
135
  time="y",
117
- safesearch=(
118
- "Moderate"
119
- if safe_search == 1
120
- else "Off" if safe_search == 0 else "Strict"
121
- ),
136
+ safesearch=self.safe_search.value,
122
137
  )
123
138
 
124
139
  self.last_request_time = 0
@@ -177,7 +192,7 @@ class SearXNGSearchEngine(BaseSearchEngine):
177
192
  "language": self.language,
178
193
  "format": "html", # Use HTML format instead of JSON
179
194
  "pageno": 1,
180
- "safesearch": self.safe_search,
195
+ "safesearch": self.safe_search.value,
181
196
  "count": self.max_results,
182
197
  }
183
198
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: local-deep-research
3
- Version: 0.3.9
3
+ Version: 0.3.11
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
@@ -108,34 +108,42 @@ Local Deep Research combines the power of large language models with intelligent
108
108
 
109
109
  ### Option 1: Docker (Recommended)
110
110
 
111
+ LDR uses Docker compose to bundle the web app and all it's dependencies so
112
+ you can get up and running quickly.
113
+
114
+ ### Prerequisites
115
+
116
+ - [Docker](https://docs.docker.com/engine/install/)
117
+ - [Docker Compose](https://docs.docker.com/compose/install/)
118
+ - `cookiecutter`: Run `pip install --user cookiecutter`
119
+
120
+ Clone the repository:
121
+
111
122
  ```bash
112
- # Step 1: Pull and run SearXNG for optimal search results
113
- docker pull searxng/searxng
114
- docker run -d -p 8080:8080 --name searxng searxng/searxng
123
+ git clone https://github.com/LearningCircuit/local-deep-research.git
124
+ cd local-deep-research
125
+ ```
115
126
 
116
- # Step 2: Pull and run Local Deep Research
117
- docker pull localdeepresearch/local-deep-research
118
- docker run -d -p 5000:5000 --name local-deep-research localdeepresearch/local-deep-research
127
+ ### Configuring with Docker Compose
119
128
 
120
- # Optional 3a: For connecting to already installed local Ollama (https://ollama.com/download) or other local services
121
- # docker run -d -p 5000:5000 --network host --name local-deep-research localdeepresearch/local-deep-research
129
+ In the LDR repository, run the following command
130
+ to do generate the compose file:
122
131
 
123
- # Optional 3b (recommended): Pull and run Ollama for local LLM capabilities
124
- # docker pull ollama/ollama
125
- # docker run -d -p 11434:11434 --name ollama ollama/ollama
126
- # docker exec -it ollama ollama pull gemma3:12b
132
+ ```bash
133
+ cookiecutter cookiecutter-docker/
134
+ ```
127
135
 
128
- # Start containers - Required after each reboot (can be automated with this flag --restart unless-stopped in run)
129
- docker start searxng
130
- docker start local-deep-research
131
- # docker start ollama
136
+ This will prompt you to answer a series of questions. Hit Enter repeatedly
137
+ to accept the default values. It should generate a file in the repository called `docker-compose.default.yml`. To run LDR, use the following command:
138
+
139
+ ```bash
140
+ docker compose -f docker-compose.default.yml up
132
141
  ```
133
142
 
134
143
  Then visit `http://127.0.0.1:5000` to start researching!
135
144
 
136
- > **Note**: If you need to connect to local services (like Ollama), add `--network host` to the command.
137
- >
138
- > **Don't have Docker? It's installed in a few clicks: [Install Docker here](https://www.docker.com/get-started/)**
145
+ See [here](https://github.com/LearningCircuit/local-deep-research/wiki/Installation#docker-installation-recommended) for more information about
146
+ using Docker.
139
147
 
140
148
  ### Option 2: Python Package (mostly for programmatic access)
141
149
 
@@ -1,10 +1,9 @@
1
- local_deep_research-0.3.9.dist-info/METADATA,sha256=V8I6NbaRBfXVto4TzI8tyufrsvh0vos0zlRaXX8rqZI,16628
2
- local_deep_research-0.3.9.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
- local_deep_research-0.3.9.dist-info/entry_points.txt,sha256=GcXS501Rjh-P80S8db7hnrQ23mS_Jg27PwpVQVO77as,113
4
- local_deep_research-0.3.9.dist-info/licenses/LICENSE,sha256=Qg2CaTdu6SWnSqk1_JtgBPp_Da-LdqJDhT1Vt1MUc5s,1072
1
+ local_deep_research-0.3.11.dist-info/METADATA,sha256=iAN4Tz0PLv3IndAQsqk-rrBoHCuhGnce59XQv9Y1_oE,16473
2
+ local_deep_research-0.3.11.dist-info/WHEEL,sha256=tSfRZzRHthuv7vxpI4aehrdN9scLjk-dCJkPLzkHxGg,90
3
+ local_deep_research-0.3.11.dist-info/entry_points.txt,sha256=GcXS501Rjh-P80S8db7hnrQ23mS_Jg27PwpVQVO77as,113
4
+ local_deep_research-0.3.11.dist-info/licenses/LICENSE,sha256=Qg2CaTdu6SWnSqk1_JtgBPp_Da-LdqJDhT1Vt1MUc5s,1072
5
5
  local_deep_research/__init__.py,sha256=9wV3oonZMEHsE_JhyZU9P0hW2Uwv47zotGlbAB_gQiA,885
6
- local_deep_research/__main__.py,sha256=LIxK5iS6aLAKMFBDpUS3V-jDcxchqi3eSUsI2jAZUXk,371
7
- local_deep_research/__version__.py,sha256=7YeBgSVj8ydF7tymPSFdq22NONiQoBjKL1iwcxp4TJo,21
6
+ local_deep_research/__version__.py,sha256=TESjMH0a_iUkwdfWT4nyzKizSFmmCY2omxnS2XyT97Y,23
8
7
  local_deep_research/advanced_search_system/__init__.py,sha256=sGusMj4eFIrhXR6QbOM16UDKB6aI-iS4IFivKWpMlh0,234
9
8
  local_deep_research/advanced_search_system/filters/__init__.py,sha256=2dXrV4skcVHI2Lb3BSL2Ajq0rnLeSw7kc1MbIynMxa4,190
10
9
  local_deep_research/advanced_search_system/filters/base_filter.py,sha256=dFNQ7U2dj4bf3voT73YhcG-w9eW-BTlc4F9kstFcETY,969
@@ -40,8 +39,7 @@ local_deep_research/config/llm_config.py,sha256=bYxhwyjkdBlap832aWvWgHWjjPq45Oh2
40
39
  local_deep_research/config/search_config.py,sha256=ruryPSS4Wy9-xi_02c-98KLKaELeLnZ10pnCpc0-ogg,2171
41
40
  local_deep_research/defaults/.env.template,sha256=_eVCy4d_XwpGXy8n50CG3wH9xx2oqJCFKS7IbqgInDk,491
42
41
  local_deep_research/defaults/__init__.py,sha256=C_0t0uZmtrVB4rM9NM9Wx8PJU5kFcT-qOHvws5W2iOg,1352
43
- local_deep_research/defaults/default_settings.json,sha256=OcRS16WAP4zKvU0UAbXlvBcitt0wv_Z7hq93x1OZBdA,120559
44
- local_deep_research/main.py,sha256=umGmaQmW7bpx27wUAgSNjNr4oSHV6mDX5hoyfb22HEY,7033
42
+ local_deep_research/defaults/default_settings.json,sha256=1ov1lVSSuf5LdyIRHLnqkkc-AAuyLZr6TSNMuSXXVwg,120844
45
43
  local_deep_research/migrate_db.py,sha256=S1h6Bv0OJdRW4BaH7MIMrUXBRV_yqgH2T6LVOZKTQjI,4634
46
44
  local_deep_research/report_generator.py,sha256=-G3KDEbsuU3PdxDfuo5v28DIX7RE1yJCCBU2KgRbNzI,9084
47
45
  local_deep_research/search_system.py,sha256=dq9US9zoB7TSiMorsrFFrSHlR6MSqE0IP3NBKB3fP8U,7830
@@ -67,7 +65,7 @@ local_deep_research/web/routes/api_routes.py,sha256=S0UdCmfm0v1GEM4UiSbI0PE3xUOx
67
65
  local_deep_research/web/routes/history_routes.py,sha256=6a_8nX349viuvi1zP5S7BaPPpAh133eTi1NVWO545A8,12622
68
66
  local_deep_research/web/routes/research_routes.py,sha256=zSU21oAkZnADnuhJniShd8US8hpPDiYqQxUhalJwQeU,23685
69
67
  local_deep_research/web/routes/settings_routes.py,sha256=fkYLwDgcHfiHVml3ux6qCc5qFMjfnKfPcwisqhg995s,49280
70
- local_deep_research/web/services/research_service.py,sha256=RyZ4cCePV9n--wm-8-c0wpLGwA1aQIiuTpnRlLuU8-I,39646
68
+ local_deep_research/web/services/research_service.py,sha256=gsveymwt4hKKwVGU2XqFYT27GeEsmSU7EOWrvDsUtnk,39656
71
69
  local_deep_research/web/services/resource_service.py,sha256=yKgOC6GEOmHqRoGzwf52e19UaGCCS1DbDbOIXgWGvGc,4378
72
70
  local_deep_research/web/services/settings_manager.py,sha256=CHz_nd49BVRJiLALAjTHfmkKNy_Vr3ogCm5P-_633bk,17281
73
71
  local_deep_research/web/services/settings_service.py,sha256=SgmjhMvGZjJE63hKKaqY7kPGphnUyXcQG8NFN5rTizs,3550
@@ -114,7 +112,7 @@ local_deep_research/web/utils/formatters.py,sha256=Gj_a0oFveNXHtvkiFe1rwlEtzYerM
114
112
  local_deep_research/web/utils/templates.py,sha256=scBPbjUJqaFltFX37ZLsdcgPycPY7kMSew5mZWCG1H0,535
115
113
  local_deep_research/web_search_engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
114
  local_deep_research/web_search_engines/engines/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
117
- local_deep_research/web_search_engines/engines/full_search.py,sha256=6Pi_wj9oAtDHAyLsIbWGBeS8QBv6yCJEJ87LN68Cp-k,4703
115
+ local_deep_research/web_search_engines/engines/full_search.py,sha256=GoBWvFh1eJS6esGNuFoMbq7GHaDMI_pqKX2RY136IXo,4709
118
116
  local_deep_research/web_search_engines/engines/meta_search_engine.py,sha256=qUFl8yw5l7sfH-BRpXXrNQ2KrQ9LsaslhG1glb2AOIM,14715
119
117
  local_deep_research/web_search_engines/engines/search_engine_arxiv.py,sha256=3k8R4pyqIZf0RDMqXDw08xIGsfkp4ZR9kePDbmeuaH0,16603
120
118
  local_deep_research/web_search_engines/engines/search_engine_brave.py,sha256=y1j4CSLM0Ujw1LSBiWg1ZBnc2BvrkhDCorrQLnUBVtM,9149
@@ -125,7 +123,7 @@ local_deep_research/web_search_engines/engines/search_engine_guardian.py,sha256=
125
123
  local_deep_research/web_search_engines/engines/search_engine_local.py,sha256=ephjkDrQbvil6GnceW31qSt70k11REOJ9o7y-bl69-A,40857
126
124
  local_deep_research/web_search_engines/engines/search_engine_local_all.py,sha256=vznpusmCBY9bLjD8EPrVhCb_8RZ8e9Wa8x386zv0pcM,5681
127
125
  local_deep_research/web_search_engines/engines/search_engine_pubmed.py,sha256=O99qfbSz7RHqinAP_C0iod-ZaEGE5tyBbh1DJi2-VhQ,38495
128
- local_deep_research/web_search_engines/engines/search_engine_searxng.py,sha256=LjArsD5ICgfsaFupF3O31oqb60ONgwqwWu-UDt7eA68,17710
126
+ local_deep_research/web_search_engines/engines/search_engine_searxng.py,sha256=viCD1CVSym8als_o7LHbzwYlJ4jQIUPmmCxcXLjW4P4,18043
129
127
  local_deep_research/web_search_engines/engines/search_engine_semantic_scholar.py,sha256=jYs_TRM0izMfldsZ8NkCQsP-o6vCPXUjyxt0nIsxOVI,22799
130
128
  local_deep_research/web_search_engines/engines/search_engine_serpapi.py,sha256=OnoYL89WX1qWC6mOosSdgbJ-rXcIFmCVdrd6-qg7xes,8711
131
129
  local_deep_research/web_search_engines/engines/search_engine_wayback.py,sha256=rfRs7WJxa-H1DXSyduFHBMfpFwWEVRXLd8s_78iU8gU,17894
@@ -133,4 +131,4 @@ local_deep_research/web_search_engines/engines/search_engine_wikipedia.py,sha256
133
131
  local_deep_research/web_search_engines/search_engine_base.py,sha256=PLU_sAWhWKTOQWcv32GINuhLdIwB0sEQy-pp9oG9Ggo,9835
134
132
  local_deep_research/web_search_engines/search_engine_factory.py,sha256=DghAkQvLKRJYl5xb9AUjUv7ydAQ4rPi-TvzrmqdyGxE,10890
135
133
  local_deep_research/web_search_engines/search_engines_config.py,sha256=UAE6TfxFXrt-RvSfGQ_FRsOGGrsSs8VI3n1i-0Lfo2s,4929
136
- local_deep_research-0.3.9.dist-info/RECORD,,
134
+ local_deep_research-0.3.11.dist-info/RECORD,,
@@ -1,16 +0,0 @@
1
- """
2
- Main entry point when running the package with `python -m local_deep_research`.
3
- This avoids circular imports by directly importing the main function after
4
- the package is fully loaded.
5
- """
6
-
7
-
8
- def main():
9
- # Only import main after the whole package has been initialized
10
- from .main import main as main_func
11
-
12
- main_func()
13
-
14
-
15
- if __name__ == "__main__":
16
- main()
@@ -1,215 +0,0 @@
1
- import logging
2
- import sys
3
- from typing import Dict
4
-
5
- from . import get_advanced_search_system, get_report_generator
6
- from .config.config_files import settings
7
- from .utilities.db_utils import get_db_setting
8
-
9
-
10
- def print_report(report: Dict):
11
- """Print and save the report in a readable format"""
12
-
13
- # Print to console in readable format
14
- print("\n=== GENERATED REPORT ===\n")
15
-
16
- # Print content
17
- print(report["content"])
18
-
19
- # Save to file in markdown format
20
- with open("report.md", "w", encoding="utf-8") as markdown_file:
21
- # Write content
22
- markdown_file.write(report["content"])
23
-
24
- # Write metadata at the end of the file
25
- markdown_file.write("\n\n---\n\n")
26
- markdown_file.write("## Report Metadata\n")
27
-
28
- markdown_file.write(f"- Query: {report['metadata']['query']}\n")
29
-
30
- print("\nReport has been saved to report.md")
31
-
32
-
33
- # Create the report generator lazily to avoid circular imports
34
- def get_report_generator_instance():
35
- return get_report_generator()
36
-
37
-
38
- # report_generator = IntegratedReportGenerator()
39
- report_generator = None # Will be initialized when needed
40
-
41
-
42
- def main():
43
- import logging
44
-
45
- from .utilities.setup_utils import setup_user_directories
46
-
47
- # Configure logging
48
- logging.basicConfig(level=logging.INFO)
49
- logger = logging.getLogger(__name__)
50
- search_iterations = get_db_setting("search.iterations", settings.search.iterations)
51
- questions_per_iteration = get_db_setting(
52
- "search.questions_per_iteration", settings.search.questions_per_iteration
53
- )
54
- logger.info(
55
- f"Starting with settings: iterations={search_iterations}, "
56
- f"questions_per_iteration={questions_per_iteration}"
57
- )
58
-
59
- # Explicitly run setup
60
- logger.info("Initializing configuration...")
61
- setup_user_directories()
62
-
63
- system = get_advanced_search_system()
64
-
65
- print("Welcome to the Advanced Research System")
66
- print("Type 'quit' to exit")
67
-
68
- while True:
69
- print("\nSelect output type:")
70
- print("1) Quick Summary (Generated in a few minutes)")
71
- print(
72
- "2) Detailed Research Report (Recommended for deeper analysis - may take several hours)"
73
- )
74
- choice = input("Enter number (1 or 2): ").strip()
75
-
76
- while choice not in ["1", "2"]:
77
- print("\nInvalid input. Please enter 1 or 2:")
78
- print("1) Quick Summary (Generated in a few minutes)")
79
- print(
80
- "2) Detailed Research Report (Recommended for deeper analysis - may take several hours)"
81
- )
82
- choice = input("Enter number (1 or 2): ").strip()
83
-
84
- query = input("\nEnter your research query: ").strip()
85
-
86
- if query.lower() == "quit":
87
- break
88
-
89
- # System will automatically use updated configuration
90
- # through the automatic reloading in get_llm() and get_search()
91
-
92
- if choice == "1":
93
- print("\nResearching... This may take a few minutes.\n")
94
- else:
95
- print(
96
- "\nGenerating detailed report... This may take several hours. Please be patient as this enables deeper analysis.\n"
97
- )
98
-
99
- results = system.analyze_topic(query)
100
- if results:
101
- if choice == "1":
102
- # Quick Summary
103
- print("\n=== QUICK SUMMARY ===")
104
- if results["findings"] and len(results["findings"]) > 0:
105
- initial_analysis = [
106
- finding["content"] for finding in results["findings"]
107
- ]
108
- print(initial_analysis)
109
-
110
- else:
111
- # Full Report
112
- # Initialize report_generator if not already done
113
- global report_generator
114
- if report_generator is None:
115
- report_generator = get_report_generator()
116
-
117
- final_report = report_generator.generate_report(results, query)
118
- print("\n=== RESEARCH REPORT ===")
119
- print_report(final_report)
120
-
121
- print("\n=== RESEARCH METRICS ===")
122
- print(f"Search Iterations: {results['iterations']}")
123
-
124
- else:
125
- print("Research failed. Please try again.")
126
-
127
-
128
- # Add command for database migration
129
- if __name__ == "__main__":
130
- import argparse
131
-
132
- parser = argparse.ArgumentParser(description="Local Deep Research")
133
- parser.add_argument("--web", action="store_true", help="Start the web server")
134
- parser.add_argument(
135
- "--migrate-db", action="store_true", help="Migrate legacy databases to ldr.db"
136
- )
137
- parser.add_argument("--debug", action="store_true", help="Enable debug mode")
138
- parser.add_argument(
139
- "--test-migration",
140
- action="store_true",
141
- help="Test migration by checking database contents",
142
- )
143
- parser.add_argument(
144
- "--schema-upgrade",
145
- action="store_true",
146
- help="Run schema upgrades on the database (e.g., remove redundant tables)",
147
- )
148
-
149
- args = parser.parse_args()
150
-
151
- if args.debug:
152
- logging.basicConfig(level=logging.DEBUG)
153
- else:
154
- logging.basicConfig(level=logging.INFO)
155
-
156
- if args.migrate_db:
157
- try:
158
- # First ensure data directory exists
159
- from src.local_deep_research.setup_data_dir import setup_data_dir
160
-
161
- setup_data_dir()
162
-
163
- # Then run the migration
164
- from src.local_deep_research.web.database.migrate_to_ldr_db import (
165
- migrate_to_ldr_db,
166
- )
167
-
168
- print("Starting database migration...")
169
- success = migrate_to_ldr_db()
170
- if success:
171
- print("Database migration completed successfully")
172
- sys.exit(0)
173
- else:
174
- print("Database migration failed")
175
- sys.exit(1)
176
- except Exception as e:
177
- print(f"Error running database migration: {e}")
178
- sys.exit(1)
179
-
180
- if args.test_migration:
181
- try:
182
- from src.local_deep_research.test_migration import main as test_main
183
-
184
- sys.exit(test_main())
185
- except Exception as e:
186
- print(f"Error running migration test: {e}")
187
- sys.exit(1)
188
-
189
- if args.schema_upgrade:
190
- try:
191
- from src.local_deep_research.web.database.schema_upgrade import (
192
- run_schema_upgrades,
193
- )
194
-
195
- print("Running database schema upgrades...")
196
- success = run_schema_upgrades()
197
- if success:
198
- print("Schema upgrades completed successfully")
199
- sys.exit(0)
200
- else:
201
- print("Schema upgrades failed")
202
- sys.exit(1)
203
- except Exception as e:
204
- print(f"Error running schema upgrades: {e}")
205
- sys.exit(1)
206
-
207
- if args.web:
208
- from src.local_deep_research.web.app import main as web_main
209
-
210
- web_main()
211
- else:
212
- # Default to web if no command specified
213
- from src.local_deep_research.web.app import main as web_main
214
-
215
- web_main()