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 CHANGED
@@ -1,23 +1,28 @@
1
- # Serper (Google Search) https://serper.dev
2
- SERPER_API_KEY=your-serper-key-here
1
+ # web-search-plus-plugin add at least one provider key
3
2
 
4
- # Tavily (Research Search) — https://tavily.com
5
- TAVILY_API_KEY=your-tavily-key-here
3
+ # Serper (Google Search) — https://serper.dev
4
+ SERPER_API_KEY=
6
5
 
7
- # Querit (Multilingual AI Search) — https://querit.ai
8
- QUERIT_API_KEY=your-querit-api-key-here
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=your-exa-key-here
10
+ EXA_API_KEY=
12
11
 
13
- # Perplexity (Direct answers) — https://www.perplexity.ai/settings/api
14
- PERPLEXITY_API_KEY=your-perplexity-key-here
12
+ # Querit (Multilingual AI Search) — https://querit.ai
13
+ QUERIT_API_KEY=
15
14
 
16
- # Kilo Gateway (alternative Perplexity route) — https://api.kilo.ai
17
- KILOCODE_API_KEY=your-kilocode-key-here
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=your-you-api-key-here
19
+ YOU_API_KEY=
21
20
 
22
21
  # SearXNG (self-hosted, no API key needed)
23
- SEARXNG_INSTANCE_URL=https://your-searxng-instance.example.com
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
- # 🔍 web-search-plus-plugin
1
+ # web-search-plus-plugin
2
2
 
3
- **Multi-provider web search as a native OpenClaw tool.**
3
+ Multi-provider web search plugin for OpenClaw.
4
4
 
5
- A standalone OpenClaw plugin that registers `web_search_plus` as a first-class tool with intelligent auto-routing. No skill dependency needed — install, configure, and go.
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
- git clone https://github.com/robbyczgw-cla/web-search-plus-plugin.git
8
+ openclaw plugins install clawhub:web-search-plus-plugin
54
9
  ```
55
10
 
56
- ### Configure API Keys
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
- ```bash
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
- ### Add to OpenClaw Config
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
- Restart your gateway after adding the plugin.
83
-
84
- ## 🔑 Environment Variables
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
- ## 🛠️ Tool Parameters
22
+ Supported providers:
23
+ - Serper (Google)
24
+ - Tavily
25
+ - Exa
26
+ - Querit
27
+ - Perplexity
28
+ - You.com
29
+ - SearXNG
119
30
 
120
- The registered `web_search_plus` tool accepts:
31
+ ## What you need
121
32
 
122
- | Parameter | Type | Required | Description |
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
- ## 🧪 Test Directly
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
- You can test the search script standalone:
39
+ ## Quick setup
131
40
 
132
41
  ```bash
133
- # Auto-route
134
- python3 scripts/search.py -q "your query here"
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
- ## FAQ
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
- ### Does it cache results?
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
- ### Can I use Perplexity through Kilo Gateway?
161
- Yes. Set `KILOCODE_API_KEY` in your `.env` the plugin routes Perplexity requests through the Kilo Gateway automatically. You can also use a direct `PERPLEXITY_API_KEY`.
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
- ### What about SearXNG?
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
- ### Does it work in sandboxed agents?
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
- ## 📋 Requirements
64
+ ## Notes
170
65
 
171
- - **OpenClaw** gateway (any recent version)
172
- - **Python 3** (3.8+)
173
- - At least **one API key** from a supported provider
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
- ## 📄 License
71
+ ## Environment variables
176
72
 
177
- MIT
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
- ## 👤 Maintainer
83
+ ## Repository
180
84
 
181
- **robbyczgw-cla** — [GitHub](https://github.com/robbyczgw-cla)
85
+ GitHub: <https://github.com/robbyczgw-cla/web-search-plus-plugin>