web-search-plus-plugin 1.1.4 โ†’ 1.1.6

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.
Files changed (2) hide show
  1. package/README.md +142 -46
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,82 +1,178 @@
1
- # web-search-plus-plugin โ€” OpenClaw Plugin
1
+ # ๐Ÿ” web-search-plus-plugin
2
2
 
3
- A standalone OpenClaw plugin that exposes `web_search_plus` as a native tool with multi-provider routing.
3
+ **Multi-provider web search as a native OpenClaw tool.**
4
4
 
5
- It bundles its own Python backend script and supports:
6
- - **Serper (Google)** โ€” best for factual/shopping queries
7
- - **Tavily** โ€” best for research & analysis
8
- - **Exa (Neural)** โ€” best for discovery & semantic search
9
- - **Perplexity** โ€” AI-synthesized answers with citations
10
- - **You.com** โ€” real-time web + RAG
11
- - **SearXNG** โ€” self-hosted privacy-first search
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.
12
6
 
13
- The tool auto-routes queries by intent or you can force a specific provider.
7
+ ## โœจ Features
14
8
 
15
- ## What it does
9
+ - **Intelligent auto-routing** โ€” analyzes query intent and picks the best provider automatically
10
+ - **6 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
16
14
 
17
- - Registers native tool: `web_search_plus`
18
- - Runs bundled script at `scripts/search.py`
19
- - Supports:
20
- - `query` (required)
21
- - `provider` (`serper` | `tavily` | `exa` | `perplexity` | `you` | `searxng` | `auto`)
22
- - `count` (result count)
15
+ ## ๐Ÿ”Ž Supported Providers
23
16
 
24
- ## Installation
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
+ | **Exa** (Neural) | Semantic discovery, finding similar content | 1,000 queries/month |
22
+ | **Perplexity** | AI-synthesized answers with citations | Via API key |
23
+ | **You.com** | Real-time RAG, LLM-ready snippets | Limited free tier |
24
+ | **SearXNG** | Privacy-first, self-hosted, $0 cost | Free (self-hosted) |
25
25
 
26
- Add plugin path to `plugins.load.paths` and enable in `plugins.entries`.
26
+ ## ๐Ÿง  Auto-Routing Examples
27
27
 
28
- ### Example OpenClaw config snippet
28
+ The plugin analyzes your query and picks the best provider:
29
+
30
+ | Query | Routed to | Why |
31
+ |-------|-----------|-----|
32
+ | "iPhone 16 Pro price" | Serper | Shopping intent detected |
33
+ | "how does TCP/IP work" | Tavily | Research/explanation intent |
34
+ | "companies like Stripe" | Exa | Discovery/semantic intent |
35
+ | "what is quantum computing" | Perplexity | Direct answer intent |
36
+ | "latest news AI regulation" | Serper | News intent |
37
+
38
+ You can always override with `provider: "tavily"` (or any other) to force a specific provider.
39
+
40
+ ## ๐Ÿ“ฆ Installation
41
+
42
+ ### Option 1: npm
43
+
44
+ ```bash
45
+ npm install web-search-plus-plugin
46
+ ```
47
+
48
+ ### Option 2: Clone
49
+
50
+ ```bash
51
+ git clone https://github.com/robbyczgw-cla/web-search-plus-plugin.git
52
+ ```
53
+
54
+ ### Configure API Keys
55
+
56
+ ```bash
57
+ cp .env.template .env
58
+ # Edit .env and add your API keys (at least one required)
59
+ ```
60
+
61
+ ### Add to OpenClaw Config
29
62
 
30
63
  ```json
31
64
  {
32
65
  "plugins": {
33
66
  "load": {
34
67
  "paths": [
35
- "/path/to/web-search-plus-plugin"
68
+ "./node_modules/web-search-plus-plugin"
36
69
  ]
37
70
  },
38
- "entries": [
39
- {
40
- "id": "web-search-plus-plugin",
71
+ "entries": {
72
+ "web-search-plus-plugin": {
41
73
  "enabled": true
42
74
  }
43
- ]
75
+ }
44
76
  }
45
77
  }
46
78
  ```
47
79
 
48
- ## Environment variables
80
+ Restart your gateway after adding the plugin.
49
81
 
50
- Copy `.env.template` to `.env` and add your API keys.
82
+ ## ๐Ÿ”‘ Environment Variables
51
83
 
