Local Deep Researcher is a fully local web research assistant that uses any LLM hosted by Ollama.
Give it a topic and it will generate a web search query, gather web search results, summarize the results of web search, reflect on the summary to examine knowledge gaps, generate a new search query to address the gaps, and repeat for a user-defined number of cycles.
It will provide the user a final markdown summary with all sources used to generate the summary
Clone the repository then do a cd:
cd src/ollama_deep_researcherThen edit the .env file to customize the environment variables according to your needs. These environment variables control the model selection, search tools, and other configuration settings. When you run the application, these values will be automatically loaded via python-dotenv (because langgraph.json point to the "env" file).
cp .env.example .envollama pull qwen3:latestBy default, it will use DuckDuckGo for web search, cause it does not require an API key.
Optionally, update the .env file with the following search tool configuration and API keys.
If set, these values will take precedence over the defaults set in the Configuration class in configuration.py.
SEARCH_API=xxx # the search API to use, such as `duckduckgo` (default)
MAX_WEB_RESEARCH_LOOPS=xxx # the maximum number of research loop steps, defaults to `3`
FETCH_FULL_PAGE=xxx # fetch the full page content (with `duckduckgo`), defaults to `false`- (Recommended) Create a virtual environment:
python -m venv .venv
source .venv/bin/activate- Launch LangGraph server:
# Install uv package manager
curl -LsSf https://astral.sh/uv/install.sh | sh
uvx --refresh --from "langgraph-cli[inmem]" --with-editable . --python 3.11 langgraph dev- (Recommended) Create a virtual environment:
- Install
Python 3.11(and add to PATH during installation). - Restart your terminal to ensure Python is available, then create and activate a virtual environment:
python -m venv .venv
.venv\Scripts\Activate.ps1ollama serve- Launch LangGraph server:
# Install dependencies
pip install -e .
pip install -U "langgraph-cli[inmem]"
# Start the LangGraph server
langgraph devWhen you launch LangGraph server, you should see the following output and Studio will open in your browser:
Ready!
LangGraph Studio Web UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
Open LangGraph Studio Web UI via the URL above. In the configuration tab, you can directly set various assistant configurations. Keep in mind that the priority order for configuration values is:
1. Environment variables (highest priority)
2. LangGraph UI configuration
3. Default values in the Configuration class (lowest priority)
Give the assistant a topic for research, and you can visualize its process!
When selecting a local LLM, set steps use structured JSON output. Some models may have difficulty with this requirement, and the assistant has fallback mechanisms to handle this. As an example, the DeepSeek R1 (7B) and DeepSeek R1 (1.5B) models have difficulty producing required JSON output, and the assistant will use a fallback mechanism to handle this.
When accessing the LangGraph Studio UI:
- Firefox is recommended for the best experience
- Safari users may encounter security warnings due to mixed content (HTTPS/HTTP)
- If you encounter issues, try:
- Using Firefox or another browser
- Disabling ad-blocking extensions
- Checking browser console for specific error messages
Local Deep Researcher is inspired by IterDRAG. This approach will decompose a query into sub-queries, retrieve documents for each one, answer the sub-query, and then build on the answer by retrieving docs for the second sub-query. Here, we do similar:
- Given a user-provided topic, use a local LLM (via Ollama or LMStudio) to generate a web search query
- Uses a search engine / tool to find relevant sources
- Uses LLM to summarize the findings from web search related to the user-provided research topic
- Then, it uses the LLM to reflect on the summary, identifying knowledge gaps
- It generates a new search query to address the knowledge gaps
- The process repeats, with the summary being iteratively updated with new information from web search
- Runs for a configurable number of iterations (see
configurationtab)
The output of the graph is a markdown file containing the research summary, with citations to the sources used. All sources gathered during research are saved to the graph state. You can visualize them in the graph state, which is visible in LangGraph Studio:
The final summary is saved to the graph state as well:

