Web Search Plugin

Search the web for current information using DuckDuckGo. Enables the model to access up-to-date information beyond its training cutoff.

Name web_search
Type Tool Plugin (Registry-managed)
Tools Provided web_search
User Commands None
Auto-approved web_search (read-only)

Features

  • DuckDuckGo Backend: Privacy-focused search without API keys
  • Configurable Results: Control max results and timeout
  • Safe Search: Adjustable content filtering
  • Region Support: Localize results by region
  • Auto-approved: Read-only, no permission required

Requirements

The ddgs package must be installed:

pip install ddgs
Basic usage
from jaato import PluginRegistry

registry = PluginRegistry()
registry.discover()

# Expose web_search with defaults
registry.expose_tool('web_search')

# With custom configuration
registry.expose_tool('web_search', config={
    'max_results': 20,
    'timeout': 15,
    'region': 'us-en',
    'safesearch': 'strict',
})
Model usage
# Basic search
web_search(query="Python asyncio tutorial")

# Limit results
web_search(query="climate change 2024", max_results=5)

# Time-sensitive search
web_search(query="latest AI developments January 2024")

Configuration Parameters

max_results

Maximum number of search results to return.

Typeint
Default10

timeout

Request timeout in seconds.

Typeint
Default10

region

Region code for localized results.

Typestr
Default"wt-wt" (no region)

safesearch

Content filtering level.

Type"off" | "moderate" | "strict"
Default"moderate"
Configuration examples
# US-focused, strict safe search
registry.expose_tool('web_search', config={
    'region': 'us-en',
    'safesearch': 'strict',
})

# More results, longer timeout
registry.expose_tool('web_search', config={
    'max_results': 25,
    'timeout': 20,
})

# No content filtering
registry.expose_tool('web_search', config={
    'safesearch': 'off',
})
Region codes
Common region codes:
  wt-wt     No region (worldwide)
  us-en     United States (English)
  uk-en     United Kingdom (English)
  de-de     Germany (German)
  fr-fr     France (French)
  es-es     Spain (Spanish)
  jp-jp     Japan (Japanese)
  au-en     Australia (English)

Tool Reference

web_search

Search the web for information on any topic.

Parameters

NameTypeRequiredDescription
query string Yes Search query
max_results int No Override default max results

Response Fields

FieldTypeDescription
query string The original query
result_count int Number of results returned
results array Array of search results

Result Object

FieldTypeDescription
titlestringPage title
urlstringPage URL
snippetstringText excerpt
Example response
{
  "query": "Python asyncio tutorial",
  "result_count": 3,
  "results": [
    {
      "title": "Asyncio in Python - Real Python",
      "url": "https://realpython.com/async-io-python/",
      "snippet": "Learn about async IO in Python..."
    },
    {
      "title": "Python Asyncio Tutorial - Official Docs",
      "url": "https://docs.python.org/3/library/asyncio.html",
      "snippet": "The asyncio module provides..."
    },
    {
      "title": "Getting Started with Asyncio",
      "url": "https://example.com/asyncio-guide",
      "snippet": "A beginner's guide to..."
    }
  ]
}
No results response
{
  "query": "xyzzy12345nonexistent",
  "results": [],
  "message": "No results found for the query"
}
Error response
{
  "error": "ddgs package not installed",
  "hint": "Install with: pip install ddgs"
}

Search Tips

The model is given these tips for effective searching:

  • Be specific: Include relevant keywords and context
  • Use quotes: For exact phrase matching
  • Add dates: For time-sensitive information
  • Limit results: When you only need a few top matches

Use Cases

CategoryExample Query
News latest AI developments 2024
Documentation Python asyncio tutorial
Research climate change statistics 2024
Products MacBook Pro M3 review
Effective search examples
# Specific query with context
web_search(query="Python Flask SQLAlchemy tutorial 2024")

# Exact phrase match
web_search(query='"climate change" statistics 2024')

# Limited results for quick lookup
web_search(query="US population 2024", max_results=3)

# Technical documentation
web_search(query="React useEffect cleanup function")

# Current events
web_search(query="OpenAI latest news this week")