Skip to content

fix(search): restore SearchGraph by migrating DuckDuckGo backend to ddgs#1083

Merged
VinciGit00 merged 1 commit into
mainfrom
fix/search-graph-ddgs-rename
Jun 2, 2026
Merged

fix(search): restore SearchGraph by migrating DuckDuckGo backend to ddgs#1083
VinciGit00 merged 1 commit into
mainfrom
fix/search-graph-ddgs-rename

Conversation

@VinciGit00
Copy link
Copy Markdown
Member

Summary

Fixes #1082 — SearchGraph (the "Search Scraper") stopped returning any results after a recent update, even for simple queries like NVIDIA news, while other modules kept working.

Root cause

The upstream duckduckgo-search package was renamed to ddgs. Recent langchain-community releases (we resolve 0.4.1) now do from ddgs import DDGS inside their DuckDuckGoSearchResults tool. Since the project still depended on the old duckduckgo-search package, instantiating that tool in research_web.search_on_web raised an ImportError, so the default DuckDuckGo search path returned nothing and SearchGraph produced no answer.

ImportError: Could not import ddgs python package. Please install it with `pip install -U ddgs`.

Changes

  • scrapegraphai/utils/research_web.py — replace the langchain-community DuckDuckGoSearchResults wrapper with a direct ddgs.DDGS().text() call in a new _search_duckduckgo helper. URLs are now read from the structured href field instead of regex-parsing a formatted string, and proxy is passed through. A clear ImportError message is raised if ddgs is missing.
  • pyproject.toml — swap duckduckgo-search>=8.1.1 for ddgs>=9.0.0.
  • uv.lock — regenerated. Beyond the dependency swap, uv also pruned stale lock entries (Sphinx/docs deps that were already removed from pyproject.toml in an earlier commit and their transitives); uv lock --check confirms the lockfile is consistent with pyproject.toml.

Testing

  • search_on_web(query="NVIDIA news", search_engine="duckduckgo") now returns URLs (previously ImportError/empty).
  • Full end-to-end SearchGraph("NVIDIA news", ...) with an OpenAI model returns considered URLs and a structured answer.
  • tests/test_search_graph.py passes. (The pre-existing test_omni_search_graph.py failures are unrelated — KeyError: 'model_provider' from the dummy-model config not using the required provider/model format.)

🤖 Generated with Claude Code

The 'duckduckgo-search' package was renamed to 'ddgs'. Recent
langchain-community releases import 'from ddgs import DDGS' in their
DuckDuckGoSearchResults tool, so with the old dependency installed the
default SearchGraph path raised ImportError and returned no results
(GH #1082).

Replace the langchain-community DuckDuckGo wrapper with a direct ddgs
call in research_web._search_duckduckgo, extracting result URLs from the
structured 'href' field instead of regex-parsing a formatted string.
Swap the 'duckduckgo-search' dependency for 'ddgs>=9.0.0'.

Fixes #1082

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working dependencies Pull requests that update a dependency file labels Jun 2, 2026
@VinciGit00 VinciGit00 mentioned this pull request Jun 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 3 package(s) with unknown licenses.
See the Details below.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 8426cd1.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

License Issues

uv.lock

PackageVersionLicenseIssue Type
ddgs9.14.4NullUnknown License
primp1.3.1NullUnknown License
scrapegraph-py2.1.0NullUnknown License

OpenSSF Scorecard

Scorecard details
PackageVersionScoreDetails
pip/brotli 1.2.0 🟢 8
Details
CheckScoreReason
Token-Permissions⚠️ -1No tokens found
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow⚠️ -1no workflows found
Code-Review🟢 5Found 7/12 approved changesets -- score normalized to 5
Security-Policy🟢 10security policy file detected
Maintained🟢 1030 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10
Pinned-Dependencies⚠️ -1no dependencies found
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 2badge detected: InProgress
License🟢 10license file detected
Fuzzing🟢 10project is fuzzed
Vulnerabilities🟢 100 existing vulnerabilities detected
Signed-Releases⚠️ 0Project has not signed or included provenance with any releases.
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST🟢 8SAST tool is not run on all commits -- score normalized to 8
Dependency-Update-Tool🟢 10update tool detected
CI-Tests🟢 1014 out of 14 merged PRs checked by a CI test -- score normalized to 10
Contributors🟢 10project has 17 contributing companies or organizations
pip/brotlicffi 1.2.0.1 🟢 5.2
Details
CheckScoreReason
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 34 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Code-Review🟢 6Found 16/24 approved changesets -- score normalized to 6
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Security-Policy🟢 10security policy file detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
Packaging🟢 10packaging workflow detected
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0
pip/cffi 2.0.0 UnknownUnknown
pip/ddgs 9.14.4 UnknownUnknown
pip/fake-useragent 2.2.0 UnknownUnknown
pip/h2 4.3.0 UnknownUnknown
pip/hpack 4.1.0 UnknownUnknown
pip/hyperframe 6.1.0 UnknownUnknown
pip/primp 1.3.1 UnknownUnknown
pip/pycparser 3.0 UnknownUnknown
pip/scrapegraph-py 2.1.0 UnknownUnknown
pip/socksio 1.0.0 🟢 4
Details
CheckScoreReason
Packaging⚠️ -1packaging workflow not detected
Maintained⚠️ 00 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Code-Review🟢 8Found 25/30 approved changesets -- score normalized to 8
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Security-Policy⚠️ 0security policy file not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Signed-Releases⚠️ -1no releases found
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • uv.lock

@VinciGit00 VinciGit00 merged commit 2139e37 into main Jun 2, 2026
6 of 7 checks passed
github-actions Bot pushed a commit that referenced this pull request Jun 2, 2026
## [2.1.3](v2.1.2...v2.1.3) (2026-06-02)

### Bug Fixes

* **search:** restore SearchGraph by migrating DuckDuckGo backend to ddgs ([#1083](#1083)) ([2139e37](2139e37)), closes [#1082](#1082) [#1082](#1082)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

🎉 This PR is included in version 2.1.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@VinciGit00 VinciGit00 deleted the fix/search-graph-ddgs-rename branch June 5, 2026 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working dependencies Pull requests that update a dependency file released on @stable size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error Search Scraper

1 participant