[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71972":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":9,"rankLanguage":9,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":22,"topics":25,"createdAt":9,"pushedAt":9,"updatedAt":26,"readmeContent":27,"aiSummary":28,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":29,"discoverSource":30},71972,"local-deep-researcher","langchain-ai\u002Flocal-deep-researcher","langchain-ai","Fully local web research and report writing assistant",null,"Python",9210,964,77,36,0,2,8,70,6,39.95,"MIT License",false,"main",true,[],"2026-06-12 02:02:56","# Local Deep Researcher\n\nLocal Deep Researcher is a fully local web research assistant that uses any LLM hosted by [Ollama](https:\u002F\u002Follama.com\u002Fsearch) or [LMStudio](https:\u002F\u002Flmstudio.ai\u002F). 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.\n\n![ollama-deep-research](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F1c6b28f8-6b64-42ba-a491-1ab2875d50ea)\n\nShort summary video:\n\u003Cvideo src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F02084902-f067-4658-9683-ff312cab7944\" controls>\u003C\u002Fvideo>\n\n## 🔥 Updates \n\n* 8\u002F6\u002F25: Added support for tool calling and [gpt-oss](https:\u002F\u002Fopenai.com\u002Findex\u002Fintroducing-gpt-oss\u002F). \n\n> ⚠️ **WARNING (8\u002F6\u002F25)**: The `gpt-oss` models do not support JSON mode in Ollama. Select `use_tool_calling` in the configuration to use tool calling instead of JSON mode.\n\n## 📺 Video Tutorials\n\nSee it in action or build it yourself? Check out these helpful video tutorials:\n- [Overview of Local Deep Researcher with R1](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=sGUjmyfof4Q) - Load and test [DeepSeek R1](https:\u002F\u002Fapi-docs.deepseek.com\u002Fnews\u002Fnews250120) [distilled models](https:\u002F\u002Follama.com\u002Flibrary\u002Fdeepseek-r1).\n- [Building Local Deep Researcher from Scratch](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=XGuTzHoqlj8) - Overview of how this is built.\n\n## 🚀 Quickstart\n\nClone the repository:\n```shell\ngit clone https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Flocal-deep-researcher.git\ncd local-deep-researcher\n```\n\nThen 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).\n```shell\ncp .env.example .env\n```\n\n### Selecting local model with Ollama\n\n1. Download the Ollama app for Mac [here](https:\u002F\u002Follama.com\u002Fdownload).\n\n2. Pull a local LLM from [Ollama](https:\u002F\u002Follama.com\u002Fsearch). As an [example](https:\u002F\u002Follama.com\u002Flibrary\u002Fdeepseek-r1:8b):\n```shell\nollama pull deepseek-r1:8b\n```\n\n3. Optionally, update the `.env` file with the following Ollama configuration settings. \n\n* If set, these values will take precedence over the defaults set in the `Configuration` class in `configuration.py`. \n```shell\nLLM_PROVIDER=ollama\nOLLAMA_BASE_URL=\"http:\u002F\u002Flocalhost:11434\" # Ollama service endpoint, defaults to `http:\u002F\u002Flocalhost:11434` \nLOCAL_LLM=model # the model to use, defaults to `llama3.2` if not set\n```\n\n### Selecting local model with LMStudio\n\n1. Download and install LMStudio from [here](https:\u002F\u002Flmstudio.ai\u002F).\n\n2. In LMStudio:\n   - Download and load your preferred model (e.g., qwen_qwq-32b)\n   - Go to the \"Local Server\" tab\n   - Start the server with the OpenAI-compatible API\n   - Note the server URL (default: http:\u002F\u002Flocalhost:1234\u002Fv1)\n\n3. Optionally, update the `.env` file with the following LMStudio configuration settings. \n\n* If set, these values will take precedence over the defaults set in the `Configuration` class in `configuration.py`. \n```shell\nLLM_PROVIDER=lmstudio\nLOCAL_LLM=qwen_qwq-32b  # Use the exact model name as shown in LMStudio\nLMSTUDIO_BASE_URL=http:\u002F\u002Flocalhost:1234\u002Fv1\n```\n\n### Selecting search tool\n\nBy default, it will use [DuckDuckGo](https:\u002F\u002Fduckduckgo.com\u002F) for web search, which does not require an API key. But you can also use [SearXNG](https:\u002F\u002Fdocs.searxng.org\u002F), [Tavily](https:\u002F\u002Ftavily.com\u002F) or [Perplexity](https:\u002F\u002Fwww.perplexity.ai\u002Fhub\u002Fblog\u002Fintroducing-the-sonar-pro-api) 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`. \n```shell\nSEARCH_API=xxx # the search API to use, such as `duckduckgo` (default)\nTAVILY_API_KEY=xxx # the tavily API key to use\nPERPLEXITY_API_KEY=xxx # the perplexity API key to use\nMAX_WEB_RESEARCH_LOOPS=xxx # the maximum number of research loop steps, defaults to `3`\nFETCH_FULL_PAGE=xxx # fetch the full page content (with `duckduckgo`), defaults to `false`\n```\n\n### Running with LangGraph Studio\n\n#### Mac\n\n1. (Recommended) Create a virtual environment:\n```bash\npython -m venv .venv\nsource .venv\u002Fbin\u002Factivate\n```\n\n2. Launch LangGraph server:\n\n```bash\n# Install uv package manager\ncurl -LsSf https:\u002F\u002Fastral.sh\u002Fuv\u002Finstall.sh | sh\nuvx --refresh --from \"langgraph-cli[inmem]\" --with-editable . --python 3.11 langgraph dev\n```\n\n#### Windows\n\n1. (Recommended) Create a virtual environment: \n\n* Install `Python 3.11` (and add to PATH during installation). \n* Restart your terminal to ensure Python is available, then create and activate a virtual environment:\n\n```powershell\npython -m venv .venv\n.venv\\Scripts\\Activate.ps1\n```\n\n2. Launch LangGraph server:\n\n```powershell\n# Install dependencies\npip install -e .\npip install -U \"langgraph-cli[inmem]\"            \n\n# Start the LangGraph server\nlanggraph dev\n```\n\n### Using the LangGraph Studio UI\n\nWhen you launch LangGraph server, you should see the following output and Studio will open in your browser:\n> Ready!\n\n> API: http:\u002F\u002F127.0.0.1:2024\n\n> Docs: http:\u002F\u002F127.0.0.1:2024\u002Fdocs\n\n> LangGraph Studio Web UI: https:\u002F\u002Fsmith.langchain.com\u002Fstudio\u002F?baseUrl=http:\u002F\u002F127.0.0.1:2024\n\nOpen `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:\n\n```\n1. Environment variables (highest priority)\n2. LangGraph UI configuration\n3. Default values in the Configuration class (lowest priority)\n```\n\n\u003Cimg width=\"1621\" alt=\"Screenshot 2025-01-24 at 10 08 31 PM\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F7cfd0e04-28fd-4cfa-aee5-9a556d74ab21\" \u002F>\n\nGive the assistant a topic for research, and you can visualize its process!\n\n\u003Cimg width=\"1621\" alt=\"Screenshot 2025-01-24 at 10 08 22 PM\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F4de6bd89-4f3b-424c-a9cb-70ebd3d45c5f\" \u002F>\n\n### Model Compatibility Note\n\nWhen 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)](https:\u002F\u002Follama.com\u002Flibrary\u002Fdeepseek-llm:7b) and [DeepSeek R1 (1.5B)](https:\u002F\u002Follama.com\u002Flibrary\u002Fdeepseek-r1:1.5b) models have difficulty producing required JSON output, and the assistant will use a fallback mechanism to handle this.\n  \n### Browser Compatibility Note\n\nWhen accessing the LangGraph Studio UI:\n- Firefox is recommended for the best experience\n- Safari users may encounter security warnings due to mixed content (HTTPS\u002FHTTP)\n- If you encounter issues, try:\n  1. Using Firefox or another browser\n  2. Disabling ad-blocking extensions\n  3. Checking browser console for specific error messages\n\n## How it works\n\nLocal Deep Researcher is inspired by [IterDRAG](https:\u002F\u002Farxiv.org\u002Fhtml\u002F2410.04343v1#:~:text=To%20tackle%20this%20issue%2C%20we,used%20to%20generate%20intermediate%20answers.). 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:\n- Given a user-provided topic, use a local LLM (via [Ollama](https:\u002F\u002Follama.com\u002Fsearch) or [LMStudio](https:\u002F\u002Flmstudio.ai\u002F)) to generate a web search query\n- Uses a search engine \u002F tool to find relevant sources\n- Uses LLM to summarize the findings from web search related to the user-provided research topic\n- Then, it uses the LLM to reflect on the summary, identifying knowledge gaps\n- It generates a new search query to address the knowledge gaps\n- The process repeats, with the summary being iteratively updated with new information from web search\n- Runs for a configurable number of iterations (see `configuration` tab)\n\n## Outputs\n\nThe 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:\n\n![Screenshot 2024-12-05 at 4 08 59 PM](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fe8ac1c0b-9acb-4a75-8c15-4e677e92f6cb)\n\nThe final summary is saved to the graph state as well:\n\n![Screenshot 2024-12-05 at 4 10 11 PM](https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Ff6d997d5-9de5-495f-8556-7d3891f6bc96)\n\n## Deployment Options\n\nThere are [various ways](https:\u002F\u002Flangchain-ai.github.io\u002Flanggraph\u002Fconcepts\u002F#deployment-options) to deploy this graph. See [Module 6](https:\u002F\u002Fgithub.com\u002Flangchain-ai\u002Flangchain-academy\u002Ftree\u002Fmain\u002Fmodule-6) of LangChain Academy for a detailed walkthrough of deployment options with LangGraph.\n\n## TypeScript Implementation\n\nA TypeScript port of this project (without Perplexity search) is available at:\nhttps:\u002F\u002Fgithub.com\u002FPacoVK\u002Follama-deep-researcher-ts\n\n## Running as a Docker container\n\nThe included `Dockerfile` only runs LangChain Studio with local-deep-researcher as a service, but does not include Ollama as a dependant service. You must run Ollama separately and configure the `OLLAMA_BASE_URL` environment variable. Optionally you can also specify the Ollama model to use by providing the `LOCAL_LLM` environment variable.\n\nClone the repo and build an image:\n```\n$ docker build -t local-deep-researcher .\n```\n\nRun the container:\n```\n$ docker run --rm -it -p 2024:2024 \\\n  -e SEARCH_API=\"tavily\" \\ \n  -e TAVILY_API_KEY=\"tvly-***YOUR_KEY_HERE***\" \\\n  -e LLM_PROVIDER=ollama \\\n  -e OLLAMA_BASE_URL=\"http:\u002F\u002Fhost.docker.internal:11434\u002F\" \\\n  -e LOCAL_LLM=\"llama3.2\" \\  \n  local-deep-researcher\n```\n\nNOTE: You will see log message:\n```\n2025-02-10T13:45:04.784915Z [info     ] 🎨 Opening Studio in your browser... [browser_opener] api_variant=local_dev message=🎨 Opening Studio in your browser...\nURL: https:\u002F\u002Fsmith.langchain.com\u002Fstudio\u002F?baseUrl=http:\u002F\u002F0.0.0.0:2024\n```\n...but the browser will not launch from the container.\n\nInstead, visit this link with the correct baseUrl IP address: [`https:\u002F\u002Fsmith.langchain.com\u002Fstudio\u002Fthread?baseUrl=http:\u002F\u002F127.0.0.1:2024`](https:\u002F\u002Fsmith.langchain.com\u002Fstudio\u002Fthread?baseUrl=http:\u002F\u002F127.0.0.1:2024)\n","Local Deep Researcher 是一个完全本地化的网络研究和报告撰写助手。它利用Ollama或LMStudio托管的任何大语言模型，根据用户提供的主题生成网络搜索查询、收集搜索结果、总结搜索内容，并通过反思来识别知识空白，进而生成新的搜索查询以填补这些空白，这一过程可按用户定义的次数重复进行。最终，项目会提供一份包含所有参考来源的Markdown格式总结。该工具适合需要深入研究特定话题并自动生成综合报告的场景使用，尤其适用于学术研究、市场分析等领域。","2026-06-11 03:39:44","high_star"]