52
- At least one provider key is required:
53
- - `SERPER_API_KEY` โ€” [console.serper.dev](https://console.serper.dev)
54
- - `TAVILY_API_KEY` โ€” [tavily.com](https://tavily.com)
55
- - `EXA_API_KEY` โ€” [exa.ai](https://exa.ai)
56
- - `KILOCODE_API_KEY` or `PERPLEXITY_API_KEY` โ€” [perplexity.ai](https://docs.perplexity.ai) (optional, also works via [Kilo Gateway](https://kilocode.ai))
57
- - `YOU_API_KEY` โ€” [you.com/api](https://you.com/api) (optional)
58
- - `SEARXNG_URL` โ€” your SearXNG instance URL (optional, self-hosted)
84
+ Copy `.env.template` to `.env` and add at least one API key:
59
85
 
60
- ## Enable for an agent
86
+ | Variable | Provider | Sign up |
87
+ |----------|----------|---------|
88
+ | `SERPER_API_KEY` | Serper (Google) | [console.serper.dev](https://console.serper.dev) |
89
+ | `TAVILY_API_KEY` | Tavily | [tavily.com](https://tavily.com) |
90
+ | `EXA_API_KEY` | Exa | [exa.ai](https://exa.ai) |
91
+ | `PERPLEXITY_API_KEY` | Perplexity | [perplexity.ai](https://docs.perplexity.ai) |
92
+ | `KILOCODE_API_KEY` | Perplexity via Kilo | [kilocode.ai](https://kilocode.ai) |
93
+ | `YOU_API_KEY` | You.com | [you.com/api](https://you.com/api) |
94
+ | `SEARXNG_URL` | SearXNG (self-hosted) | [docs.searxng.org](https://docs.searxng.org) |
61
95
 
62
- Allow the tool in agent config:
96
+ ## ๐Ÿค– Enable for an Agent
97
+
98
+ Allow the tool in your agent config:
63
99
 
64
100
  ```json
65
101
  {
66
102
  "agents": {
67
- "my-agent": {
68
- "tools": {
69
- "allow": [
70
- "web_search_plus"
71
- ]
103
+ "list": [
104
+ {
105
+ "name": "my-agent",
106
+ "tools": {
107
+ "allow": ["web_search_plus"]
108
+ }
72
109
  }
73
- }
110
+ ]
74
111
  }
75
112
  }
76
113
  ```
77
114
 
78
- ## Notes
115
+ ## ๐Ÿ› ๏ธ Tool Parameters
116
+
117
+ The registered `web_search_plus` tool accepts:
118
+
119
+ | Parameter | Type | Required | Description |
120
+ |-----------|------|----------|-------------|
121
+ | `query` | string | โœ… | Search query |
122
+ | `provider` | string | โŒ | Force a provider: `serper`, `tavily`, `exa`, `perplexity`, `you`, `searxng`, or `auto` (default) |
123
+ | `count` | number | โŒ | Number of results (default: 5) |
124
+
125
+ ## ๐Ÿงช Test Directly
126
+
127
+ You can test the search script standalone:
128
+
129
+ ```bash
130
+ # Auto-route
131
+ python3 scripts/search.py -q "your query here"
132
+
133
+ # Force a specific provider
134
+ python3 scripts/search.py -q "your query" -p tavily
135
+
136
+ # More results
137
+ python3 scripts/search.py -q "your query" --max-results 10
138
+ ```
139
+
140
+ ## โ“ FAQ
141
+
142
+ ### Do I need all 6 providers?
143
+ 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.
144
+
145
+ ### What's the difference between this plugin and the `web-search-plus` skill?
146
+ 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.
147
+
148
+ ### Do I need Python?
149
+ Yes, Python 3 is required. The search logic runs as a Python script. Most Linux servers and macOS have Python 3 pre-installed.
150
+
151
+ ### How does auto-routing work?
152
+ The router scores each provider based on query signals โ€” keywords like "price" or "buy" boost Serper, research-oriented queries boost Tavily, semantic/discovery queries boost Exa, and direct questions boost Perplexity. The highest-scoring provider wins.
153
+
154
+ ### Does it cache results?
155
+ 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.
156
+
157
+ ### Can I use Perplexity through Kilo Gateway?
158
+ 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`.
159
+
160
+ ### What about SearXNG?
161
+ 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.
162
+
163
+ ### Does it work in sandboxed agents?
164
+ Yes, as long as the tool is allowed in the agent's tool config. The plugin runs on the host alongside the gateway.
165
+
166
+ ## ๐Ÿ“‹ Requirements
167
+
168
+ - **OpenClaw** gateway (any recent version)
169
+ - **Python 3** (3.8+)
170
+ - At least **one API key** from a supported provider
171
+
172
+ ## ๐Ÿ“„ License
173
+
174
+ MIT
175
+
176
+ ## ๐Ÿ‘ค Maintainer
79
177
 
80
- - Plugin resolves the script path relative to the plugin directory.
81
- - No dependency on external skill paths.
82
- - Publishable as a standalone plugin repository.
178
+ **robbyczgw-cla** โ€” [GitHub](https://github.com/robbyczgw-cla)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-search-plus-plugin",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "description": "OpenClaw plugin: multi-provider web search (Serper/Google, Tavily, Exa, Perplexity) as native tool",
5
5
  "type": "module",
6
6
  "main": "index.ts",