langchain-ai /local-deep-researcher

Fully local web research and report writing assistant

★ 9,412⑂ 975👁 74⑃ 68● 77▤ 0
PythonMITCreated 2024-12-04
+2
日增长
9,412
stars
975
forks
74
watchers
68
prs
77
issues
0
releases

README

Local Deep Researcher

Local Deep Researcher is a fully local web research assistant that uses any LLM hosted by Ollama or LMStudio. 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.

!ollama-deep-research

Short summary video:


 📺 Video Tutorials

See it in action or build it yourself? Check out these helpful video tutorials:
- Overview of Local Deep Researcher with R1 - Load and test DeepSeek R1 distilled models.
- Building Local Deep Researcher from Scratch - Overview of how this is built.

 🚀 Quickstart

Clone the repository:
shell
git clone https://github.com/langchain-ai/local-deep-researcher.git
cd local-deep-researcher


Then 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).
shell
cp .env.example .env


 Selecting local model with Ollama

1. Download the Ollama app for Mac here.

2. Pull a local LLM from Ollama. As an example:
shell
ollama pull deepseek-r1:8b


3. Optionally, update the .env file with the following Ollama configuration settings. 

 If set, these values will take precedence over the defaults set in the Configuration class in configuration.py. 
shell
LLM_PROVIDER=ollama
OLLAMA_BASE_URL="http://localhost:11434"  Ollama service endpoint, defaults to http://localhost:11434 
LOCAL_LLM=model  the model to use, defaults to llama3.2 if not set


 Selecting local model with LMStudio

1. Download and install LMStudio from here.

2. In LMStudio:
   - Download and load your preferred model (e.g., qwen_qwq-32b)
   - Go to the "Local Server" tab
   - Start the server with the OpenAI-compatible API
   - Note the server URL (default: http://localhost:1234/v1)

3. Optionally, update the .env file with the following LMStudio configuration settings. 

 If set, these values will take precedence over the defaults set in the Configuration class in configuration.py. 
shell
LLM_PROVIDER=lmstudio
LOCAL_LLM=qwen_qwq-32b   Use the exact model name as shown in LMStudio
LMSTUDIO_BASE_URL=http://localhost:1234/v1


 Selecting search tool

By default, it will use DuckDuckGo for web search, which does not require an API key. But you can also use SearXNG, Tavily or Perplexity by adding their API keys to the environment file. 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. 
shell
SEARCH_API=xxx  the search API to use, su

Top issues

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON