@curio-data/mcp-intelli-search 0.15.0-alpha.0 → 0.16.0
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/README.md +448 -103
- package/dist/{chunk-V6E7CJEW.js → chunk-CMJ2LFUN.js} +531 -259
- package/dist/{chunk-5I6PWQPA.js → chunk-EHXBTGSE.js} +98 -14
- package/dist/cli.js +18 -3
- package/dist/runtime.js +4 -2
- package/dist/server.js +66 -27
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,147 +1,401 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- Generated from the repository README.md by scripts/generate-package-readmes.mjs. Edit the root README.md, then run npm run generate:readmes. -->
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# mcp-intelli-search
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@curio-data/mcp-intelli-search)
|
|
6
|
+
[](https://www.npmjs.com/package/@curio-data/mcp-intelli-search)
|
|
7
|
+
[](https://nodejs.org/)
|
|
8
|
+
[](https://github.com/Curio-Data/pi-intelli-search/blob/main/LICENSE)
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
Intelligent web research for coding agents: search, extract, collate, and cache grounded web context in one tool call.
|
|
12
|
+
|
|
13
|
+
<p align="center">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/01.png" alt="PI-Intelli Search: a five-stage research pipeline diagram arranged in a clockwise cycle. The five labelled stages, each enclosed in a laurel-wreath medallion, are Search (top, depicted as a magnifying glass over an open book), Fetch (right, a hand retrieving a document from shelves), Extract (bottom-right, a distillation apparatus), Collate (bottom-left, stacked books and filing boxes), and Cache & Suggest (left, a treasure chest with an envelope). Copper-coloured arrows connect the stages in sequence. The background is decorated with pen-and-ink botanical and scholarly motifs including quill pens, ink bottles, scrolls, globes, hourglasses, and open books." width="800" />
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
**Features:**
|
|
18
|
+
|
|
19
|
+
- 🔍 **Search:** a search-grounded model, [_Perplexity Sonar_](https://docs.perplexity.ai) via [_OpenRouter_](https://openrouter.ai) by default. One application programming interface (API) key, no $50 minimum. Chat models with tool support also work through the web search server tool; see [native search settings](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#openrouter-web-search-server-tool) or [Model Context Protocol (MCP) tuning](#tuning).
|
|
20
|
+
- 🔗 **Harvest:** provider-supplied citation links recovered from the response, alongside links in the answer. Recognised `url_citation` annotations are merged with text links before pages are selected; recovery is best-effort, not a complete record of sources consulted.
|
|
21
|
+
- 🌐 **Fetch:** Dual-fetch each page (Hypertext Markup Language (HTML) → [_Defuddle_](https://github.com/kepano/defuddle) versus Markdown endpoint), compare quality, pick the cleaner version.
|
|
22
|
+
- 📄 **Extract:** Per-page large language model (LLM) extraction guided by a _focused prompt_. Compresses ≈50K to ≈3-5K chars of query-relevant content.
|
|
23
|
+
- 🔗 **Collate:** Cross-source deduplication, inconsistency detection, and synthesis into a focused ≈5K-character summary.
|
|
24
|
+
- 💾 **Cache:** Persistent `.search/` cache with automatic cache suggest. Related previous searches surfaced on each query.
|
|
25
|
+
- 🎯 **Configurable:** Select models independently for search, extract and collate. The native extension uses registered, authenticated `Pi` models (capability and context limits apply); the MCP server uses explicitly selected OpenRouter models.
|
|
26
|
+
- 💰 **Cost:** see the [default research-run estimate](#cost).
|
|
27
|
+
|
|
28
|
+
`@curio-data/mcp-intelli-search` serves four research tools over the Model Context Protocol (MCP), using standard input/output (stdio). [Install with Claude Code](#claude-code) using the complete example below, or use [_Codex_](https://developers.openai.com/codex/mcp) or another MCP-compatible host.
|
|
29
|
+
|
|
30
|
+
For [`Pi`](https://github.com/earendil-works/pi), the sibling `@curio-data/pi-intelli-search` package registers the same engine natively through `Pi` settings and authentication. See [native installation](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#pi-native-extension).
|
|
31
|
+
|
|
32
|
+
The shared pipeline searches via a search-grounded model ([_Perplexity Sonar_](https://docs.perplexity.ai), the native default) and merges prose links with harvested citations before selecting pages. It fetches pages through a dual-fetch comparison ([_Defuddle_](https://github.com/kepano/defuddle) versus Markdown endpoint), then extracts query-relevant content per page with a dedicated large language model (LLM) guided by a _focused prompt_. Collation deduplicates findings, flags inconsistencies, and synthesises a concise summary. Reports, extractions and fetched content are cached for offline reuse in `.search/` by default. Cache suggest surfaces related previous searches on each query.
|
|
33
|
+
|
|
34
|
+
## Two Packages, One Engine
|
|
35
|
+
|
|
36
|
+
Choose the installation route for the host:
|
|
37
|
+
|
|
38
|
+
| Route | Host | What to Install |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| Native `Pi` Extension | `Pi` | `@curio-data/pi-intelli-search` |
|
|
41
|
+
| Direct MCP Registration | Any MCP-compatible host | `@curio-data/mcp-intelli-search` |
|
|
42
|
+
| Host Plugin | Claude Code or Codex | Repository marketplace launching the pinned MCP package |
|
|
43
|
+
|
|
44
|
+
The install branches: [`Pi` Native Extension](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#pi-native-extension) and [MCP Server](#mcp-server), with host instructions for [Claude Code](#claude-code), [Codex](#codex) and any [Generic MCP Host](#generic-mcp-host).
|
|
45
|
+
|
|
46
|
+
The native extension uses `Pi` settings and authentication. The MCP server requires explicit configuration, a per-folder workspace and an environment-supplied inference key; it does not read `Pi` settings or credentials.
|
|
4
47
|
|
|
5
48
|
## Contents
|
|
6
49
|
|
|
7
|
-
|
|
8
|
-
|
|
50
|
+
<!-- TOC:START -->
|
|
51
|
+
|
|
52
|
+
- [Two Packages, One Engine](#two-packages-one-engine)
|
|
53
|
+
- [Install](#install)
|
|
54
|
+
- [MCP Server](#mcp-server)
|
|
55
|
+
- [MCP Prerequisites](#mcp-prerequisites)
|
|
56
|
+
- [Claude Code](#claude-code)
|
|
57
|
+
- [Claude Code Plugin](#claude-code-plugin)
|
|
58
|
+
- [Codex](#codex)
|
|
59
|
+
- [Generic MCP Host](#generic-mcp-host)
|
|
60
|
+
- [Tools](#tools)
|
|
61
|
+
- [Evidence and Provenance](#evidence-and-provenance)
|
|
62
|
+
- [Usage Examples](#usage-examples)
|
|
63
|
+
- [Quick Search](#quick-search)
|
|
64
|
+
- [Deep Research](#deep-research)
|
|
65
|
+
- [Targeted Research With Domain Guidance](#targeted-research-with-domain-guidance)
|
|
66
|
+
- [Comparing Options](#comparing-options)
|
|
67
|
+
- [Pipeline](#pipeline)
|
|
68
|
+
- [Cost](#cost)
|
|
69
|
+
- [MCP Server Reference](#mcp-server-reference)
|
|
70
|
+
- [Requirements](#requirements)
|
|
9
71
|
- [Verification](#verification)
|
|
10
|
-
- [Serving the Protocol](#serving-the-protocol)
|
|
11
|
-
- [Configuration](#configuration)
|
|
12
|
-
|
|
13
|
-
- [Direct Engine Verification](#direct-engine-verification)
|
|
14
|
-
- [Filesystem and Privacy Boundaries](#filesystem-and-privacy-boundaries)
|
|
15
|
-
- [Timeouts and Troubleshooting](#timeouts-and-troubleshooting)
|
|
16
|
-
- [
|
|
72
|
+
- [Serving the Protocol](#serving-the-protocol)
|
|
73
|
+
- [Configuration](#configuration)
|
|
74
|
+
- [Tuning](#tuning)
|
|
75
|
+
- [Direct Engine Verification](#direct-engine-verification)
|
|
76
|
+
- [Filesystem and Privacy Boundaries](#filesystem-and-privacy-boundaries)
|
|
77
|
+
- [Timeouts and Troubleshooting](#timeouts-and-troubleshooting)
|
|
78
|
+
- [Cache Structure](#cache-structure)
|
|
79
|
+
- [Compatibility](#compatibility)
|
|
80
|
+
- [MCP Server Compatibility](#mcp-server-compatibility)
|
|
81
|
+
- [Documentation](#documentation)
|
|
82
|
+
- [Downloads](#downloads)
|
|
83
|
+
- [Sponsor](#sponsor)
|
|
84
|
+
- [Licence](#licence)
|
|
85
|
+
- [Use of Large Language Models](#use-of-large-language-models)
|
|
17
86
|
|
|
18
|
-
|
|
87
|
+
<!-- TOC:END -->
|
|
19
88
|
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
- An explicitly selected JSON (JavaScript Object Notation) configuration file.
|
|
23
|
-
- A separately billed OpenRouter API (application programming interface) key supplied through a named environment variable before constructing the runtime. Restart the runtime after changing credentials; it snapshots the environment.
|
|
24
|
-
- A platform supported by [`wreq-js`](https://github.com/sqdshguy/wreq-js), the browser-fingerprint fetch dependency. The installation gate exercises its native assets on the running platform; it does not establish support for other platforms.
|
|
89
|
+
<a id="use-with-other-hosts"></a>
|
|
90
|
+
## Install
|
|
25
91
|
|
|
26
|
-
|
|
92
|
+
### MCP Server
|
|
93
|
+
|
|
94
|
+
`@curio-data/mcp-intelli-search` serves the four research tools over stdio. The Claude Code example below covers configuration, credentials, registration and verification in one sequence. Host plugins and generic registration follow as alternatives; install only one route in a host to avoid duplicate tool sets.
|
|
95
|
+
|
|
96
|
+
#### MCP Prerequisites
|
|
97
|
+
|
|
98
|
+
- [_Node.js_](https://nodejs.org/) 22 or later, with `node` and `npx` on `PATH`.
|
|
99
|
+
- [_Claude Code_](https://code.claude.com/docs/en/overview) installed for the example below.
|
|
100
|
+
- An [OpenRouter API key](https://openrouter.ai/keys) with credit for inference. One key covers all three model roles; charges are separate from the host subscription.
|
|
101
|
+
- An existing project folder for the research cache. The server and host must be able to read the same filesystem.
|
|
102
|
+
|
|
103
|
+
The server requires an explicit JavaScript Object Notation (JSON) configuration and absolute workspace path. It reads no host credential stores, `Pi` settings or discovered project configuration. Native fetch assets are verified on _Linux_ x86-64; _macOS_ and _Windows_ are not verified. See [Compatibility](#mcp-server-compatibility) for the recorded scope.
|
|
104
|
+
|
|
105
|
+
#### Claude Code
|
|
106
|
+
|
|
107
|
+
Run the following steps from the project folder in a [_Bash_](https://www.gnu.org/software/bash/) shell. Direct registration is private to the operator and active only in that folder.
|
|
108
|
+
|
|
109
|
+
##### Create the Configuration
|
|
27
110
|
|
|
28
|
-
|
|
111
|
+
Save this as `.intelli-search.json` in the project folder:
|
|
112
|
+
|
|
113
|
+
```json
|
|
114
|
+
{
|
|
115
|
+
"providers": {
|
|
116
|
+
"openrouter": {
|
|
117
|
+
"apiKeyEnv": "OPENROUTER_API_KEY"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"models": {
|
|
121
|
+
"search": {
|
|
122
|
+
"provider": "openrouter",
|
|
123
|
+
"model": "perplexity/sonar"
|
|
124
|
+
},
|
|
125
|
+
"extract": {
|
|
126
|
+
"provider": "openrouter",
|
|
127
|
+
"model": "minimax/minimax-m3"
|
|
128
|
+
},
|
|
129
|
+
"collate": {
|
|
130
|
+
"provider": "openrouter",
|
|
131
|
+
"model": "minimax/minimax-m3"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
29
136
|
|
|
30
|
-
|
|
137
|
+
These are explicit model selections, not inherited defaults. The configuration contains the credential variable's name, not the key itself. The cache lands in the project folder's `.search/` directory.
|
|
31
138
|
|
|
32
|
-
|
|
139
|
+
##### Supply the API Key
|
|
33
140
|
|
|
34
|
-
|
|
141
|
+
Enter the key at the hidden prompt, rather than writing it into shell history or a configuration file:
|
|
35
142
|
|
|
36
|
-
|
|
143
|
+
```bash
|
|
144
|
+
read -r -s -p 'OpenRouter API key: ' OPENROUTER_API_KEY
|
|
145
|
+
printf '\n'
|
|
146
|
+
export OPENROUTER_API_KEY
|
|
147
|
+
```
|
|
37
148
|
|
|
38
|
-
|
|
149
|
+
The export lasts for this shell session. Launch Claude Code from this shell so its server inherits the key. Repeat this step in a new shell, or use a secret manager to supply the variable. Restart Claude Code after changing the key; the server snapshots credentials at startup.
|
|
39
150
|
|
|
40
|
-
|
|
151
|
+
##### Register the Server
|
|
41
152
|
|
|
42
153
|
```bash
|
|
43
|
-
claude mcp add intelli_search \
|
|
154
|
+
claude mcp add intelli_search --scope local \
|
|
44
155
|
-e "INTELLI_SEARCH_CONFIG=$PWD/.intelli-search.json" \
|
|
45
156
|
-e "INTELLI_SEARCH_WORKSPACE=$PWD" \
|
|
46
157
|
-- npx -y --package @curio-data/mcp-intelli-search \
|
|
47
158
|
mcp-intelli-search
|
|
48
159
|
```
|
|
49
160
|
|
|
50
|
-
Append `@<version>` to the package name to pin a release.
|
|
161
|
+
`npx` downloads the package on first use; no separate package installation is required. Append `@<version>` to the package name to pin a release. The command records absolute paths for this folder. Replace `--scope local` with `--scope project` only to share registration through `.mcp.json`; project-scoped servers require approval, and those paths must exist on each operator's machine. Never put the API key in that file.
|
|
51
162
|
|
|
52
|
-
|
|
163
|
+
##### Verify the Connection
|
|
53
164
|
|
|
54
|
-
|
|
165
|
+
Validate the configuration and workspace:
|
|
55
166
|
|
|
56
167
|
```bash
|
|
57
|
-
|
|
168
|
+
npx -y --package @curio-data/mcp-intelli-search \
|
|
169
|
+
mcp-intelli-search \
|
|
170
|
+
--config "$PWD/.intelli-search.json" \
|
|
171
|
+
--workspace "$PWD" \
|
|
172
|
+
--check-config
|
|
58
173
|
```
|
|
59
174
|
|
|
60
|
-
|
|
175
|
+
A successful check prints `Configuration is valid.` and exits with status `0`. This check requires no credentials and performs no inference; it does not test model access.
|
|
176
|
+
|
|
177
|
+
Check the registered server, then start a session from the same shell:
|
|
61
178
|
|
|
62
179
|
```bash
|
|
63
|
-
claude mcp
|
|
64
|
-
|
|
65
|
-
-e "INTELLI_SEARCH_WORKSPACE=$PWD" \
|
|
66
|
-
-- node /absolute/path/to/pi-intelli-search/packages/mcp/dist/cli.js
|
|
180
|
+
claude mcp list
|
|
181
|
+
claude
|
|
67
182
|
```
|
|
68
183
|
|
|
69
|
-
|
|
184
|
+
Confirm `intelli_search` shows as connected. In the session, run `/mcp` to inspect its four tools: `intelli_search`, `intelli_extract`, `intelli_collate` and `intelli_research`. To test inference, ask: “Use intelli_search to find the current TypeScript release and cite the official source.” This call incurs OpenRouter charges. A successful answer with sources verifies inference separately from the connection check.
|
|
185
|
+
|
|
186
|
+
##### Customise the Server
|
|
70
187
|
|
|
71
|
-
|
|
188
|
+
Change the model selections in `.intelli-search.json`, or add an optional `tuning` object alongside `providers` and `models`. For example, `"tuning": { "defaultUrls": 6, "maxUrls": 6 }` limits research to six pages. Restart the host after changes. See [Configuration](#configuration) and [Tuning](#tuning) for the full reference.
|
|
189
|
+
|
|
190
|
+
<a id="route-b-claude-code-plugin"></a>
|
|
191
|
+
#### Claude Code Plugin
|
|
192
|
+
|
|
193
|
+
The [Claude Code plugin](https://code.claude.com/docs/en/plugins) bundles the server registration and an agent-facing research skill. Use it instead of direct registration:
|
|
72
194
|
|
|
73
195
|
```bash
|
|
74
|
-
claude
|
|
196
|
+
claude plugin marketplace add Curio-Data/pi-intelli-search
|
|
197
|
+
claude plugin install intelli-search@curio-data-plugins
|
|
75
198
|
```
|
|
76
199
|
|
|
77
|
-
|
|
200
|
+
Set the required `openrouter_api_key` option through `/plugin` → Installed → `intelli-search` → Configure. Claude Code stores it in its credential store and withholds the server until it is set. Unlike direct registration, this plugin ignores an exported `OPENROUTER_API_KEY`: the plugin option supplies that variable.
|
|
78
201
|
|
|
79
|
-
|
|
202
|
+
Create the plugin data directory:
|
|
80
203
|
|
|
81
204
|
```bash
|
|
82
|
-
|
|
83
|
-
INTELLI_SEARCH_WORKSPACE="$PWD" \
|
|
84
|
-
npx -y --package @curio-data/mcp-intelli-search \
|
|
85
|
-
mcp-intelli-search --check-config
|
|
205
|
+
mkdir -p "${CLAUDE_CONFIG_DIR:-$HOME/.claude}/plugins/data/intelli-search-curio-data-plugins"
|
|
86
206
|
```
|
|
87
207
|
|
|
88
|
-
|
|
208
|
+
Save the same [minimal configuration](#create-the-configuration) as `config.json` in that directory. It persists across plugin updates but is removed on uninstall. The launcher uses the opened project as its workspace, so each project's cache stays in its own `.search/` directory.
|
|
209
|
+
|
|
210
|
+
Restart Claude Code, then run `claude mcp list` and confirm `plugin:intelli-search:intelli_search` shows as connected. The launcher downloads a pinned package through `npx` on first start. Run `/intelli-search:intelli-search` for the skill with this host's paths substituted. Do not use `claude plugin install --config openrouter_api_key=...`: that exposes the key in process arguments. Then request a quick search through the server and confirm a model-visible answer with sources; connection alone does not verify inference. The installed `intelli-search` skill includes shell-based credential setup and troubleshooting; the [compatibility matrix](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#host-plugins) records tested host versions.
|
|
211
|
+
|
|
212
|
+
<a id="route-c-codex-plugin"></a>
|
|
213
|
+
#### Codex
|
|
214
|
+
|
|
215
|
+
The [Codex plugin](https://developers.openai.com/codex/plugins) installs from the same repository marketplace:
|
|
89
216
|
|
|
90
217
|
```bash
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
218
|
+
codex plugin marketplace add Curio-Data/pi-intelli-search
|
|
219
|
+
codex plugin add intelli-search --marketplace curio-data-plugins
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
Save the [minimal configuration](#create-the-configuration) as `.intelli-search.json` in the project folder and [supply the API key](#supply-the-api-key). From that folder, export the paths before launching Codex:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
export INTELLI_SEARCH_CONFIG="$PWD/.intelli-search.json"
|
|
226
|
+
export INTELLI_SEARCH_WORKSPACE="$PWD"
|
|
227
|
+
codex
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
In the session, ask: “Use intelli_search to find the current TypeScript release and cite the official source.” Confirm a successful MCP tool call and an answer with sources. `codex mcp list` alone does not start the server or prove inference. If the tools are unavailable, the setup is incomplete: an answer from the host's own web search does not show that this server ran.
|
|
231
|
+
|
|
232
|
+
Codex filters the server environment; the plugin forwards `OPENROUTER_API_KEY`, `INTELLI_SEARCH_CONFIG` and `INTELLI_SEARCH_WORKSPACE` explicitly. Set all three before each launch. The installed `intelli-search` skill covers persistent configuration and unattended tool approval; see the [compatibility matrix](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#host-plugins) for verified host behaviour.
|
|
233
|
+
|
|
234
|
+
<a id="route-a-direct-mcp-configuration"></a>
|
|
235
|
+
#### Generic MCP Host
|
|
236
|
+
|
|
237
|
+
Any stdio host, including [_Open Code_](https://opencode.ai/docs/mcp-servers/), can register the server directly. Save the [minimal configuration](#create-the-configuration) to a readable file and adapt this registration JSON to the host's format:
|
|
238
|
+
|
|
239
|
+
```json
|
|
240
|
+
{
|
|
241
|
+
"mcpServers": {
|
|
242
|
+
"intelli_search": {
|
|
243
|
+
"command": "npx",
|
|
244
|
+
"args": [
|
|
245
|
+
"-y",
|
|
246
|
+
"--package",
|
|
247
|
+
"@curio-data/mcp-intelli-search",
|
|
248
|
+
"mcp-intelli-search"
|
|
249
|
+
],
|
|
250
|
+
"env": {
|
|
251
|
+
"INTELLI_SEARCH_CONFIG": "/absolute/config.json",
|
|
252
|
+
"INTELLI_SEARCH_WORKSPACE": "/absolute/workspace"
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
Replace both paths with existing absolute paths. Supply `OPENROUTER_API_KEY` through the host's secret mechanism or inherited environment, not committed configuration. Run the [configuration check](#verify-the-connection) with those paths, then confirm the host connects and lists the four tools. The host reads cached pages with its own file-reading capability.
|
|
260
|
+
|
|
261
|
+
MCP hosts qualify tool names; use the names exposed by the host. The native `Pi` extension and the MCP server are independent installations; enabling both in one agent gives duplicate tool sets, which is not a supported configuration.
|
|
262
|
+
|
|
263
|
+
## Tools
|
|
264
|
+
|
|
265
|
+
Both packages expose these four operations. Start with `intelli_search` for factual questions, latest versions and release dates; use `intelli_research` for multi-page comparisons, detailed analysis or an evidence gap that search leaves unresolved. The names below are native `Pi` tool names and MCP server tool names; MCP hosts add their own callable-name prefixes. Use the names exposed by the host.
|
|
266
|
+
|
|
267
|
+
| Tool | Description |
|
|
268
|
+
| ------------------ | --------------------------------------------------------------------------------------------------- |
|
|
269
|
+
| `intelli_search` | Search the web and return a concise answer with a source list (top `defaultUrls`). |
|
|
270
|
+
| `intelli_extract` | Extract query-relevant content from a web page, preserving code and technical detail verbatim. |
|
|
271
|
+
| `intelli_collate` | Deduplicate and synthesise multiple extractions into a summary. Writes cache. |
|
|
272
|
+
| `intelli_research` | Search, fetch, extract, collate and cache multi-page research in one call. |
|
|
273
|
+
|
|
274
|
+
### Evidence and Provenance
|
|
275
|
+
|
|
276
|
+
Research collation receives only successful, non-empty page extractions, not the search model's summary. Code generates the Source Assessment inventory and cache-file references from the run's evidence manifest. Synthesis uses source IDs such as `[S1]`; unknown IDs, prose URLs absent from the supplied extractions and model-generated numbered cache references fail validation before a report is committed. Cross-links present in extracted text remain content, not additional fetched pages. Fenced, indented and inline code examples remain code, not evidence declarations. These checks establish reference consistency, not factual accuracy.
|
|
277
|
+
|
|
278
|
+
Manual `intelli_collate` labels its evidence as caller-supplied extractions; it does not claim the server fetched those pages. Empty or duplicate source evidence is rejected. The optional `searchSummary` input remains accepted for compatibility but does not supply synthesis evidence. Per-source relevance and contribution ratings are no longer model-generated. Read exact cache paths from the inventory; `Not cached` means no full-page file was supplied.
|
|
279
|
+
|
|
280
|
+
<a id="quick-start"></a>
|
|
281
|
+
## Usage Examples
|
|
282
|
+
|
|
283
|
+
These examples describe tool calls for the agent, not shell commands. MCP hosts add their own tool-name prefixes.
|
|
284
|
+
|
|
285
|
+
### Quick Search
|
|
286
|
+
|
|
287
|
+
```text
|
|
288
|
+
intelli_search(query="TypeScript 5.8 release date")
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### Deep Research
|
|
292
|
+
|
|
293
|
+
Always provide a `focusPrompt`. The extraction LLM works best with specific guidance.
|
|
294
|
+
|
|
295
|
+
```text
|
|
296
|
+
intelli_research(
|
|
297
|
+
query="Svelte 5 runes tutorial examples",
|
|
298
|
+
focusPrompt="Extract the core rune concepts ($state, $derived, $effect), their syntax, and how they replace the old reactive declarations. Include migration patterns from Svelte 4."
|
|
299
|
+
)
|
|
95
300
|
```
|
|
96
301
|
|
|
97
|
-
|
|
302
|
+
### Targeted Research With Domain Guidance
|
|
303
|
+
|
|
304
|
+
```text
|
|
305
|
+
intelli_research(
|
|
306
|
+
query="Cloudflare Workers KV write timeout limits",
|
|
307
|
+
focusPrompt="Extract KV write limits, timeout thresholds, storage limits, and any workarounds for bulk writes. Focus on hard numbers and error messages.",
|
|
308
|
+
maxUrls=3,
|
|
309
|
+
domains=["developers.cloudflare.com"]
|
|
310
|
+
)
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
`domains` guides source selection, it is not a security boundary: the query gains a `site:` expression, and with the web search tool enabled the same domains are also combined with `searchWebSearch.allowedDomains` and sent as an engine filter. The lists are combined, not intersected, and returned uniform resource locators (URLs) are not checked against a local hostname allowlist before fetching. Engine support for allow and exclude lists differs; see [native searchWebSearch keys](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#searchwebsearch-keys) or [MCP tuning](#tuning).
|
|
314
|
+
|
|
315
|
+
### Comparing Options
|
|
316
|
+
|
|
317
|
+
```text
|
|
318
|
+
intelli_research(
|
|
319
|
+
query="Tailwind CSS vs Vanilla Extract comparison 2026",
|
|
320
|
+
focusPrompt="Extract pros/cons, bundle size benchmarks, DX tradeoffs, and migration costs. Note which claims come from official sources vs blog opinions."
|
|
321
|
+
)
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Pipeline
|
|
325
|
+
|
|
326
|
+
<p align="center">
|
|
327
|
+
<img src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/07B.png" alt="Vintage engraving-style infographic titled "INTELLI_RESEARCH: The Five-Stage Pipeline," showing five sequentially linked numbered stages triggered by intelli_research(query): (1) Search: web discovery via Perplexity Sonar, OpenRouter/pi-native auth; (2) Fetch: dual fetch and quality comparison using wreq-js + Defuddle against raw markdown; (3) Extract: per-page parallel LLM extraction, MiniMax M2.7, the native model configuration at the illustration's creation; (4) Collate: deduplication and persistent cache via MiniMax M2.7 (the native configuration at creation), flags conflicts; (5) Cache Suggest: additive stage, LLM judge surfaces related prior searches. Stages are connected by bold arrows; each is illustrated with a period-appropriate vignette (armillary sphere, scrolls, alchemical still, filing cabinet, owl with documents)." width="800" />
|
|
328
|
+
</p>
|
|
329
|
+
|
|
330
|
+
The illustration shows the native pipeline with the model configuration at its creation, including MiniMax M2.7 and `Pi` authentication; it does not show the current defaults or standalone authentication. All model assignments are configurable through [native model settings](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#model-configuration) or [MCP configuration](#configuration); alternative search configurations use the same five-stage pipeline.
|
|
331
|
+
|
|
332
|
+
The search stage merges text links with harvested citation annotations before selecting pages (see [Source Harvesting from Citations](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#source-harvesting-from-citations)). Each page is dual-fetched (HTML via Defuddle versus Markdown endpoint) and scored for quality. Per-page extraction (guided by `focusPrompt`) compresses ≈50K chars to ≈3-5K of query-relevant content before collation, keeping the total context manageable (≈30-50K for 10 pages).
|
|
333
|
+
|
|
334
|
+
Completed runs and the degraded exits recorded in `outcome` (`no-links`, `fetch-failed`, `extraction-failed`) attempt to write a local-only `meta.json` telemetry sidecar into the cache directory (see [Cache Structure](#cache-structure)). Set `"disableTelemetry": true` in the native `pi-intelli-search` namespace or the MCP `tuning` object to suppress it.
|
|
98
335
|
|
|
99
|
-
|
|
336
|
+
See [docs/ARCHITECTURE.md](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/ARCHITECTURE.md) for detailed design decisions.
|
|
100
337
|
|
|
101
|
-
|
|
338
|
+
## Cost
|
|
102
339
|
|
|
103
|
-
|
|
104
|
-
|
|
340
|
+
The estimate below uses the native default models and tuning, also selected in the minimal MCP configuration example. It is a planning estimate based on the recorded September 2026 price basis, not a live tariff check. Both packages incur inference charges on the configured provider account; MCP does not use host subscriptions or credentials.
|
|
341
|
+
|
|
342
|
+
Per research run with the default 10 pages: ≈$0.09
|
|
343
|
+
|
|
344
|
+
| Step | Calls | Cost |
|
|
345
|
+
| ---------------------------------- | --------------------- | --------- |
|
|
346
|
+
| Search (Sonar) | 1 | ≈$0.007 |
|
|
347
|
+
| Fetch (Defuddle + Markdown) | 10 (≤4 concurrent) pairs | $0.00 |
|
|
348
|
+
| Extract (M3 via OpenRouter) | 10 (≤4 concurrent) | ≈$0.07 |
|
|
349
|
+
| Collate (M3 via OpenRouter) | 1 | ≈$0.01 |
|
|
350
|
+
| Cache Suggest (M3 via OpenRouter) | 1 | ≈$0.0002 |
|
|
351
|
+
|
|
352
|
+
Since v0.13.0 the search stage adds recovered provider citation URLs to prose links, increasing the candidate source set; `maxUrls` still caps page selection. The ≈$0.09 figure is the planning estimate for a full 10-page research run with the v0.14.0 default models (M3 and M2.7 had equal per-token prices in the recorded benchmark; M3 wrote ≈2× the extraction characters, with the cost estimate separately projecting greater token usage); lower `defaultUrls` to hold earlier spend. Changing the search model or engine also changes the search step's cost; configure it through [native model settings](https://github.com/Curio-Data/pi-intelli-search/blob/main/README.md#choosing-an-alternative-search-configuration) or [MCP configuration](#configuration). The extract and collate rows scale with the selected models.
|
|
353
|
+
|
|
354
|
+
## MCP Server Reference
|
|
355
|
+
|
|
356
|
+
This reference applies to `@curio-data/mcp-intelli-search` only. Installation routes are under [MCP Server](#mcp-server).
|
|
357
|
+
|
|
358
|
+
### Requirements
|
|
359
|
+
|
|
360
|
+
- [_Node.js_](https://nodejs.org/) satisfying the `engines` range in the [standalone manifest](https://github.com/Curio-Data/pi-intelli-search/blob/main/packages/mcp/package.json).
|
|
361
|
+
- An existing, explicitly selected absolute workspace directory.
|
|
362
|
+
- An explicitly selected JSON configuration file.
|
|
363
|
+
- A separately billed OpenRouter API key supplied through a named environment variable before constructing the runtime. Restart the runtime after changing credentials; it snapshots the environment.
|
|
364
|
+
- A platform supported by [_wreq-js_](https://github.com/sqdshguy/wreq-js), the browser-fingerprint fetch dependency. The installation gate exercises its native assets on the running platform; it does not establish support for other platforms.
|
|
365
|
+
|
|
366
|
+
The package neither reads host credential stores nor loads project configuration automatically. Native `Pi` settings, authentication, providers and defaults remain independent.
|
|
367
|
+
|
|
368
|
+
### Verification
|
|
369
|
+
|
|
370
|
+
The [installation example](#verify-the-connection) shows the configuration check, host connection check and first inference call in sequence. These establish different things:
|
|
371
|
+
|
|
372
|
+
| Check | What It Establishes |
|
|
373
|
+
|---|---|
|
|
374
|
+
| `mcp-intelli-search --check-config` with explicit configuration and workspace | Configuration and workspace are valid. Requires no credentials and performs no inference. |
|
|
375
|
+
| Host connection and tool listing | The server starts and completes the MCP connection. Does not establish provider access. |
|
|
376
|
+
| A successful `intelli_search` call with sources | Search inference works with the selected model and credential. Incurs provider charges; does not exercise the full research pipeline. |
|
|
377
|
+
|
|
378
|
+
Use the same configuration and workspace as the registered server. If a project-scoped Claude Code server shows pending approval, open the host in that folder and approve it before checking again.
|
|
379
|
+
|
|
380
|
+
### Serving the Protocol
|
|
381
|
+
|
|
382
|
+
An invocation without `--check-config` validates the explicit workspace, then serves the four canonical tools (`intelli_search`, `intelli_extract`, `intelli_collate`, `intelli_research`) over stdio until the input stream closes. An explicitly selected missing, unreadable or invalid configuration file does not prevent connection: each tool call returns an actionable `CONFIGURATION` error, and the server rereads the file on each call until it loads. Repair the file and call again. Once loaded, configuration remains fixed until restart. Missing launcher arguments and invalid workspaces still fail at startup; `--check-config` remains strict. Serving performs no inference at startup; credentials are only required when an operation runs.
|
|
383
|
+
|
|
384
|
+
- **Registration and Schemas.** Tool names and JSON input schemas mirror the native `Pi` tools verbatim; descriptions adapt the native guidance for protocol clients (host-neutral cache wording, embedded `focusPrompt` and breadth guidance), because the protocol offers no separate guidance channel. Invalid tool arguments are reported as tool errors (`isError` results), matching the software development kit (SDK) distinction between malformed protocol requests and invalid arguments.
|
|
385
|
+
- **Results.** Successful calls return the complete operation text both as text content and as `structuredContent.text`, alongside `outcome` and `details`. Hosts that prefer the structured representation receive the same answer, sources and cache suggestions. The duplication is intentional for host compatibility; a host that forwards both representations can consume extra context. Degraded research (`no-links`, `fetch-failed`, `extraction-failed`) remains a normal result. Execution failures return `isError` results tagged with the safe `StandaloneError` category rather than raw provider causes.
|
|
105
386
|
- **Queueing.** One operation runs at a time and up to eight further requests queue; requests beyond the bound settle immediately with a busy tool error. A queued request whose client cancels settles without starting its operation.
|
|
106
387
|
- **Progress and Cancellation.** When the client supplies a progress token, stage progress is forwarded as `notifications/progress` (percentage of one hundred). Client cancellation aborts the running operation through the shared model policy and stage boundaries.
|
|
107
388
|
- **Shutdown.** Closing standard input aborts in-flight and queued work, closes the transport and exits. `SIGINT` and `SIGTERM` trigger the same drain with a bounded hard-exit backstop. No unanswered request or runaway child work remains.
|
|
108
389
|
- **Framing.** Standard output carries protocol messages only. Before the server module loads, a guard diverts `process.stdout.write` (including console output, import-time writes and direct dependency writes) to standard error; the transport writes frames through the original stream, so the SDK's own output is never corrupted. Adapter diagnostics use standard error.
|
|
109
|
-
- **Annotations.** `intelli_search` and `intelli_extract` are marked read-only; `intelli_collate` and `intelli_research` write cache files and
|
|
390
|
+
- **Annotations.** `intelli_search` and `intelli_extract` are marked read-only; `intelli_collate` and `intelli_research` write cache files and carry `destructiveHint: true` because repeating a query replaces the canonical cache folder's contents (attempting to archive the previous set to a numbered sibling; archive failure falls back to in-place replacement). No tool claims idempotence. Operations use external services; inference and search charges apply to the configured provider account. Invalid calls and startup validation do not perform inference.
|
|
110
391
|
|
|
111
392
|
Startup diagnostics go to standard error. The SDK version range is declared in `package.json` (the lockfile pins the verified release); the protocol implementation is the official split server package verified in the repository handoff.
|
|
112
393
|
|
|
113
|
-
|
|
394
|
+
### Configuration
|
|
114
395
|
|
|
115
396
|
Select the configuration with `--config FILE` or `INTELLI_SEARCH_CONFIG`. Select the workspace with `--workspace ABSOLUTE_DIRECTORY` or `INTELLI_SEARCH_WORKSPACE`. Command-line values take precedence. Relative workspace paths are rejected; existing workspace symlinks are canonicalised.
|
|
116
397
|
|
|
117
|
-
The
|
|
118
|
-
|
|
119
|
-
```json
|
|
120
|
-
{
|
|
121
|
-
"providers": {
|
|
122
|
-
"openrouter": {
|
|
123
|
-
"apiKeyEnv": "OPENROUTER_API_KEY"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"models": {
|
|
127
|
-
"search": {
|
|
128
|
-
"provider": "openrouter",
|
|
129
|
-
"model": "perplexity/sonar"
|
|
130
|
-
},
|
|
131
|
-
"extract": {
|
|
132
|
-
"provider": "openrouter",
|
|
133
|
-
"model": "minimax/minimax-m3"
|
|
134
|
-
},
|
|
135
|
-
"collate": {
|
|
136
|
-
"provider": "openrouter",
|
|
137
|
-
"model": "minimax/minimax-m3"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"tuning": {
|
|
141
|
-
"cacheDir": ".search"
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
```
|
|
398
|
+
The [minimal configuration](#create-the-configuration) explicitly selects OpenRouter for every role; add an optional `tuning` object (for example `"cacheDir": ".search"`) beside `providers` and `models`. These are example selections, not standalone defaults.
|
|
145
399
|
|
|
146
400
|
Only `providers`, `models` and optional `tuning` are accepted at the top level. All three model roles are required. The provider object accepts only `apiKeyEnv`, an environment-variable name rather than a key value. The initial provider scope is OpenRouter at its fixed `https://openrouter.ai/api/v1` endpoint; custom endpoints, proxy settings, provider fallback and dynamic router model identifiers are not accepted.
|
|
147
401
|
|
|
@@ -149,9 +403,9 @@ Configuration loading does not require working credentials. Each operation valid
|
|
|
149
403
|
|
|
150
404
|
Search requires either `perplexity/sonar`, `perplexity/sonar-pro`, `perplexity/sonar-pro-search`, or an explicitly enabled `searchWebSearch` block with a chat model. Enabling `searchWebSearch` also requires the selected model to advertise `tools` support. Combining that block with a Sonar model that does not advertise tool support fails preflight; the adapter does not silently drop the configured tool. Search tools are model-decided; a valid response can still contain no usable links.
|
|
151
405
|
|
|
152
|
-
|
|
406
|
+
#### Tuning
|
|
153
407
|
|
|
154
|
-
Unspecified tuning comes from the canonical [shared defaults](
|
|
408
|
+
Unspecified tuning comes from the canonical [shared defaults](https://github.com/Curio-Data/pi-intelli-search/blob/main/src/core/defaults.ts), also used by the native adapter. The table gives each default and its effect alongside standalone validation ranges. No provider or model selection is inherited from that module. Unknown keys, invalid types and out-of-range values are rejected rather than silently clamped.
|
|
155
409
|
|
|
156
410
|
| Setting | Default and Effect | Accepted Values |
|
|
157
411
|
|---|---|---|
|
|
@@ -183,9 +437,9 @@ Unspecified tuning comes from the canonical [shared defaults](../../src/core/def
|
|
|
183
437
|
|
|
184
438
|
**Reasoning:** The adapter sends reasoning fields only when the catalogue advertises reasoning support; non-reasoning models receive neither effort nor exclusion fields.
|
|
185
439
|
|
|
186
|
-
**Output Budget:** Empty output after token-budget exhaustion is an error, not a successful extraction.
|
|
440
|
+
**Output Budget:** Empty output after token-budget exhaustion is an error, not a successful extraction. Empty collation is likewise rejected before a completed report is written. When these diagnostics occur, increase `collationMaxTokens`, lower reasoning effort, or choose a model with a smaller reasoning budget.
|
|
187
441
|
|
|
188
|
-
|
|
442
|
+
### Direct Engine Verification
|
|
189
443
|
|
|
190
444
|
From the repository root:
|
|
191
445
|
|
|
@@ -195,9 +449,9 @@ npm run test:all
|
|
|
195
449
|
npm run test:mcp:install
|
|
196
450
|
```
|
|
197
451
|
|
|
198
|
-
The installation gate packs the
|
|
452
|
+
The installation gate packs the artefact, installs production dependencies into an isolated directory and denies all ancestor dependency resolution in both module systems. It runs the installed executable's `--help` and `--version`, all four operations with synthetic inference, and actual page fetching against a loopback fixture through the installed native fetch assets. A raw protocol exchange against the installed server verifies initialisation, tool listing, invalid-argument rejection without inference and clean shutdown, and asserts that standard output carries only protocol frames. The deterministic installation gate uses no provider credentials and does not establish live MCP interoperability.
|
|
199
453
|
|
|
200
|
-
The recorded live scenario `test/e2e/11_mcp_stdio.sh` exercises a real research call through the MCP client of an isolated `Pi` profile. Its evidence is recorded separately in the [compatibility matrix](
|
|
454
|
+
The recorded live scenario `test/e2e/11_mcp_stdio.sh` exercises a real research call through the MCP client of an isolated `Pi` profile. Its evidence is recorded separately in the [compatibility matrix](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md), not supplied by the installation gate.
|
|
201
455
|
|
|
202
456
|
The experimental runtime entrypoint supports direct engine verification after installation:
|
|
203
457
|
|
|
@@ -222,17 +476,17 @@ console.log(result.text);
|
|
|
222
476
|
|
|
223
477
|
This example incurs inference and search charges when run with a real credential. `execute()` also accepts `intelli_search`, `intelli_extract` and `intelli_collate`, with the canonical tool parameters. Its optional third argument supplies `signal` and `onProgress`. Results contain `text`, `details` and `outcome`; execution failures throw. Degraded research remains a result. Standalone validation rejects unknown argument keys, empty queries, nonpositive or fractional `maxUrls`, arrays exceeding 100 entries, strings exceeding 2,000,000 characters and unsupported extraction statuses. Native schemas are unchanged. For manual extraction followed by collation, construct each collation item from the original `url` and `title`, `result.details.extraction` and `result.details.sourceType`, plus an explicit `status` such as `success`. Do not forward the entire extraction `details` object: its `currentness` field is not a collation input.
|
|
224
478
|
|
|
225
|
-
`mcp-intelli-search --help` and `--version` need no configuration. `--check-config` validates explicit configuration and workspace syntax without credentials or inference, returning exit status 0 for valid configuration and 1 for invalid input. Neither starts a protocol connection. The runtime entrypoint is experimental and has no published TypeScript declaration contract. Execution failures expose a safe `StandaloneError.code`: `INVALID_ARGUMENTS`, `CONFIGURATION`, `WORKSPACE`, `PROVIDER`, `OPERATION` or `CANCELLED`. Cancellation uses the `AbortError` name. Raw provider causes are deliberately not retained. Some shared operations wrap provider exceptions, which become `OPERATION` errors; protocol mapping must not depend on exact diagnostic strings.
|
|
479
|
+
`mcp-intelli-search --help` and `--version` need no configuration. `--check-config` validates explicit configuration and workspace syntax without credentials or inference, returning exit status 0 for valid configuration and 1 for invalid input. Neither starts a protocol connection. `loadConfig()` throws an exported `ConfigurationError` for file defects, with a `reason` of `missing`, `unreadable`, `invalid-json` or `invalid`; workspace failures remain separate. JSON syntax diagnostics include a location without echoing file contents. The runtime entrypoint is experimental and has no published TypeScript declaration contract. Execution failures expose a safe `StandaloneError.code`: `INVALID_ARGUMENTS`, `CONFIGURATION`, `WORKSPACE`, `PROVIDER`, `OPERATION` or `CANCELLED`. Cancellation uses the `AbortError` name. Raw provider causes are deliberately not retained. Some shared operations wrap provider exceptions, which become `OPERATION` errors; protocol mapping must not depend on exact diagnostic strings.
|
|
226
480
|
|
|
227
|
-
|
|
481
|
+
### Filesystem and Privacy Boundaries
|
|
228
482
|
|
|
229
|
-
All cache paths returned by the standalone adapter are absolute and anchored to the selected workspace. Cache and staging content stay beneath the configured cache directory. Existing symlinks, dangling links and hardlinked files in cache ancestors or
|
|
483
|
+
All cache paths returned by the standalone adapter are absolute and anchored to the selected workspace. Cache and staging content stay beneath the configured cache directory. Existing symlinks, dangling links and hardlinked files in cache ancestors or artefact subtrees are rejected before an operation; checks repeat after model preflight. Special filesystem entries and an oversized safety scan are rejected. The full scan runs at runtime construction and twice per operation, so its cost grows with cache size; queued requests wait behind that scan. At 100,000 inspected entries, select a smaller cache directory or archive old entries after stopping all processes using that cache. Same-query runs on the same Coordinated Universal Time (UTC) date refresh one cache directory. A completed refresh attempts to archive the prior artefacts to a numbered sibling; archive failure is logged and can lead to in-place replacement. A degraded repeat preserves prior successful output. Another UTC date produces a different directory.
|
|
230
484
|
|
|
231
485
|
These checks prevent pre-existing path escapes, not malicious concurrent filesystem replacement by another process with write access. Use a workspace controlled by the same trusted local operator. No operating-system sandbox or protection against hostile same-user mutation is claimed. Fetched URLs are not constrained to public addresses; the runtime is not a hosted service or an unrestricted remote execution endpoint.
|
|
232
486
|
|
|
233
487
|
The host must be able to read the returned paths. Summaries advise using the host's file-reading capability rather than requiring a tool named `read`. Cache formats and local telemetry retain the shared semantics; standalone telemetry adds package and adapter identity. Credentials are never inserted into prompts, cache metadata or generated launch configuration. Adapter diagnostics use standard error and omit raw provider errors, headers and transport exceptions. During operation execution, async-scoped interception replaces dependency stdout console output with a generic logger warning; a regression drives Defuddle's actual conversion-failure handler, which otherwise prints page content. While serving, the startup stdout guard also diverts import-time output and direct dependency writes to standard error; protocol tests assert clean framing with a deliberately noisy fixture.
|
|
234
488
|
|
|
235
|
-
|
|
489
|
+
### Timeouts and Troubleshooting
|
|
236
490
|
|
|
237
491
|
A full research call runs a search stage, up to `maxUrls` dual fetches, up to `maxUrls` extractions, a collation and an optional cache suggestion. Retries can add model calls. Progress notifications are not a guarantee against a host's total request deadline.
|
|
238
492
|
|
|
@@ -245,16 +499,107 @@ Every startup failure is diagnostic-only and lands on standard error; standard o
|
|
|
245
499
|
| Symptom | Cause and Remedy |
|
|
246
500
|
|---|---|
|
|
247
501
|
| `Explicit --config and --workspace are required` | The server started without both selections. Supply `--config`/`--workspace` or the `INTELLI_SEARCH_CONFIG`/`INTELLI_SEARCH_WORKSPACE` environment variables, then restart the host. |
|
|
248
|
-
| `workspace must be an explicit absolute directory` | The workspace selection is relative or a host placeholder was not expanded. Use a literal absolute path; on hosts with placeholder expansion, verify the expansion on
|
|
249
|
-
| `
|
|
250
|
-
| Configuration rejected with an unknown-key or range error | The loader is strict: unknown keys, invalid types and out-of-range values fail validation.
|
|
251
|
-
| Tools never appear in the host |
|
|
252
|
-
|
|
|
253
|
-
|
|
|
502
|
+
| `workspace must be an explicit absolute directory` | The workspace selection is relative or a host placeholder was not expanded. Use a literal absolute path; on hosts with placeholder expansion, verify the expansion on the installed host version. |
|
|
503
|
+
| `Configuration file not found`, `not readable`, `empty` or `not valid JSON` | The selected file is missing or defective. The error names its absolute path; JSON syntax errors include a location without showing file contents. `--check-config` reports the error and exits 1. While serving, repair the file and call again. |
|
|
504
|
+
| Configuration rejected with an unknown-key or range error | The loader is strict: unknown keys, invalid types and out-of-range values fail validation. Correct the configuration and call again if it has not yet loaded. The [Tuning](#tuning) table lists accepted keys and ranges. |
|
|
505
|
+
| Tools never appear in the host | Check absent launcher arguments, an unusable workspace or an unsafe cache. Read the host's MCP server logs for the standard-error diagnostic. Claude Code can cache a startup failure from an older server: try `/mcp` reconnect, then restart ([evidence and limits](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md#claude-code-evidence-and-limits)). A connected server still needs a successful tool call to verify inference. |
|
|
506
|
+
| `CONFIGURATION` persists after the file is repaired | A file that has not yet loaded is reread on the next call; once loaded, configuration changes require a restart. |
|
|
507
|
+
| Diagnostic names a missing credential environment variable | Supply the named variable through the host's supported credential mechanism and restart. The server snapshots credentials at startup. |
|
|
508
|
+
| Catalogue preflight names a model role or capability | Correct the model identifier or required capabilities using [Configuration](#configuration). Read the diagnostic; catalogue lookup failures are not proof of invalid credentials. Restart after changing loaded model selections. |
|
|
509
|
+
| `PROVIDER` reports authentication, access, credit or transport failure | Follow the specific diagnostic: check credentials, model access, account credit or connectivity. Restart after changing credentials. The category alone does not identify a rejected key. |
|
|
510
|
+
| Repeated `429` retries | Tune pacing to observed account/provider limits. For an observed limit of approximately 0.33 requests per second, try `minRequestIntervalMs: 3000` and `extractionConcurrency: 2`; adjust retry attempts as needed. Raise `llmTimeoutMs` only when its model-call timer expires. |
|
|
254
511
|
| Cache paths unreadable from the host | The host must share the server's filesystem. Sandboxed or remote hosts cannot read local cache paths; run the server where the host can read the workspace. |
|
|
255
512
|
|
|
256
|
-
##
|
|
513
|
+
## Cache Structure
|
|
514
|
+
|
|
515
|
+
Both packages write this format. The native extension resolves the cache against the active `Pi` workspace; MCP resolves it against `INTELLI_SEARCH_WORKSPACE` or `--workspace` and keeps it beneath that workspace. See the MCP [filesystem boundaries](#filesystem-and-privacy-boundaries).
|
|
516
|
+
|
|
517
|
+
```text
|
|
518
|
+
.search/
|
|
519
|
+
├── 2026-04-19-d1-worker-api-3f7a2c/
|
|
520
|
+
│ ├── report.md # Synthesis + authoritative source inventory
|
|
521
|
+
│ ├── query.txt # Original search query
|
|
522
|
+
│ ├── meta.json # Local-only telemetry sidecar (v0.11.0+)
|
|
523
|
+
│ ├── extractions/ # Per-page LLM extractions (≈3-5K each)
|
|
524
|
+
│ │ ├── 01-developers-cloudflare-com.md
|
|
525
|
+
│ │ └── 02-developers-cloudflare-com.md
|
|
526
|
+
│ └── sources/ # Full page content
|
|
527
|
+
│ ├── 01-developers-cloudflare-com.md
|
|
528
|
+
│ ├── 02-developers-cloudflare-com.md
|
|
529
|
+
│ └── llms-full-developers-cloudflare-com.md
|
|
530
|
+
└── .index.json # Index of all cached searches
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
Each research run writes a cache entry named `<date>-<slug>-<hash>`. The `<hash>` is six hexadecimal characters from a Secure Hash Algorithm 1 (SHA-1) hash of the full query. It distinguishes queries sharing a readable stem and reduces collision risk; it does not guarantee unique names. Concurrent writers use short cache locks, and index updates are atomic. Cache readers do not take those locks: a multi-file refresh is not a whole-directory atomic snapshot.
|
|
534
|
+
|
|
535
|
+
Refresh behaviour:
|
|
536
|
+
|
|
537
|
+
- A completed same-day refresh attempts to archive the previous report, extractions, numbered sources and telemetry sidecar to a numbered sibling folder (`<slug>.1`, then `.2` and so on) before writing the new set.
|
|
538
|
+
- Archive failure is logged and the completed run can replace canonical files in place; interrupted rotation can leave a partial archive.
|
|
539
|
+
- Supplementary `llms-full-*` documentation downloads stay with the live folder and are not archived.
|
|
540
|
+
- A degraded repeat preserves the earlier successful report, extractions, sources and index entry untouched and records only the failed attempt in `meta.json`.
|
|
541
|
+
- The numbered siblings are a same-day safety net, not a versioned archive: copy a report elsewhere if it must be retained long-term.
|
|
542
|
+
|
|
543
|
+
**Local Telemetry (`meta.json`):** Unless disabled, completed runs and the degraded exits recorded in `outcome` attempt a best-effort sidecar write. Cancellation and thrown failures do not all produce a sidecar. It records the full research query and per-stage outcomes: pages fetched and failed, fetch-variant winners (Defuddle versus Markdown), search retries, cache-suggest hits and latency. `stages.search.annotationsHarvested` counts recovered `url_citation` entries and can be `0` when none are recovered. Historical records or an unreached stage can omit it. It is not a subset of `linksReturned`: harvested citations are merged with prose links before the `maxUrls` clamp, so a run can harvest twenty and report ten links. The sidecar adds no network transmission or credential/account-identifier fields, but the query and metadata can contain personal or confidential information. Ordinary research requests still go to configured external services. The bundled [`scripts/analyze-sessions.sh`](https://github.com/Curio-Data/pi-intelli-search/blob/main/scripts/README.md) can aggregate these sidecars to report per-stage success rates.
|
|
544
|
+
|
|
545
|
+
To suppress the sidecar in the MCP server, set `"disableTelemetry": true` inside the configuration's [`tuning` object](#tuning).
|
|
546
|
+
|
|
547
|
+
## Compatibility
|
|
548
|
+
|
|
549
|
+
### MCP Server Compatibility
|
|
550
|
+
|
|
551
|
+
- Direct stdio registration serves MCP-compatible hosts; repository plugin routes serve Claude Code and Codex. Recorded live research clients include `Pi` and both plugin hosts.
|
|
552
|
+
- The runtime must satisfy the Node.js `engines` range in the [standalone manifest](https://github.com/Curio-Data/pi-intelli-search/blob/main/packages/mcp/package.json). The server uses the [`@modelcontextprotocol/server` SDK](https://github.com/modelcontextprotocol/typescript-sdk), with its dependency range declared in that manifest and the verified release pinned in [package-lock.json](https://github.com/Curio-Data/pi-intelli-search/blob/main/package-lock.json).
|
|
553
|
+
- Standalone fetch assets are verified on _Linux_ x86-64 only; _macOS_ and _Windows_ are not verified.
|
|
554
|
+
- Full research through local-tarball plugins and registry-pin installation checks are separate evidence classes. The compatibility matrix records which checks have run for each artefact; publication alone does not establish host compatibility.
|
|
555
|
+
|
|
556
|
+
For the standalone MCP server and host plugins, including exact tested versions of _Claude Code_, _Codex_, Node.js and the MCP SDK, see [docs/COMPATIBILITY.md](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md).
|
|
557
|
+
|
|
558
|
+
## Documentation
|
|
559
|
+
|
|
560
|
+
- [Comparison](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPARISON.md): How `intelli-search` compares to other `Pi` search extensions and to host-native web search.
|
|
561
|
+
- [Changelog](https://github.com/Curio-Data/pi-intelli-search/blob/main/CHANGELOG.md): Release history.
|
|
562
|
+
- [Architecture](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/ARCHITECTURE.md): Detailed design decisions and pipeline internals.
|
|
563
|
+
- [Compatibility](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPATIBILITY.md): Tested host versions and artefacts for the native extension, MCP server and plugins.
|
|
564
|
+
- [Components](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPONENTS.md): Third-party dependencies and licence attribution.
|
|
565
|
+
- [Claude Code skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/claude-code/skills/intelli-search/SKILL.md) and [Codex skill](https://github.com/Curio-Data/pi-intelli-search/blob/main/plugins/codex/skills/intelli-search/SKILL.md): Host-specific setup and agent-facing usage instructions.
|
|
566
|
+
- [Contributor guide](https://github.com/Curio-Data/pi-intelli-search/blob/main/AGENTS.md): Coding conventions and project structure.
|
|
567
|
+
|
|
568
|
+
## Downloads
|
|
569
|
+
|
|
570
|
+
Weekly npm downloads for both packages, stacked by package and refreshed every Monday by a scheduled GitHub Action. The native extension is the lower segment of each bar and the MCP server is the upper segment. The chart is rendered with [rough.js](https://roughjs.com) from daily caches in `data/downloads.json` and `data/downloads-mcp.json` (see `scripts/plot-downloads.mts`); the caches are append-only with a short trailing re-fetch window so npm's revisions of recent days are picked up. Only complete Monday-to-Sunday weeks are drawn, so a package's segment appears from the first refresh after its first complete week.
|
|
571
|
+
|
|
572
|
+
<p align="center">
|
|
573
|
+
<picture>
|
|
574
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/downloads-dark.svg">
|
|
575
|
+
<img alt="Stacked weekly npm downloads for @curio-data/pi-intelli-search and @curio-data/mcp-intelli-search" src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/downloads-light.svg" width="800" />
|
|
576
|
+
</picture>
|
|
577
|
+
</p>
|
|
578
|
+
|
|
579
|
+
## Sponsor
|
|
580
|
+
|
|
581
|
+
<img src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/sponsor.png" alt="Banner image for "Curio Data Pro." A cartoon robot detective in a deerstalker hat and brown cape peers through binoculars on the left, beside a bordered logo reading "CURIO DATA PRO" in dark red serif type. The background is a stylised steampunk harbour scene featuring a docked submarine, a steam locomotive pulling into a quayside station, gas street lamps, industrial cranes, and brick warehouses under a hazy sky." width="800" />
|
|
582
|
+
|
|
583
|
+
**[Curio Data Pro Ltd](https://blog.curiodata.pro/)** sponsors this project. _Curio Data Pro_ is a data consultancy serving _Rail_, _Naval Design_, _Aviation_, and _Offshore Energy_, combining 20+ years of _Chartered Engineer_ experience with _Data Science_ and _DevOps_ capabilities.
|
|
584
|
+
|
|
585
|
+
[Blog](https://blog.curiodata.pro/) | [LinkedIn](https://www.linkedin.com/company/curio-data-pro-ltd/)
|
|
586
|
+
|
|
587
|
+
<a id="license"></a>
|
|
588
|
+
## Licence
|
|
589
|
+
|
|
590
|
+
Copyright 2026 Ashraf Miah, Curio Data Pro Ltd.
|
|
591
|
+
|
|
592
|
+
Licensed under the [Apache License, Version 2.0](https://github.com/Curio-Data/pi-intelli-search/blob/main/LICENSE).
|
|
593
|
+
|
|
594
|
+
## Use of Large Language Models
|
|
257
595
|
|
|
258
|
-
|
|
596
|
+
Large Language Models were used extensively during the development of this project:
|
|
259
597
|
|
|
260
|
-
|
|
598
|
+
- **`Pi` agent** (primary development environment).
|
|
599
|
+
- **_GLM_ 5.1/5.2/5.3:** Primary model family for code generation and architecture, across successive releases.
|
|
600
|
+
- **_Kimi_ K3:** Code generation, review, and vision-dependent verification.
|
|
601
|
+
- **_MiniMax_ M3:** Adversarial review and analysis.
|
|
602
|
+
- **_Qwen_ 3.8 Max:** Review and deep research.
|
|
603
|
+
- **_DeepSeek_ V4 Pro:** Research and data analysis.
|
|
604
|
+
- **_Qwen_ 3.6 Plus:** Secondary model for review and documentation.
|
|
605
|
+
- **_Claude_ Opus 5.0/5.5:** Primary model for MCP variant.
|