web-search-plus-plugin 1.4.0 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.template +18 -13
- package/README.md +57 -153
- package/index.ts +850 -135
- package/openclaw.plugin.json +1 -2
- package/package.json +33 -4
- package/scripts/search.py +0 -2940
- package/scripts/setup.py +0 -463
package/.env.template
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
#
|
|
2
|
-
SERPER_API_KEY=your-serper-key-here
|
|
1
|
+
# web-search-plus-plugin — add at least one provider key
|
|
3
2
|
|
|
4
|
-
#
|
|
5
|
-
|
|
3
|
+
# Serper (Google Search) — https://serper.dev
|
|
4
|
+
SERPER_API_KEY=
|
|
6
5
|
|
|
7
|
-
#
|
|
8
|
-
|
|
6
|
+
# Tavily (Research Search) — https://tavily.com
|
|
7
|
+
TAVILY_API_KEY=
|
|
9
8
|
|
|
10
9
|
# Exa (Neural/Deep Search) — https://exa.ai
|
|
11
|
-
EXA_API_KEY=
|
|
10
|
+
EXA_API_KEY=
|
|
12
11
|
|
|
13
|
-
#
|
|
14
|
-
|
|
12
|
+
# Querit (Multilingual AI Search) — https://querit.ai
|
|
13
|
+
QUERIT_API_KEY=
|
|
15
14
|
|
|
16
|
-
#
|
|
17
|
-
|
|
15
|
+
# Perplexity (Direct answers) — https://www.perplexity.ai/settings/api
|
|
16
|
+
PERPLEXITY_API_KEY=
|
|
18
17
|
|
|
19
18
|
# You.com — https://api.you.com
|
|
20
|
-
YOU_API_KEY=
|
|
19
|
+
YOU_API_KEY=
|
|
21
20
|
|
|
22
21
|
# SearXNG (self-hosted, no API key needed)
|
|
23
|
-
SEARXNG_INSTANCE_URL=
|
|
22
|
+
SEARXNG_INSTANCE_URL=
|
|
23
|
+
|
|
24
|
+
# Set to 'true' to allow private IPs for SearXNG — disables SSRF protection!
|
|
25
|
+
# SEARXNG_ALLOW_PRIVATE=true
|
|
26
|
+
|
|
27
|
+
# Kilo.ai gateway (alternative Perplexity/other providers route) — https://api.kilo.ai
|
|
28
|
+
KILOCODE_API_KEY=
|
package/README.md
CHANGED
|
@@ -1,181 +1,85 @@
|
|
|
1
|
-
#
|
|
1
|
+
# web-search-plus-plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Multi-provider web search plugin for OpenClaw.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## ✨ Features
|
|
8
|
-
|
|
9
|
-
- **Intelligent auto-routing** — analyzes query intent and picks the best provider automatically
|
|
10
|
-
- **7 search providers** — use one or all, graceful fallback if any is down
|
|
11
|
-
- **Local result caching** — saves API costs on repeated queries
|
|
12
|
-
- **Interactive setup wizard** — guided configuration via `python3 scripts/setup.py`
|
|
13
|
-
- **Native OpenClaw tool** — registers as `web_search_plus`, not a skill
|
|
14
|
-
|
|
15
|
-
## 🔎 Supported Providers
|
|
16
|
-
|
|
17
|
-
| Provider | Best for | Free tier |
|
|
18
|
-
|----------|----------|-----------|
|
|
19
|
-
| **Serper** (Google) | Facts, news, shopping, local businesses | 2,500 queries/month |
|
|
20
|
-
| **Tavily** | Deep research, analysis, explanations | 1,000 queries/month |
|
|
21
|
-
| **Querit** | Multi-lingual AI search with rich metadata and real-time info | 1,000 queries/month |
|
|
22
|
-
| **Exa** (Neural) | Semantic discovery, finding similar content | 1,000 queries/month |
|
|
23
|
-
| **Perplexity** | AI-synthesized answers with citations | Via API key |
|
|
24
|
-
| **You.com** | Real-time RAG, LLM-ready snippets | Limited free tier |
|
|
25
|
-
| **SearXNG** | Privacy-first, self-hosted, $0 cost | Free (self-hosted) |
|
|
26
|
-
|
|
27
|
-
## 🧠 Auto-Routing Examples
|
|
28
|
-
|
|
29
|
-
The plugin analyzes your query and picks the best provider:
|
|
30
|
-
|
|
31
|
-
| Query | Routed to | Why |
|
|
32
|
-
|-------|-----------|-----|
|
|
33
|
-
| "iPhone 16 Pro price" | Serper | Shopping intent detected |
|
|
34
|
-
| "how does TCP/IP work" | Tavily | Research/explanation intent |
|
|
35
|
-
| "latest multilingual EV market updates" | Querit | Real-time AI search with metadata-rich results |
|
|
36
|
-
| "companies like Stripe" | Exa | Discovery/semantic intent |
|
|
37
|
-
| "what is quantum computing" | Perplexity | Direct answer intent |
|
|
38
|
-
| "latest news AI regulation" | Serper | News intent |
|
|
39
|
-
|
|
40
|
-
You can always override with `provider: "tavily"` (or any other) to force a specific provider.
|
|
41
|
-
|
|
42
|
-
## 📦 Installation
|
|
43
|
-
|
|
44
|
-
### Option 1: npm
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
npm install web-search-plus-plugin
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Option 2: Clone
|
|
5
|
+
## Install
|
|
51
6
|
|
|
52
7
|
```bash
|
|
53
|
-
|
|
8
|
+
openclaw plugins install clawhub:web-search-plus-plugin
|
|
54
9
|
```
|
|
55
10
|
|
|
56
|
-
|
|
11
|
+
It registers a `web_search_plus` tool that can query multiple providers and auto-route to the one that best fits the query.
|
|
57
12
|
|
|
58
|
-
|
|
59
|
-
cp .env.template .env
|
|
60
|
-
# Edit .env and add your API keys (at least one required)
|
|
61
|
-
```
|
|
13
|
+
## Why use this instead of OpenClaw's built-in `web_search`?
|
|
62
14
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```json
|
|
66
|
-
{
|
|
67
|
-
"plugins": {
|
|
68
|
-
"load": {
|
|
69
|
-
"paths": [
|
|
70
|
-
"./node_modules/web-search-plus-plugin"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"entries": {
|
|
74
|
-
"web-search-plus-plugin": {
|
|
75
|
-
"enabled": true
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
```
|
|
15
|
+
OpenClaw's built-in `web_search` uses Brave Search.
|
|
81
16
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
Copy `.env.template` to `.env` and add at least one API key:
|
|
87
|
-
|
|
88
|
-
| Variable | Provider | Sign up |
|
|
89
|
-
|----------|----------|---------|
|
|
90
|
-
| `SERPER_API_KEY` | Serper (Google) | [console.serper.dev](https://console.serper.dev) |
|
|
91
|
-
| `TAVILY_API_KEY` | Tavily | [tavily.com](https://tavily.com) |
|
|
92
|
-
| `QUERIT_API_KEY` | Querit | [querit.ai](https://querit.ai) |
|
|
93
|
-
| `EXA_API_KEY` | Exa | [exa.ai](https://exa.ai) |
|
|
94
|
-
| `PERPLEXITY_API_KEY` | Perplexity | [perplexity.ai](https://docs.perplexity.ai) |
|
|
95
|
-
| `KILOCODE_API_KEY` | Perplexity via Kilo | [kilocode.ai](https://kilocode.ai) |
|
|
96
|
-
| `YOU_API_KEY` | You.com | [you.com/api](https://you.com/api) |
|
|
97
|
-
| `SEARXNG_URL` | SearXNG (self-hosted) | [docs.searxng.org](https://docs.searxng.org) |
|
|
98
|
-
|
|
99
|
-
## 🤖 Enable for an Agent
|
|
100
|
-
|
|
101
|
-
Allow the tool in your agent config:
|
|
102
|
-
|
|
103
|
-
```json
|
|
104
|
-
{
|
|
105
|
-
"agents": {
|
|
106
|
-
"list": [
|
|
107
|
-
{
|
|
108
|
-
"name": "my-agent",
|
|
109
|
-
"tools": {
|
|
110
|
-
"allow": ["web_search_plus"]
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
```
|
|
17
|
+
You might want this plugin when:
|
|
18
|
+
- Brave returns thin or no results for a query, but Serper/Google or You.com still finds relevant pages.
|
|
19
|
+
- You want research-oriented output; Tavily can return structured results that are easier to summarize.
|
|
20
|
+
- You want semantic discovery; Exa can find related content that plain keyword search may miss.
|
|
117
21
|
|
|
118
|
-
|
|
22
|
+
Supported providers:
|
|
23
|
+
- Serper (Google)
|
|
24
|
+
- Tavily
|
|
25
|
+
- Exa
|
|
26
|
+
- Querit
|
|
27
|
+
- Perplexity
|
|
28
|
+
- You.com
|
|
29
|
+
- SearXNG
|
|
119
30
|
|
|
120
|
-
|
|
31
|
+
## What you need
|
|
121
32
|
|
|
122
|
-
|
|
123
|
-
|-----------|------|----------|-------------|
|
|
124
|
-
| `query` | string | ✅ | Search query |
|
|
125
|
-
| `provider` | string | ❌ | Force a provider: `serper`, `tavily`, `querit`, `exa`, `perplexity`, `you`, `searxng`, or `auto` (default) |
|
|
126
|
-
| `count` | number | ❌ | Number of results (default: 5) |
|
|
33
|
+
You do not need every provider.
|
|
127
34
|
|
|
128
|
-
|
|
35
|
+
You need at least one configured provider:
|
|
36
|
+
- an API key for any hosted provider, or
|
|
37
|
+
- a SearXNG instance URL
|
|
129
38
|
|
|
130
|
-
|
|
39
|
+
## Quick setup
|
|
131
40
|
|
|
132
41
|
```bash
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
# Force a specific provider
|
|
137
|
-
python3 scripts/search.py -q "your query" -p tavily
|
|
138
|
-
|
|
139
|
-
# More results
|
|
140
|
-
python3 scripts/search.py -q "your query" --max-results 10
|
|
42
|
+
cp .env.template .env
|
|
43
|
+
# add at least one API key or SearXNG URL
|
|
141
44
|
```
|
|
142
45
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
### Do I need all 7 providers?
|
|
146
|
-
No. The plugin works with just one API key. Configure whichever providers you have — the auto-router will use what's available and skip what's not.
|
|
147
|
-
|
|
148
|
-
### What's the difference between this plugin and the `web-search-plus` skill?
|
|
149
|
-
The **plugin** registers a native tool that any agent can use directly. The **skill** provides a SKILL.md with instructions for the agent. Both use the same search backend. Use the plugin for cleaner integration — it's the recommended approach.
|
|
150
|
-
|
|
151
|
-
### Do I need Python?
|
|
152
|
-
Yes, Python 3 is required. The search logic runs as a Python script. Most Linux servers and macOS have Python 3 pre-installed.
|
|
153
|
-
|
|
154
|
-
### How does auto-routing work?
|
|
155
|
-
The router scores each provider based on query signals — keywords like "price" or "buy" boost Serper, deep explanation queries boost Tavily, multilingual or metadata-rich real-time search can favor Querit, semantic/discovery queries boost Exa, and direct questions boost Perplexity. The highest-scoring provider wins.
|
|
46
|
+
Then load the plugin in OpenClaw and restart the gateway.
|
|
156
47
|
|
|
157
|
-
|
|
158
|
-
Yes. Results are cached locally in a `.cache/` directory inside the plugin folder. Identical queries return cached results instantly and don't consume API credits. Cache is file-based and survives restarts.
|
|
48
|
+
## Provider overview
|
|
159
49
|
|
|
160
|
-
|
|
161
|
-
|
|
50
|
+
| Provider | Best for | Free tier | Rate limit (free) |
|
|
51
|
+
| --- | --- | --- | --- |
|
|
52
|
+
| Serper | Google-style general web, news, shopping, local results | Yes | 2,500/mo |
|
|
53
|
+
| Tavily | Research-style results and summaries | Yes | 1,000/mo |
|
|
54
|
+
| Exa | Semantic / neural discovery | Yes | 1,000/mo |
|
|
55
|
+
| Querit | Multilingual and regional search | Yes | Varies |
|
|
56
|
+
| Perplexity | Answer-style web results with citations | Limited / depends on plan | API credits required |
|
|
57
|
+
| You.com | General web + answer-oriented results | Limited | 60 req/hr |
|
|
58
|
+
| SearXNG | Self-hosted metasearch | Yes, self-hosted | Self-hosted, unlimited |
|
|
162
59
|
|
|
163
|
-
|
|
164
|
-
SearXNG is a self-hosted meta search engine that aggregates 70+ sources. It's free but requires your own instance. The plugin validates the instance URL on setup and includes SSRF protection for security.
|
|
60
|
+
## Auto-routing logic
|
|
165
61
|
|
|
166
|
-
|
|
167
|
-
Yes, as long as the tool is allowed in the agent's tool config. The plugin runs on the host alongside the gateway.
|
|
62
|
+
The plugin scores each query against the providers you have configured and picks the best match for that query type. If the first choice is unavailable or fails, it falls back to another configured provider instead of failing immediately.
|
|
168
63
|
|
|
169
|
-
##
|
|
64
|
+
## Notes
|
|
170
65
|
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
66
|
+
- Auto-routing chooses among configured providers only.
|
|
67
|
+
- If a provider is missing credentials, it is skipped.
|
|
68
|
+
- SearXNG includes SSRF protection by default.
|
|
69
|
+
- `SEARXNG_ALLOW_PRIVATE=true` disables that protection and should only be used on trusted private networks.
|
|
174
70
|
|
|
175
|
-
##
|
|
71
|
+
## Environment variables
|
|
176
72
|
|
|
177
|
-
|
|
73
|
+
- `SERPER_API_KEY`
|
|
74
|
+
- `TAVILY_API_KEY`
|
|
75
|
+
- `EXA_API_KEY`
|
|
76
|
+
- `QUERIT_API_KEY`
|
|
77
|
+
- `PERPLEXITY_API_KEY`
|
|
78
|
+
- `KILOCODE_API_KEY`
|
|
79
|
+
- `YOU_API_KEY`
|
|
80
|
+
- `SEARXNG_INSTANCE_URL`
|
|
81
|
+
- `SEARXNG_ALLOW_PRIVATE`
|
|
178
82
|
|
|
179
|
-
##
|
|
83
|
+
## Repository
|
|
180
84
|
|
|
181
|
-
|
|
85
|
+
GitHub: <https://github.com/robbyczgw-cla/web-search-plus-plugin>
|