feat: add enable_web_search config to disable web search (#681) (#760)

* feat: add enable_web_search config to disable web search (#681)

* fix: skip enforce_researcher_search validation when web search is disabled

- Return json.dumps([]) instead of empty string for consistency in background_investigation_node

- Add enable_web_search check to skip validation warning when user intentionally disabled web search

- Add warning log when researcher has no tools available

- Update tests to include new enable_web_search parameter

* fix: address Copilot review feedback

- Coordinate enforce_web_search with enable_web_search in validate_and_fix_plan

- Fix misleading comment in background_investigation_node

* docs: add warning about local RAG setup when disabling web search

* docs: add web search toggle section to configuration guide
This commit is contained in:
Jiahe Wu
2025-12-15 19:17:24 +08:00
committed by GitHub
parent c686ab7016
commit 93d81d450d
7 changed files with 89 additions and 7 deletions

View File

@@ -254,6 +254,39 @@ SEARCH_ENGINE:
```
That's meaning that the search results will be filtered based on the minimum relevance score threshold and truncated to the maximum length limit for each search result content.
## Web Search Toggle
DeerFlow allows you to disable web search functionality, which is useful for environments without internet access or when you want to use only local RAG knowledge bases.
### Configuration
You can disable web search in your `conf.yaml` file:
```yaml
# Disable web search (use only local RAG)
ENABLE_WEB_SEARCH: false
```
Or via API request parameter:
```json
{
"messages": [{"role": "user", "content": "Research topic"}],
"enable_web_search": false
}
```
> [!WARNING]
> If you disable web search, make sure to configure local RAG resources; otherwise, the researcher will operate in pure LLM reasoning mode without external data sources.
### Behavior When Web Search is Disabled
- **Background investigation**: Skipped entirely (relies on web search)
- **Researcher node**: Will use only RAG retriever tools if configured
- **Pure reasoning mode**: If no RAG resources are available, the researcher will rely solely on LLM reasoning
---
## RAG (Retrieval-Augmented Generation) Configuration
DeerFlow supports multiple RAG providers for document retrieval. Configure the RAG provider by setting environment variables.