### Installing DeepResearch Project Dependencies (Bash) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This snippet provides the commands to clone the DeepResearch repository, navigate into its directory, and install all required Python dependencies using pip from the `requirements.txt` file. This is a prerequisite for running the application. ```bash git clone https://github.com/yourusername/deepresearch.git cd deepresearch pip install -r requirements.txt ``` -------------------------------- ### Running the DeepResearch Streamlit Application (Bash) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This snippet shows the command to start the DeepResearch web application, which is built using Streamlit. Executing this command will launch the application in your default web browser. ```bash streamlit run app.py ``` -------------------------------- ### DeepResearch Python Requirements List Source: https://github.com/gaurav21s/deepresearch/blob/main/requirements.txt This snippet contains a list of Python packages and their exact versions, typically found in a 'requirements.txt' file. These dependencies are crucial for running the 'deepresearch' project, ensuring all necessary libraries are installed at compatible versions. ```Python aiohappyeyeballs==2.6.1 aiohttp==3.11.14 aiosignal==1.3.2 altair==5.5.0 annotated-types==0.7.0 anyio==4.9.0 appnope==0.1.4 asttokens==3.0.0 async-timeout==4.0.3 attrs==25.3.0 beautifulsoup4==4.13.3 blinker==1.9.0 Brotli==1.1.0 cachetools==5.5.2 certifi==2025.1.31 cffi==1.17.1 chardet==5.2.0 charset-normalizer==3.4.1 click==8.1.8 comm==0.2.2 cssselect2==0.8.0 dataclasses-json==0.6.7 debugpy==1.8.13 decorator==5.2.1 deprecation==2.1.0 distro==1.9.0 exceptiongroup==1.2.2 executing==2.2.0 fanstatic==1.5 filetype==1.2.0 fonttools==4.56.0 fpdf==1.7.2 frozenlist==1.5.0 gitdb==4.0.12 GitPython==3.1.44 google-ai-generativelanguage==0.6.17 google-api-core==2.24.2 google-auth==2.38.0 googleapis-common-protos==1.69.2 gotrue==2.11.4 grpcio==1.71.0 grpcio-status==1.71.0 h11==0.14.0 h2==4.2.0 hpack==4.1.0 httpcore==1.0.7 httpx==0.28.1 httpx-sse==0.4.0 hyperframe==6.1.0 idna==3.10 importlib_metadata==8.6.1 ipykernel==6.29.5 ipython==8.18.1 jedi==0.19.2 Jinja2==3.1.6 jiter==0.9.0 js==1.0 jsonpatch==1.33 jsonpointer==3.0.0 jsonschema==4.23.0 jsonschema-specifications==2024.10.1 jupyter_client==8.6.3 jupyter_core==5.7.2 langchain==0.3.14 langchain-community==0.3.14 langchain-core==0.3.47 langchain-google-genai==2.1.1 langchain-openai==0.3.0 langchain-text-splitters==0.3.7 langgraph==0.2.64 langgraph-checkpoint==2.0.21 langgraph-sdk==0.1.58 langsmith==0.2.11 Markdown==3.7 markdown-it-py==3.0.0 MarkupSafe==3.0.2 marshmallow==3.26.1 matplotlib-inline==0.1.7 mdurl==0.1.2 msgpack==1.1.0 multidict==6.2.0 mypy-extensions==1.0.0 narwhals==1.31.0 nest-asyncio==1.6.0 numpy==1.26.4 openai==1.68.2 orjson==3.10.15 packaging==24.2 pandas==2.2.3 parso==0.8.4 pdfkit==1.0.0 pexpect==4.9.0 pillow==11.1.0 platformdirs==4.3.7 postgrest==0.19.3 prompt_toolkit==3.0.50 propcache==0.3.0 proto-plus==1.26.1 protobuf==5.29.4 psutil==7.0.0 ptyprocess==0.7.0 pure_eval==0.2.3 pyarrow==19.0.1 pyasn1==0.6.1 pyasn1_modules==0.4.1 pycparser==2.22 pydantic==2.10.6 pydantic-settings==2.8.1 pydantic_core==2.27.2 pydeck==0.9.1 pydyf==0.11.0 Pygments==2.19.1 pyperclip==1.9.0 pyphen==0.17.2 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 pytz==2025.1 PyYAML==6.0.2 pyzmq==26.3.0 realtime==2.4.1 referencing==0.36.2 regex==2024.11.6 reportlab==4.3.1 requests==2.32.3 requests-toolbelt==1.0.0 rich==13.9.4 rpds-py==0.23.1 rsa==4.9 six==1.17.0 smmap==5.0.2 sniffio==1.3.1 soupsieve==2.6 SQLAlchemy==2.0.39 stack-data==0.6.3 storage3==0.11.3 streamlit==1.43.2 StrEnum==0.4.15 supabase==2.14.0 supafunc==0.9.3 tenacity==9.0.0 tiktoken==0.9.0 tinycss2==1.4.0 tinyhtml5==2.0.0 toml==0.10.2 tornado==6.4.2 tqdm==4.67.1 traitlets==5.14.3 typing-inspect==0.9.0 typing_extensions==4.12.2 tzdata==2025.1 urllib3==2.3.0 wcwidth==0.2.13 webencodings==0.5.1 WebOb==1.8.9 websockets==14.2 yarl==1.18.3 zipp==3.21.0 zopfli==0.2.3.post1 ``` -------------------------------- ### Setting Environment Variables for DeepResearch (Bash) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This snippet shows how to set the necessary environment variables for the DeepResearch application, including API keys for OpenAI and Tavily, and credentials for Supabase. These variables are crucial for the application to connect to external services. ```bash OPENAI_API_KEY=your_openai_api_key TAVILY_API_KEY=your_tavily_api_key SUPABASE_URL=your_supabase_url SUPABASE_KEY=your_supabase_key ``` -------------------------------- ### Generating Report Plan with LangGraph (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This asynchronous function is part of the Report Planning Agent. It analyzes the user's topic, generates initial search queries, creates a structured report outline, and identifies sections requiring web research. It takes a `ReportState` object as input and returns a list of `Section` objects. ```Python async def generate_report_plan(state: ReportState): """Generate the overall plan for building the report""" # Generates search queries and section structure # Returns a list of Section objects with research requirements ``` -------------------------------- ### Running Asynchronous Web Search Queries (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This asynchronous function executes a list of search queries, typically using a web search API like Tavily. It allows specifying the number of results and whether to include raw content. It takes a list of strings or `SearchQuery` objects and returns a list of dictionaries containing search results. ```Python async def run_search_queries( search_queries: List[Union[str, SearchQuery]], num_results: int = 4, include_raw_content: bool = False ) -> List[Dict] ``` -------------------------------- ### Defining the Report Section Data Model (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This Pydantic `BaseModel` defines the structure for a report section. It includes fields for the section's name, a brief description, a boolean flag indicating if research is required, and the generated content of the section. This model ensures structured data handling for report components. ```Python class Section(BaseModel): name: str # Section name description: str # Section overview research: bool # Research flag content: str # Section content ``` -------------------------------- ### Generating Section-Specific Search Queries (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This function, part of the Section Builder Agent, generates targeted search queries for individual report sections. It bases these queries on the section's topic, takes a `SectionState` object, and returns a list of `SearchQuery` objects. ```Python def generate_queries(state: SectionState): """Generate targeted search queries for each section""" # Creates specific search queries based on section topic # Returns a list of SearchQuery objects ``` -------------------------------- ### Defining the Search Query Data Model (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This Pydantic `BaseModel` defines a simple structure for a search query. It contains a single field, `search_query`, which holds the string representation of the query. This model standardizes the input for web search operations. ```Python class SearchQuery(BaseModel): search_query: str ``` -------------------------------- ### Generating Section Content with GPT-4 (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This function, part of the Section Builder Agent, generates the content for a specific report section. It utilizes GPT-4 for content creation and integrates the results obtained from web research. It takes a `SectionState` object as input. ```Python def write_section(state: SectionState): """Generate section content from research""" # Uses GPT-4 to write section content # Integrates web research results ``` -------------------------------- ### Executing Parallel Web Searches (Python) Source: https://github.com/gaurav21s/deepresearch/blob/main/README.md This asynchronous function, part of the Section Builder Agent, performs parallel web searches using the Tavily API. It takes a `SectionState` object, deduplicates, and formats the search results for subsequent content generation. ```Python async def search_web(state: SectionState): """Execute web searches and format results""" # Performs parallel web searches using Tavily API # Deduplicates and formats search results ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.