duck-duck-go-advanced

Public

Forked from vadimfedenko/duck-duck-go-reworked

Advanced LM Studio plugin for DuckDuckGo web and image search with retries, URL normalization, fallback image extraction, and local thumbnails.

101 Downloads

README

DuckDuckGo Advanced for LM Studio

An advanced DuckDuckGo web and image search plugin for LM Studio with improved retry behavior, queued request spacing, stronger URL normalization, enhanced fallback image extraction, safer image downloads, and cleaner output for LLM tool chaining.

This project is a fork of DuckDuckGo Reworked and builds on its web search, image search, fallback, and local thumbnail workflow.

Tools

  • Web Search Advanced: searches DuckDuckGo web results and returns normalized destination URLs.
  • Image Search Advanced: searches DuckDuckGo images, downloads them into the working directory, and returns local Markdown thumbnails plus compactGalleryMarkdown.

What is improved in this advanced version

  • Saves sidecar JSON metadata for downloaded image search results.
  • Preserves image search context such as search query, caption/title, source page URL, thumbnail URL, original image URL, local image path, and download time.
  • Works with Analyze Images Advanced search tools to find downloaded images by caption or search query.

Web Search Advanced

  • Renamed the web search tool to Web Search Advanced for clearer coexistence with original or Reworked plugins.

  • Added retry/backoff handling to web search requests.

  • Added queued request spacing to reduce rate limiting across repeated tool calls.

  • Improved <a href=...> extraction to support:

    • double-quoted attributes
    • single-quoted attributes
    • unquoted attributes
  • Decodes DuckDuckGo uddg redirect targets and revalidates the decoded URL before returning it.

  • Filters out internal DuckDuckGo links.

Image Search Advanced

  • Renamed the image search tool to Image Search Advanced.

  • Keeps the Reworked image pipeline:

    • DDG vqd bootstrap
    • i.js image endpoint
    • automatic web fallback when blocked
    • local thumbnail generation
    • compactGalleryMarkdown
  • Improves fallback image extraction from web pages with stronger attribute parsing.

  • Supports image candidates from:

    • src
    • data-src
    • data-original
    • srcset
    • Markdown image links
  • Improves srcset handling by selecting the last candidate as a likely higher-resolution image.

  • Adds image download size limits to avoid unexpectedly large downloads.

  • Preserves source: "duckduckgo" and source: "web_fallback" so the assistant can tell how images were found.

Output

Depending on the search type and result availability, the tools can return:

  • links

  • count

  • images

  • compactGalleryMarkdown

  • hint

  • source

  • thumbnailsUsed

  • structured block diagnostics such as:

    • error: blocked_by_waf
    • stage: vqd | i.js
    • try_web_fallback: true

Installation

Install from LM Studio Hub:

  • yuanjumay/duck-duck-go-advanced

Then click Run in LM Studio.

Configuration

  • Search Results Per Page: max number of search results (0 = auto).
  • Safe Search: off, moderate, strict (auto lets assistant decide).

Usage

With the plugin enabled, the assistant can:

  • run web search with Web Search Advanced
  • run image search with Image Search Advanced
  • paginate results when needed
  • return downloaded local thumbnails for image results
  • fall back to web-page image extraction when DuckDuckGo image endpoints are blocked

Example prompts:

  • Search the web for recent information about this topic.
  • Find official pages about this product.
  • Search for images of this landmark.
  • Find image results and show them as a compact gallery.

Works great with the Advanced plugin series

A typical workflow is:

  • Use DuckDuckGo Advanced to find relevant URLs or images.
  • Use Visit Website Advanced to extract structured page content, metadata, headings, JSON-LD, links, images, and text.
  • Use Analyze Images Advanced to inspect downloaded image content when needed.

Changelog

  • Renamed tools to Web Search Advanced and Image Search Advanced.
  • Added retry/backoff handling to web search.
  • Added queued request spacing to reduce rate limiting.
  • Improved anchor extraction for single-quoted and unquoted href attributes.
  • Revalidates decoded DuckDuckGo uddg redirect targets.
  • Improved fallback image extraction with stronger attribute parsing.
  • Improved srcset candidate selection.
  • Added image download size limits.
  • Added compactGalleryMarkdown gallery limiting.

Credits

This project is a fork of DuckDuckGo Reworked.

Original author:

  • Daniel Sig

Reworked version:

  • vadimfedenko/duck-duck-go-reworked

Advanced fork changes:

  • Yuan Jumay

License

MIT

The original copyright and license notices are preserved.