Overview
Integration details
| Class | Package | PY support | Version |
|---|---|---|---|
| DuckDuckGoSearch | @langchain/community | ✅ |
Setup
The integration lives in the@langchain/community package, along with the duck-duck-scrape dependency:
Credentials
It’s also helpful (but not needed) to set up LangSmith for best-in-class observability:Instantiation
You can instantiate an instance of theDuckDuckGoSearch tool like this:
Invocation
Invoke directly with args
Invoke with ToolCall
We can also invoke the tool with a model-generatedToolCall, in which case a @[ToolMessage] will be returned:
Chaining
We can use our tool in a chain by first binding it to a tool-calling model and then calling it:Agents
For guides on how to use LangChain tools in agents, see the LangGraph.js docs.API reference
For detailed documentation of all DuckDuckGoSearch features and configurations head to the API referenceConnect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.