简介
自托管聚合搜索引擎,无需API密钥即可调用多引擎搜索,适合OpenClaw代理私有化部署与离线场景。
原始描述
Self-hosted web search aggregator for OpenClaw agents. Use this skill to (1) install SearXNG on a VPS/server so the agent can search the web without API keys...
通过你的 Agent 添加
安装目录:searxng/(目录名取自 SKILL.md 的 frontmatter name,不是 URL 里的 slug)。
点「快速安装」复制一段指令贴给你的 Agent:它会先下载到 /tmp、把文件清单和校验值给你看,你确认之后才解压安装。不会一步装完、也不改系统其它位置。
或者手动安装
包是「根级 SKILL.md + 作者附带的文件」,解压到上面的 <slug>/ 目录即可;
目录名不用换,也不要把包直接解压到 skills 根目录。
技能申请的权限由作者决定:装之前先看清单里有没有脚本、它会读写什么。
中文使用说明 来自收录源
核心用法
SearXNG 是面向 OpenClaw 代理的自托管搜索聚合方案,核心解决「无 API 密钥下的多引擎搜索」问题。技能覆盖两条主线:(1) 新实例部署 — 通过 install_searxng.sh 在 Ubuntu 22.04/24.04 一键安装,创建 systemd 服务监听 127.0.0.1:8888;(2) 搜索调用 — 使用 search.py CLI 工具执行查询,支持 --json 结构化输出与 --count 结果限制。
显著优点
- 零密钥依赖:聚合 Google、Bing、Brave、Startpage、DuckDuckGo、Wikipedia 等公开引擎,无需注册第三方 API
- 私有化可控:完全自托管,搜索日志与查询数据不经过外部 SaaS 服务商
- 故障降级:当 SearXNG 服务异常时自动回退至 Wikipedia + GitHub API,保障基础可用性
- 轻量集成:单文件
search.py脚本,通过环境变量或硬编码SEARXNG_URL即可适配不同端口
潜在局限与风险
- 运维负担:需自行维护 VPS、处理 IP 封禁、引擎反爬策略变动(如 Google 验证码拦截)
- 结果稳定性:聚合引擎可能因网络或反爬机制间歇性失效,需定期核查
/etc/searxng/settings.yml配置 - 本地化限制:默认仅监听本地回环,跨主机调用需额外配置反向代理或防火墙规则
- 无商业 SLA:依赖社区维护的 searxng/searxng 上游,关键业务场景需自行 fork 维护
适合人群
- 需要离线/内网环境搜索能力的 OpenClaw 部署者
- 对数据隐私敏感、不愿将查询发送至 OpenAI/Bing API 的用户
- 已有 Linux 服务器运维经验、能接受自托管成本的开发者
常规风险
- IP 封禁:高频查询易触发搜索引擎反爬,建议使用住宅代理或降低请求频率
- 配置泄露:
settings.yml中若误启外部监听且无认证,可能导致实例被滥用为公开代理 - 服务单点:systemd 服务异常时依赖自动回退,回退源(Wikipedia/GitHub)覆盖度有限,可能影响任务完成质量
技能正文
name: searxng description: Self-hosted web search aggregator for OpenClaw agents. Use this skill to (1) install SearXNG on a VPS/server so the agent can search the web without API keys, or (2) run web searches using an existing local SearXNG instance. Covers installation, configuration, the search.py CLI tool, and fallback behaviour. Use when the agent needs web search capability, when setting up a new OpenClaw instance, or when diagnosing search failures.
SearXNG
SearXNG is a self-hosted search aggregator that queries Google, Bing, Brave, Startpage, DuckDuckGo, and Wikipedia simultaneously. No API keys required. Results returned as JSON.
Quick start (already installed)
python3 scripts/search.py "your query" # human-readable
python3 scripts/search.py "your query" --json # JSON (for parsing)
python3 scripts/search.py "query" --count 5 --json # limit + JSON
Place search.py anywhere convenient — typically tools/search.py in the workspace.
For detailed usage patterns and service management: see references/usage.md.
Installation (new instance)
Run as root on Ubuntu 22.04/24.04:
bash scripts/install_searxng.sh
This installs SearXNG, creates a searxng system user, writes /etc/searxng/settings.yml, and starts a systemd service on http://127.0.0.1:8888.
Verify:
curl 'http://127.0.0.1:8888/search?q=test&format=json' | python3 -m json.tool | head -20
systemctl status searxng
Connecting search.py to the instance
search.py targets http://127.0.0.1:8888 by default. If the port differs, update SEARXNG_URL at the top of the script.
Fallback
If SearXNG is down, search.py falls back to Wikipedia + GitHub APIs automatically. No action needed — results still return, just from narrower sources.
Troubleshooting
| Symptom | Fix |
|---|---|
[SearXNG unavailable] in stderr |
systemctl restart searxng |
| Port conflict on 8888 | Change port: in /etc/searxng/settings.yml + update SEARXNG_URL in script |
| Empty results from all engines | Check /etc/searxng/settings.yml engines block; restart service |
| Connection refused | Service not running — systemctl start searxng |
正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。