@curio-data/mcp-intelli-search 0.15.0-alpha.0 → 0.15.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 CHANGED
@@ -1,147 +1,395 @@
1
- # Standalone Research Runtime and MCP Server
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
- `@curio-data/mcp-intelli-search` packages the shared `intelli-search` engine without a `Pi` installation. It serves the four research operations as a Model Context Protocol (MCP) server over standard input/output (stdio), with explicit configuration and an [_OpenRouter_](https://openrouter.ai) inference adapter. The runtime entrypoint also executes the operations directly for engine verification. This artifact is not published.
3
+ # mcp-intelli-search
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@curio-data/mcp-intelli-search?color=blue)](https://www.npmjs.com/package/@curio-data/mcp-intelli-search)
6
+ [![npm downloads](https://img.shields.io/npm/dt/@curio-data/mcp-intelli-search?color=blue)](https://www.npmjs.com/package/@curio-data/mcp-intelli-search)
7
+ [![node](https://img.shields.io/badge/node-%E2%89%A522-blue)](https://nodejs.org/)
8
+ [![license](https://img.shields.io/badge/license-Apache--2.0-green)](https://github.com/Curio-Data/pi-intelli-search/blob/main/LICENSE)
9
+ ![tests](https://img.shields.io/badge/test%3Aall-580%20passing-brightgreen)
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 &amp; 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
- - [Requirements](#requirements)
8
- - [Direct Registration](#direct-registration)
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
+ - [Usage Examples](#usage-examples)
62
+ - [Quick Search](#quick-search)
63
+ - [Deep Research](#deep-research)
64
+ - [Targeted Research With Domain Guidance](#targeted-research-with-domain-guidance)
65
+ - [Comparing Options](#comparing-options)
66
+ - [Pipeline](#pipeline)
67
+ - [Cost](#cost)
68
+ - [MCP Server Reference](#mcp-server-reference)
69
+ - [Requirements](#requirements)
9
70
  - [Verification](#verification)
10
- - [Serving the Protocol](#serving-the-protocol)
11
- - [Configuration](#configuration)
12
- - [Tuning](#tuning)
13
- - [Direct Engine Verification](#direct-engine-verification)
14
- - [Filesystem and Privacy Boundaries](#filesystem-and-privacy-boundaries)
15
- - [Timeouts and Troubleshooting](#timeouts-and-troubleshooting)
16
- - [Host Plugins](#host-plugins)
71
+ - [Serving the Protocol](#serving-the-protocol)
72
+ - [Configuration](#configuration)
73
+ - [Tuning](#tuning)
74
+ - [Direct Engine Verification](#direct-engine-verification)
75
+ - [Filesystem and Privacy Boundaries](#filesystem-and-privacy-boundaries)
76
+ - [Timeouts and Troubleshooting](#timeouts-and-troubleshooting)
77
+ - [Cache Structure](#cache-structure)
78
+ - [Compatibility](#compatibility)
79
+ - [MCP Server Compatibility](#mcp-server-compatibility)
80
+ - [Documentation](#documentation)
81
+ - [Downloads](#downloads)
82
+ - [MCP Server Downloads](#mcp-server-downloads)
83
+ - [Sponsor](#sponsor)
84
+ - [Licence](#licence)
85
+ - [Use of Large Language Models](#use-of-large-language-models)
17
86
 
18
- ## Requirements
87
+ <!-- TOC:END -->
19
88
 
20
- - [_Node.js_](https://nodejs.org/) satisfying the `engines` range in `package.json`.
21
- - An existing, explicitly selected absolute workspace directory.
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
- The package neither reads host credential stores nor loads project configuration automatically. Native `Pi` settings, authentication, providers and defaults remain independent.
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.
27
95
 
28
- ## Direct Registration
96
+ #### MCP Prerequisites
29
97
 
30
- Register the server directly with any MCP-compatible host that launches stdio processes. The executable is `mcp-intelli-search`. The following folder-scoped commands use [_Claude Code_](https://code.claude.com/docs/en/mcp).
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.
31
102
 
32
- Save the example in [Configuration](#configuration) as `.intelli-search.json` in the target folder. The file can instead live at any readable absolute path, either per-folder or shared; replace `INTELLI_SEARCH_CONFIG` in the commands accordingly. Keep `INTELLI_SEARCH_WORKSPACE` per-folder and point it to an existing absolute directory so each folder has its own research cache. The server does not discover either path automatically.
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.
33
104
 
34
- Supply `OPENROUTER_API_KEY` through the server process environment before using the tools. For _Claude Code_, export it in the environment that launches the host, rather than putting the key in a committed file. The configuration names the variable, not the credential; restart the host after changing credentials.
105
+ #### Claude Code
35
106
 
36
- Run registration from the target folder. `local` is the default scope: private to the operator and active only in that folder. Add `--scope project` before `--` to write a shared `.mcp.json` into the folder. Project-scoped servers require approval in _Claude Code_ before connection; absolute paths in a shared file must also be valid on each operator's machine.
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.
37
108
 
38
- ### Post-Publication Launcher
109
+ ##### Create the Configuration
39
110
 
40
- The package's first registry publication is pending. Use this launcher only after publication; `npx` downloads the package without a separate install step:
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
+ ```
136
+
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.
138
+
139
+ ##### Supply the API Key
140
+
141
+ Enter the key at the hidden prompt, rather than writing it into shell history or a configuration file:
41
142
 
42
143
  ```bash
43
- claude mcp add intelli_search \
144
+ read -r -s -p 'OpenRouter API key: ' OPENROUTER_API_KEY
145
+ printf '\n'
146
+ export OPENROUTER_API_KEY
147
+ ```
148
+
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.
150
+
151
+ ##### Register the Server
152
+
153
+ ```bash
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
- ### Pre-Publication Source-Checkout Launcher
163
+ ##### Verify the Connection
53
164
 
54
- From the repository root, install dependencies if needed with `npm install`, then build:
165
+ Validate the configuration and workspace:
55
166
 
56
167
  ```bash
57
- npm run build:all
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
- Switch to the target folder and register the built server. Replace the checkout path with its actual absolute path:
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 add intelli_search \
64
- -e "INTELLI_SEARCH_CONFIG=$PWD/.intelli-search.json" \
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
- ### Verification
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
187
+
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
70
192
 
71
- From the target folder, check the registered server:
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 mcp list
196
+ claude plugin marketplace add Curio-Data/pi-intelli-search
197
+ claude plugin install intelli-search@curio-data-plugins
75
198
  ```
76
199
 
77
- Confirm `intelli_search` shows as connected. If a project-scoped server shows pending approval, open _Claude Code_ in that folder and approve it before checking again.
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
- Validate the configuration separately without credentials or inference. After publication, use:
202
+ Create the plugin data directory:
80
203
 
81
204
  ```bash
82
- INTELLI_SEARCH_CONFIG="$PWD/.intelli-search.json" \
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"
206
+ ```
207
+
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:
216
+
217
+ ```bash
218
+ codex plugin marketplace add Curio-Data/pi-intelli-search
219
+ codex plugin add intelli-search --marketplace curio-data-plugins
86
220
  ```
87
221
 
88
- For the source-checkout launcher, use:
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:
89
223
 
90
224
  ```bash
91
- node /absolute/path/to/pi-intelli-search/packages/mcp/dist/cli.js \
92
- --config "$PWD/.intelli-search.json" \
93
- --workspace "$PWD" \
94
- --check-config
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
+ }
95
257
  ```
96
258
 
97
- Use the same configuration path as the registered server if it is shared or stored elsewhere. A successful check prints `Configuration is valid.` and exits with status `0`. It validates configuration and workspace, not host connectivity, credentials or model access. `claude mcp list` checks the host connection; successful inference requires the separate provider key.
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. 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, cache. The primary research tool. One call. |
98
273
 
99
- ## Serving the Protocol
274
+ <a id="quick-start"></a>
275
+ ## Usage Examples
100
276
 
101
- An invocation without `--check-config` validates the explicit configuration and workspace, then serves the four canonical tools (`intelli_search`, `intelli_extract`, `intelli_collate`, `intelli_research`) over stdio until the input stream closes. Serving performs no inference at startup; credentials are only required when an operation runs.
277
+ These examples describe tool calls for the agent, not shell commands. MCP hosts add their own tool-name prefixes.
102
278
 
103
- - **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 SDK (software development kit) distinction between malformed protocol requests and invalid arguments.
104
- - **Results.** Successful calls return the concise summary as text content plus structured content with `outcome` and `details`. 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.
279
+ ### Quick Search
280
+
281
+ ```text
282
+ intelli_search(query="TypeScript 5.8 release date")
283
+ ```
284
+
285
+ ### Deep Research
286
+
287
+ Always provide a `focusPrompt`. The extraction LLM works best with specific guidance.
288
+
289
+ ```text
290
+ intelli_research(
291
+ query="Svelte 5 runes tutorial examples",
292
+ 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."
293
+ )
294
+ ```
295
+
296
+ ### Targeted Research With Domain Guidance
297
+
298
+ ```text
299
+ intelli_research(
300
+ query="Cloudflare Workers KV write timeout limits",
301
+ focusPrompt="Extract KV write limits, timeout thresholds, storage limits, and any workarounds for bulk writes. Focus on hard numbers and error messages.",
302
+ maxUrls=3,
303
+ domains=["developers.cloudflare.com"]
304
+ )
305
+ ```
306
+
307
+ `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).
308
+
309
+ ### Comparing Options
310
+
311
+ ```text
312
+ intelli_research(
313
+ query="Tailwind CSS vs Vanilla Extract comparison 2026",
314
+ focusPrompt="Extract pros/cons, bundle size benchmarks, DX tradeoffs, and migration costs. Note which claims come from official sources vs blog opinions."
315
+ )
316
+ ```
317
+
318
+ ## Pipeline
319
+
320
+ <p align="center">
321
+ <img src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/07B.png" alt="Vintage engraving-style infographic titled &quot;INTELLI_RESEARCH: The Five-Stage Pipeline,&quot; 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" />
322
+ </p>
323
+
324
+ 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.
325
+
326
+ 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).
327
+
328
+ 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.
329
+
330
+ See [docs/ARCHITECTURE.md](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/ARCHITECTURE.md) for detailed design decisions.
331
+
332
+ ## Cost
333
+
334
+ 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.
335
+
336
+ Per research run with the default 10 pages: ≈$0.09
337
+
338
+ | Step | Calls | Cost |
339
+ | ---------------------------------- | --------------------- | --------- |
340
+ | Search (Sonar) | 1 | ≈$0.007 |
341
+ | Fetch (Defuddle + Markdown) | 10 (≤4 concurrent) pairs | $0.00 |
342
+ | Extract (M3 via OpenRouter) | 10 (≤4 concurrent) | ≈$0.07 |
343
+ | Collate (M3 via OpenRouter) | 1 | ≈$0.01 |
344
+ | Cache Suggest (M3 via OpenRouter) | 1 | ≈$0.0002 |
345
+
346
+ 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.
347
+
348
+ ## MCP Server Reference
349
+
350
+ This reference applies to `@curio-data/mcp-intelli-search` only. Installation routes are under [MCP Server](#mcp-server).
351
+
352
+ ### Requirements
353
+
354
+ - [_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).
355
+ - An existing, explicitly selected absolute workspace directory.
356
+ - An explicitly selected JSON configuration file.
357
+ - 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.
358
+ - 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.
359
+
360
+ The package neither reads host credential stores nor loads project configuration automatically. Native `Pi` settings, authentication, providers and defaults remain independent.
361
+
362
+ ### Verification
363
+
364
+ The [installation example](#verify-the-connection) shows the configuration check, host connection check and first inference call in sequence. These establish different things:
365
+
366
+ | Check | What It Establishes |
367
+ |---|---|
368
+ | `mcp-intelli-search --check-config` with explicit configuration and workspace | Configuration and workspace are valid. Requires no credentials and performs no inference. |
369
+ | Host connection and tool listing | The server starts and completes the MCP connection. Does not establish provider access. |
370
+ | 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. |
371
+
372
+ 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.
373
+
374
+ ### Serving the Protocol
375
+
376
+ 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.
377
+
378
+ - **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.
379
+ - **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
380
  - **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
381
  - **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
382
  - **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
383
  - **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 are not read-only. 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.
384
+ - **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
385
 
111
386
  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
387
 
113
- ## Configuration
388
+ ### Configuration
114
389
 
115
390
  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
391
 
117
- The following example explicitly selects OpenRouter for every role. These are example selections, not standalone defaults:
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
- ```
392
+ 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
393
 
146
394
  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
395
 
@@ -149,9 +397,9 @@ Configuration loading does not require working credentials. Each operation valid
149
397
 
150
398
  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
399
 
152
- ### Tuning
400
+ #### Tuning
153
401
 
154
- Unspecified tuning comes from the canonical [shared defaults](../../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.
402
+ 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
403
 
156
404
  | Setting | Default and Effect | Accepted Values |
157
405
  |---|---|---|
@@ -183,9 +431,9 @@ Unspecified tuning comes from the canonical [shared defaults](../../src/core/def
183
431
 
184
432
  **Reasoning:** The adapter sends reasoning fields only when the catalogue advertises reasoning support; non-reasoning models receive neither effort nor exclusion fields.
185
433
 
186
- **Output Budget:** Empty output after token-budget exhaustion is an error, not a successful extraction. Increase the output-token limit or lower reasoning effort when this diagnostic occurs.
434
+ **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
435
 
188
- ## Direct Engine Verification
436
+ ### Direct Engine Verification
189
437
 
190
438
  From the repository root:
191
439
 
@@ -195,9 +443,9 @@ npm run test:all
195
443
  npm run test:mcp:install
196
444
  ```
197
445
 
198
- The installation gate packs the artifact, 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 initialization, 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.
446
+ 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
447
 
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](../../docs/COMPATIBILITY.md), not supplied by the installation gate.
448
+ 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
449
 
202
450
  The experimental runtime entrypoint supports direct engine verification after installation:
203
451
 
@@ -222,17 +470,17 @@ console.log(result.text);
222
470
 
223
471
  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
472
 
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.
473
+ `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
474
 
227
- ## Filesystem and Privacy Boundaries
475
+ ### Filesystem and Privacy Boundaries
228
476
 
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 artifact 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 and do not promise separate histories; another UTC date produces a different directory.
477
+ 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
478
 
231
479
  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
480
 
233
481
  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
482
 
235
- ## Timeouts and Troubleshooting
483
+ ### Timeouts and Troubleshooting
236
484
 
237
485
  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
486
 
@@ -245,16 +493,102 @@ Every startup failure is diagnostic-only and lands on standard error; standard o
245
493
  | Symptom | Cause and Remedy |
246
494
  |---|---|
247
495
  | `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 your host version. |
249
- | `Cannot read configuration: provide an explicit readable JSON file` | The configuration path does not exist or is not readable. Create the file (the guides show a minimal valid document) and restart. |
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. Remove or correct the named key; the [Tuning](#tuning) table lists every accepted key and range. |
251
- | Tools never appear in the host | The server exited during startup. Read the host's MCP server logs for the standard-error diagnostic; `mcp-intelli-search --check-config` reproduces configuration and workspace failures without a host. |
252
- | Operations fail with `CONFIGURATION` or `PROVIDER` | The named credential environment variable is missing or the key was rejected. The server snapshots the environment at startup: restart it after changing credentials. Catalogue preflight failures name the offending model role. |
253
- | Repeated 429 retries on a free-tier or shared key | Free-tier OpenRouter keys share a tight rate bucket. Set `minRequestIntervalMs` to approximately `3000`, lower `extractionConcurrency` to `2`, and raise `llmRetryAttempts`; raise `llmTimeoutMs` only when the model-call timer is expiring. |
496
+ | `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. |
497
+ | `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. |
498
+ | 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. |
499
+ | 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. |
500
+ | `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. |
501
+ | 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. |
502
+ | 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. |
503
+ | `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. |
504
+ | 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
505
  | 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
506
 
256
- ## Host Plugins
507
+ ## Cache Structure
508
+
509
+ 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).
510
+
511
+ ```text
512
+ .search/
513
+ ├── 2026-04-19-d1-worker-api-3f7a2c/
514
+ │ ├── report.md # Collated summary + source index
515
+ │ ├── query.txt # Original search query
516
+ │ ├── meta.json # Local-only telemetry sidecar (v0.11.0+)
517
+ │ ├── extractions/ # Per-page LLM extractions (≈3-5K each)
518
+ │ │ ├── 01-developers-cloudflare-com.md
519
+ │ │ └── 02-developers-cloudflare-com.md
520
+ │ └── sources/ # Full page content
521
+ │ ├── 01-developers-cloudflare-com.md
522
+ │ ├── 02-developers-cloudflare-com.md
523
+ │ └── llms-full-developers-cloudflare-com.md
524
+ └── .index.json # Index of all cached searches
525
+ ```
526
+
527
+ 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.
528
+
529
+ Refresh behaviour:
530
+
531
+ - 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.
532
+ - Archive failure is logged and the completed run can replace canonical files in place; interrupted rotation can leave a partial archive.
533
+ - Supplementary `llms-full-*` documentation downloads stay with the live folder and are not archived.
534
+ - A degraded repeat preserves the earlier successful report, extractions, sources and index entry untouched and records only the failed attempt in `meta.json`.
535
+ - The numbered siblings are a same-day safety net, not a versioned archive: copy a report elsewhere if it must be retained long-term.
536
+
537
+ **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.
538
+
539
+ To suppress the sidecar in the MCP server, set `"disableTelemetry": true` inside the configuration's [`tuning` object](#tuning).
540
+
541
+ ## Compatibility
542
+
543
+ ### MCP Server Compatibility
544
+
545
+ - 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.
546
+ - 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).
547
+ - Standalone fetch assets are verified on _Linux_ x86-64 only; _macOS_ and _Windows_ are not verified.
548
+ - 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.
549
+
550
+ 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).
551
+
552
+ ## Documentation
553
+
554
+ - [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.
555
+ - [Changelog](https://github.com/Curio-Data/pi-intelli-search/blob/main/CHANGELOG.md): Release history.
556
+ - [Architecture](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/ARCHITECTURE.md): Detailed design decisions and pipeline internals.
557
+ - [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.
558
+ - [Components](https://github.com/Curio-Data/pi-intelli-search/blob/main/docs/COMPONENTS.md): Third-party dependencies and licence attribution.
559
+ - [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.
560
+ - [Contributor guide](https://github.com/Curio-Data/pi-intelli-search/blob/main/AGENTS.md): Coding conventions and project structure.
561
+
562
+ ## Downloads
563
+
564
+ ### MCP Server Downloads
565
+
566
+ View download statistics on the [`@curio-data/mcp-intelli-search` package page](https://www.npmjs.com/package/@curio-data/mcp-intelli-search).
567
+
568
+ ## Sponsor
569
+
570
+ <img src="https://raw.githubusercontent.com/Curio-Data/pi-intelli-search/main/docs/images/sponsor.png" alt="Banner image for &quot;Curio Data Pro.&quot; A cartoon robot detective in a deerstalker hat and brown cape peers through binoculars on the left, beside a bordered logo reading &quot;CURIO DATA PRO&quot; 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" />
571
+
572
+ **[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.
573
+
574
+ [Blog](https://blog.curiodata.pro/) | [LinkedIn](https://www.linkedin.com/company/curio-data-pro-ltd/)
575
+
576
+ <a id="license"></a>
577
+ ## Licence
578
+
579
+ Copyright 2026 Ashraf Miah, Curio Data Pro Ltd.
580
+
581
+ Licensed under the [Apache License, Version 2.0](https://github.com/Curio-Data/pi-intelli-search/blob/main/LICENSE).
582
+
583
+ ## Use of Large Language Models
257
584
 
258
- Thin plugin bundles for [_Claude Code_](https://code.claude.com/docs/en/plugins) and [_Codex_](https://developers.openai.com/codex/plugins) live in `plugins/` at the repository root, with repository marketplace catalogs at `.claude-plugin/marketplace.json` and `.agents/plugins/marketplace.json`. The bundles are generated from the shared guidance source in `guidance/` and the version pinned in this package's manifest; run `npm run generate:plugins` after a version change and `npm run check:plugins` to detect drift. Launchers pin the exact package version through `npx`; until the package is published, `scripts/generate-plugin-bundles.mjs --mode tarball` generates equivalent local-tarball launchers for installation tests. Host setup, including each host's environment forwarding rules, is in the generated skills.
585
+ Large Language Models were used extensively during the development of this project:
259
586
 
260
- **Publication Status:** The standalone package is not published. Use the source-checkout launcher until publication. Recorded host checks and unverified routes are listed in the [compatibility matrix](../../docs/COMPATIBILITY.md).
587
+ - **`Pi` agent** (primary development environment).
588
+ - **_GLM_ 5.1/5.2/5.3:** Primary model family for code generation and architecture, across successive releases.
589
+ - **_Kimi_ K3:** Code generation, review, and vision-dependent verification.
590
+ - **_MiniMax_ M3:** Adversarial review and analysis.
591
+ - **_Qwen_ 3.8 Max:** Review and deep research.
592
+ - **_DeepSeek_ V4 Pro:** Research and data analysis.
593
+ - **_Qwen_ 3.6 Plus:** Secondary model for review and documentation.
594
+ - **_Claude_ Opus 5.0/5.5:** Primary model for MCP variant.