首页
看点啥
插画图片
首页 科技看点 网络搜索:AI 智能体互联网访问与研究 - Openclaw Skills

网络搜索:AI 智能体互联网访问与研究 - Openclaw Skills

2026-08-17 0

什么是 网络搜索?

网络搜索技能为 AI 智能体提供了一个强大的接口,使其无需复杂的 API 密钥或身份验证即可与实时互联网进行交互。通过利用 DuckDuckGo API,这一 Openclaw Skills 插件允许跨多种媒体类型进行深度技术研究、事实核查和资源收集。它专为开发者设计,提供多种格式的简洁输出,适用于人工阅读和程序化消费。

此工具对于让智能体掌握时事、查找特定视觉资产或从网页数据构建本地化知识库至关重要。凭借对高级过滤(如时间范围、地区和安全搜索级别)的内置支持,它确保获取的信息具有高度相关性,且在专业环境中安全可用。

下载入口:https://github.com/openclaw/skills/tree/main/skills/billyutw/web-search

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install web-search

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 web-search。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

网络搜索 应用场景

网络搜索 工作原理
  1. 智能体根据对网页、新闻、图片或视频内容的查询识别搜索意图。
  2. 配置搜索参数,包括结果限制、时间范围过滤和地区设置。
  3. 该技能使用底层的 DuckDuckGo API 接口执行搜索请求。
  4. 获取结果并处理成所需的格式(文本、Markdown 或 JSON)。
  5. 输出结果要么返回到终端进行即时查看,要么保存到指定的文件路径进行持久化存储。

网络搜索 配置指南

要在 Openclaw Skills 生态系统中使用此功能,您必须首先安装所需的 Python 依赖项:

pip install duckduckgo-search

安装完成后,您可以通过运行简单的测试搜索来验证设置:

python scripts/search.py "Openclaw Skills tutorial"

网络搜索 数据架构与分类体系

该技能根据选择的格式组织其输出。使用 JSON 格式时,数据遵循适用于 Openclaw Skills 自动化的结构化模式:

属性 类型 描述
title 字符串 搜索结果或文章的标题
href 字符串 指向源内容的直接 URL
body 字符串 内容的简短摘要或片段
source 字符串 出版机构(仅限新闻搜索)
duration 字符串 片段的时长(仅限视频搜索)
dimensions 字符串 宽度和高度(仅限图片搜索)
name: web-search
description: This skill should be used when users need to search the web for information, find current content, look up news articles, search for images, or find videos. It uses DuckDuckGo's search API to return results in clean, formatted output (text, markdown, or JSON). Use for research, fact-checking, finding recent information, or gathering web resources.

Overview

Search the web using DuckDuckGo's API to find information across web pages, news articles, images, and videos. Returns results in multiple formats (text, markdown, JSON) with filtering options for time range, region, and safe search.

When to Use This Skill

Use this skill when users request:

Prerequisites

Install the required dependency:

pip install duckduckgo-search

This library provides a simple Python interface to DuckDuckGo's search API without requiring API keys or authentication.

Core Capabilities

Search for web pages and information:

python scripts/search.py ""

Example:

python scripts/search.py "python asyncio tutorial"

Returns the top 10 web results with titles, URLs, and descriptions in a clean text format.

2. Limiting Results

Control the number of results returned:

python scripts/search.py "" --max-results 

Example:

python scripts/search.py "machine learning frameworks" --max-results 20

Useful for:

3. Time Range Filtering

Filter results by recency:

python scripts/search.py "" --time-range 

Time range options:

Example:

python scripts/search.py "artificial intelligence news" --time-range w

Great for:

Search specifically for news articles:

python scripts/search.py "" --type news

Example:

python scripts/search.py "climate change" --type news --time-range w --max-results 15

News results include:

Search for images:

python scripts/search.py "" --type images

Example:

python scripts/search.py "sunset over mountains" --type images --max-results 20

Image filtering options:

Size filters:

python scripts/search.py "landscape photos" --type images --image-size Large

Options: Small, Medium, Large, Wallpaper

Color filters:

python scripts/search.py "abstract art" --type images --image-color Blue

Options: color, Monochrome, Red, Orange, Yellow, Green, Blue, Purple, Pink, Brown, Black, Gray, Teal, White

Type filters:

python scripts/search.py "icons" --type images --image-type transparent

Options: photo, clipart, gif, transparent, line

Layout filters:

python scripts/search.py "wallpapers" --type images --image-layout Wide

Options: Square, Tall, Wide

Image results include:

Search for videos:

python scripts/search.py "" --type videos

Example:

python scripts/search.py "python tutorial" --type videos --max-results 15

Video filtering options:

Duration filters:

python scripts/search.py "cooking recipes" --type videos --video-duration short

Options: short, medium, long

Resolution filters:

python scripts/search.py "documentary" --type videos --video-resolution high

Options: high, standard

Video results include:

Search with region-specific results:

python scripts/search.py "" --region 

Common region codes:

Example:

python scripts/search.py "local news" --region us-en --type news

8. Safe Search Control

Control safe search filtering:

python scripts/search.py "" --safe-search 

Options:

Example:

python scripts/search.py "medical information" --safe-search on

9. Output Formats

Choose how results are formatted:

Text format (default):

python scripts/search.py "quantum computing"

