Skip to content

Commit 530347c

Browse files
author
Jason Chuang
committed
create minimal working prototype for Groq Deep Search or OpenAI Deep Research
1 parent e1ece5b commit 530347c

File tree

10 files changed

+41
-25
lines changed

10 files changed

+41
-25
lines changed

README.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# open-deepsearch
22
open-deepsearch ( Deep Research but Open-Sourced )
33

4+
Q&A for more details, research, and report generation.
5+
46
## How to install in DEV environment after git clone
57
```bash
68
python3 -m venv .venv
79
source .venv/bin/activate
10+
#modify .env file and put in OPENAI_KEY
11+
cp .env.example .env
812
pip install -r requirements.txt
913
pip install -e .
1014
deepsearch
1115
```
12-
⭐ A python port with a little more cli of
13-
<https://github.com/dzhng/deep-research>
16+
⭐ A python port from node.js version
17+
<https://github.com/dzhng/deep-research>
18+
19+
## As for now (2025-02-21, v0.0.3), it only uses OpenAI to produce output.md
20+
21+
## Future work
22+
23+
Try out FIRECRAWL or TAVILY to craw recent web data

open_deepsearch/deep_research.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import os
2-
import re
2+
import asyncio
33
from typing import List, Dict, Optional, Any
4-
from ai.providers import generate_object, custom_model, trim_prompt, FirecrawlApp, SearchResponse
5-
from prompt import system_prompt
6-
from output_manager import OutputManager
4+
5+
from .research_progress_results import ResearchProgress, ResearchResult
6+
from .prompt import system_prompt
7+
from .output_manager import OutputManager
78
from pydantic import BaseModel
8-
import asyncio
99
from concurrent.futures import ThreadPoolExecutor
10-
from ai.models import ResearchProgress, ResearchResult
10+
from .ai.providers import generate_object, custom_model, trim_prompt, FirecrawlApp, SearchResponse
1111

1212
from dotenv import load_dotenv
1313
load_dotenv()
@@ -31,6 +31,8 @@ class SerpResultSchema(BaseModel):
3131
learnings: List[str]
3232
followUpQuestions: List[str]
3333

34+
35+
3436
async def generate_serp_queries(query: str, num_queries: int = 3, learnings: Optional[List[str]] = None) -> List[Dict[str, str]]:
3537
res = await generate_object({
3638
'model': custom_model,

open_deepsearch/feedback.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
from ai.providers import generate_object, custom_model
2-
from prompt import system_prompt
1+
from .ai.providers import generate_object, custom_model
2+
from .prompt import system_prompt
33
from pydantic import BaseModel
44
from typing import List
55

open_deepsearch/output_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from typing import Any
2-
from ai.models import ResearchProgress
2+
from .research_progress_results import ResearchProgress
33

44
class OutputManager:
55
def __init__(self):

open_deepsearch/progress_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from deep_research import ResearchProgress
1+
from .research_progress_results import ResearchProgress
22

33
class ProgressManager:
44
def __init__(self):

open_deepsearch/ai/models.py renamed to open_deepsearch/research_progress_results.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from typing import List, Optional
1+
from typing import Optional, List
2+
23

34
class ResearchProgress:
45
def __init__(self, current_depth: int, total_depth: int, current_breadth: int, total_breadth: int, total_queries: int, completed_queries: int, current_query: Optional[str] = None):

open_deepsearch/run.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import asyncio
22
from typing import Any
3-
from open_deepsearch.deep_research import deep_research, write_final_report
4-
from feedback import generate_feedback
5-
from output_manager import OutputManager
3+
from .deep_research import deep_research, write_final_report
4+
from .feedback import generate_feedback
5+
from .output_manager import OutputManager
66

77
output = OutputManager()
88

@@ -43,5 +43,8 @@ async def run() -> None:
4343
print(f"\n\nFinal Report:\n\n{report}")
4444
print('\nReport has been saved to output.md')
4545

46+
def main():
47+
asyncio.run(run())
48+
4649
if __name__ == '__main__':
4750
asyncio.run(run())

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requires = ["setuptools>=70.0.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
6-
name = "open_deepsearch"
7-
version = "0.0.2"
8-
description = "DeepResearch but Open-Sourced, called open_deepsearch"
6+
name = "open-deepsearch"
7+
version = "0.0.3"
8+
description = "Deep Research but Open-Sourced, called open-deepsearch"
99
readme = "README.md"
1010
authors = [{ name = "Jason Chuang", email = "chuangtcee@gmail.com" }]
1111
classifiers = [
@@ -24,7 +24,7 @@ dependencies = []
2424
find = {}
2525

2626
[project.scripts]
27-
deepsearch = "open_deepsearch:run.main"
27+
deepsearch = "open_deepsearch.run:main"
2828

2929
[project.urls]
3030
"Homepage" = "https://github.com/aidatatools/open-deepsearch"

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
python-dotenv>=1.0.1
12
openai==1.63.2
23
aiohttp>=3.9.0
34
aiofiles>=23.2.1
45
tiktoken>=0.5.0
5-
python-dotenv>=1.0.1
66
firecrawl-py>=1.11.1
7-
typer[all]>=0.9.0
7+
typer>=0.9.0
88
prompt-toolkit>=3.0.0
99
pydantic==2.10.6

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
long_description = fh.read()
55

66
setup(
7-
name='open_deepsearch',
8-
version='0.0.2',
7+
name='open-deepsearch',
8+
version='0.0.3',
99
author='Jason Chuang',
1010
author_email='chuangtcee@gmail.com',
11-
description='Open DeepResearch',
11+
description='Deep Research but Open-Sourced, called open-deepsearch',
1212
long_description=long_description,
1313
long_description_content_type='text/markdown',
1414
url='https://github.com/aidatatools/open-deepsearch',

0 commit comments

Comments
 (0)