Clean, readable plain text with numbered results.

Markdown format:

python scripts/search.py "quantum computing" --format markdown

Formatted markdown with headers, bold text, and links.

JSON format:

python scripts/search.py "quantum computing" --format json

Structured JSON data for programmatic processing.

10. Saving Results to File

Save search results to a file:

python scripts/search.py "" --output 

Example:

python scripts/search.py "artificial intelligence" --output ai_results.txt
python scripts/search.py "AI news" --type news --format markdown --output ai_news.md
python scripts/search.py "AI research" --format json --output ai_data.json

The file format is determined by the --format flag, not the file extension.

Output Format Examples

Text Format

1. Page Title Here
   URL: https://example.com/page
   Brief description of the page content...

2. Another Result
   URL: https://example.com/another
   Another description...

Markdown Format

## 1. Page Title Here

**URL:** https://example.com/page

Brief description of the page content...

## 2. Another Result

**URL:** https://example.com/another

Another description...

JSON Format

[
  {
    "title": "Page Title Here",
    "href": "https://example.com/page",
    "body": "Brief description of the page content..."
  },
  {
    "title": "Another Result",
    "href": "https://example.com/another",
    "body": "Another description..."
  }
]

Common Usage Patterns

Research on a Topic

Gather comprehensive information about a subject:

# Get overview from web
python scripts/search.py "machine learning basics" --max-results 15 --output ml_web.txt

# Get recent news
python scripts/search.py "machine learning" --type news --time-range m --output ml_news.txt

# Find tutorial videos
python scripts/search.py "machine learning tutorial" --type videos --max-results 10 --output ml_videos.txt

Current Events Monitoring

Track news on specific topics:

python scripts/search.py "climate summit" --type news --time-range d --format markdown --output daily_climate_news.md

Finding Visual Resources

Search for images with specific criteria:

python scripts/search.py "data visualization examples" --type images --image-type photo --image-size Large --max-results 25 --output viz_images.txt

Fact-Checking

Verify information with recent sources:

python scripts/search.py "specific claim to verify" --time-range w --max-results 20

Academic Research

Find resources on scholarly topics:

python scripts/search.py "quantum entanglement research" --time-range y --max-results 30 --output quantum_research.txt

Market Research

Gather information about products or companies:

python scripts/search.py "electric vehicle market 2025" --max-results 20 --format markdown --output ev_market.md
python scripts/search.py "EV news" --type news --time-range m --output ev_news.txt

Implementation Approach

When users request web searches:

  1. Identify search intent:

    • What type of content (web, news, images, videos)?
    • How recent should results be?
    • How many results are needed?
    • Any filtering requirements?
  2. Configure search parameters:

    • Choose appropriate search type (--type)
    • Set time range if currency matters (--time-range)
    • Adjust result count (--max-results)
    • Apply filters (image size, video duration, etc.)
  3. Select output format:

    • Text for quick reading
    • Markdown for documentation
    • JSON for further processing
  4. Execute search:

    • Run the search command
    • Save to file if results need to be preserved
    • Print to stdout for immediate review
  5. Process results:

    • Read saved files if needed
    • Extract URLs or specific information
    • Combine results from multiple searches

Quick Reference

Command structure:

python scripts/search.py "" [options]

Essential options:

Image-specific options:

Video-specific options:

Get full help:

python scripts/search.py --help

Best Practices

  1. Be specific - Use clear, specific search queries for better results
  2. Use time filters - Apply --time-range for current information
  3. Adjust result count - Start with 10-20 results, increase if needed
  4. Save important searches - Use --output to preserve results
  5. Choose appropriate type - Use news search for current events, web for general info
  6. Use JSON for automation - JSON format is easiest to parse programmatically
  7. Respect usage - Don't hammer the API with rapid repeated searches

Troubleshooting

Common issues:

Limitations:

Advanced Use Cases

Combining Multiple Searches

Gather comprehensive information by combining search types:

# Web overview
python scripts/search.py "topic" --max-results 15 --output topic_web.txt

# Recent news
python scripts/search.py "topic" --type news --time-range w --output topic_news.txt

# Images
python scripts/search.py "topic" --type images --max-results 20 --output topic_images.txt

Programmatic Processing

Use JSON output for automated processing:

python scripts/search.py "research topic" --format json --output results.json
# Then process with another script
python analyze_results.py results.json

Building a Knowledge Base

Create searchable documentation from web results:

# Search multiple related topics
python scripts/search.py "topic1" --format markdown --output kb/topic1.md
python scripts/search.py "topic2" --format markdown --output kb/topic2.md
python scripts/search.py "topic3" --format markdown --output kb/topic3.md

Resources

scripts/search.py

The main search tool implementing DuckDuckGo search functionality. Key features:

The script can be executed directly and includes comprehensive command-line help via --help.

喜欢(0)

上一篇

钉钉官方最新版下载 钉钉安卓app免费下载

钉钉官方最新版下载 钉钉安卓app免费下载

下一篇

《探索格雷科技6模组中末影粗胚锭的神奇用途》(揭开末影粗胚锭的奥秘,实现无尽可能性)

《探索格雷科技6模组中末影粗胚锭的神奇用途》(揭开末影粗胚锭的奥秘,实现无尽可能性)
猜你喜欢