@autorag/librarian 2.6.2 → 2.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/NOTICE +12 -0
  2. package/README.md +12 -3
  3. package/dist/agent/agent.d.ts +135 -6
  4. package/dist/agent/everything-search-tool.d.ts +35 -0
  5. package/dist/agent/fsearch-search-tool.d.ts +35 -0
  6. package/dist/agent/jikji-find-tool.d.ts +2 -0
  7. package/dist/agent/refresh-progress.d.ts +1 -1
  8. package/dist/agent/search-documents.d.ts +1 -1
  9. package/dist/cli/commands/refresh.d.ts +1 -1
  10. package/dist/cli/config.d.ts +51 -3
  11. package/dist/cli/index.js +2392 -527
  12. package/dist/core.js +2530 -693
  13. package/dist/datasource/connector-timeouts.d.ts +19 -0
  14. package/dist/datasource/crawler-types.d.ts +10 -0
  15. package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +2 -0
  16. package/dist/datasource/skills/lazykatok/client.d.ts +2 -0
  17. package/dist/datasource/skills/lazykatok/index.d.ts +1 -1
  18. package/dist/datasource/skills/lazykatok/types.d.ts +17 -1
  19. package/dist/datasource/skills/rss/connector.d.ts +2 -0
  20. package/dist/datasource/skills/spotlight/connector.d.ts +2 -0
  21. package/dist/dupey/filter.d.ts +7 -1
  22. package/dist/everything/bundle.d.ts +62 -0
  23. package/dist/everything/client.d.ts +123 -0
  24. package/dist/everything/index.d.ts +2 -0
  25. package/dist/fsearch/client.d.ts +173 -0
  26. package/dist/fsearch/index.d.ts +2 -0
  27. package/dist/fsearch/walk.d.ts +22 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +2555 -693
  30. package/dist/minsync/method.d.ts +6 -0
  31. package/dist/retrieval/engine.d.ts +14 -0
  32. package/dist/retrieval/index.d.ts +1 -0
  33. package/dist/retrieval/rerank.d.ts +114 -0
  34. package/dist/retrieval/types.d.ts +1 -1
  35. package/licenses/es-MIT.txt +21 -0
  36. package/licenses/everything-MIT-and-PCRE-BSD.txt +51 -0
  37. package/package.json +4 -2
  38. package/skills/autorag/SKILL.md +4 -3
  39. package/skills/autorag-doctor/SKILL.md +2 -0
  40. package/skills/autorag-lite-setup/SKILL.md +3 -2
  41. package/skills/autorag-setup/SKILL.md +53 -3
  42. package/vendor/everything/ES-1.1.0.38.ARM64.zip +0 -0
  43. package/vendor/everything/ES-1.1.0.38.x64.zip +0 -0
  44. package/vendor/everything/Everything-1.4.1.1032.ARM64.en-US.zip +0 -0
  45. package/vendor/everything/Everything-1.4.1.1032.x64.en-US.zip +0 -0
  46. package/vendor/everything/manifest.json +30 -0
package/NOTICE CHANGED
@@ -18,6 +18,9 @@ License: MIT
18
18
  @earendil-works/pi-tui@0.86.1
19
19
  License: MIT
20
20
 
21
+ @openrouter/sdk@1.4.21
22
+ License: Apache-2.0
23
+
21
24
  chardet@2.2.0
22
25
  License: MIT
23
26
 
@@ -66,3 +69,12 @@ licenses/gemma-section-3.2-flow-down.txt
66
69
  licenses/gemma-terms-of-use.txt
67
70
  licenses/gemma-terms-of-use.html
68
71
  licenses/embedding-assets.json
72
+
73
+ Bundled Windows binaries (vendor/everything, extracted only on Windows):
74
+ Everything 1.4.1.1032 portable (voidtools, David Carpenter)
75
+ License: MIT (closed source); includes PCRE (BSD-3-Clause)
76
+ licenses/everything-MIT-and-PCRE-BSD.txt
77
+
78
+ ES 1.1.0.38 command-line interface (voidtools)
79
+ License: MIT
80
+ licenses/es-MIT.txt
package/README.md CHANGED
@@ -51,7 +51,7 @@ Three principles drive every design decision in AutoRAG Agent:
51
51
 
52
52
  1. **Never migrate your data to search it.** Traditional RAG systems force you to upload, ETL, and duplicate your files into a centralized vector database. AutoRAG Agent federates your data **in place**, querying CLI-native stores (`lazykatok`, `discrawl`, `slacrawl`, `mailcrawl`, `rclone`, `qmd`) where your data already lives. Results retain opaque, source-native identities (`/kakao/...`, `/slack/...`) that preserve local access control and privacy. *(See our [Competitive Landscape Study](docs/competitive-landscape-2026-09.md) on why in-place federation is the durable differentiator).*
53
53
 
54
- 2. **Just works — no RAG degree required.** No pipeline tuning, no vector-DB maintenance, and no remote embedding API keys. AutoRAG Agent automatically manages [MinSync](docs/minsync-setup.md) for incremental Change Data Capture (CDC) chunking and provides a local [embedding gateway](docs/embedding-runtime.md) out of the box with zero external telemetry.
54
+ 2. **Just works — no RAG degree required.** No pipeline tuning, no vector-DB maintenance, and no remote embedding keys required. AutoRAG Agent automatically manages [MinSync](docs/minsync-setup.md) for incremental Change Data Capture (CDC) chunking and provides a local [embedding gateway](docs/embedding-runtime.md) out of the box with zero external telemetry. A [remote rerank model](docs/rerank.md) (OpenRouter, `voyageai/rerank-3-lite` by default) is an opt-in extra.
55
55
 
56
56
  3. **Fast by design.** Rather than coordinating slow multi-agent hierarchies, a single configured model owns the entire retrieval, direct-read, and curation loop. Local CDC chunks (BM25, vector, and hybrid modes) deliver rapid, low-latency turnaround across multi-turn research queries.
57
57
 
@@ -67,6 +67,8 @@ AutoRAG Agent orchestrates five integrated subsystems:
67
67
  - **Semantic Vector Search:** Dense vector retrieval over CDC chunks via the built-in embedding gateway.
68
68
  - **Hybrid Search:** Combines BM25 and vector ranking via Reciprocal Rank Fusion (RRF).
69
69
  - **Jikji Find-First Discovery:** Local CLI-backed fast discovery answer packs.
70
+ - **Everything File-Name Search (Windows):** The bundled [voidtools Everything](https://www.voidtools.com/) indexes file and folder names under your search roots so the agent finds files by name, extension, path, size, or date instantly (`everything_search`).
71
+ - **FSearch File-Name Search (macOS/Linux):** [fsearch-cli](https://github.com/NomaDamas/fsearch-mac) (FSearch) keeps a live, per-workspace name index of your search roots so the agent finds files by name, extension, path, size, or date instantly (`fsearch_search`); without fsearch-cli installed it degrades to a slow filesystem walk.
70
72
  - **Datasource Skills:** Server-authorized federated retrieval across external applications.
71
73
  3. **Result Merger & Scoped Access Gate:** Cross-method deduplication, score normalization, and default-deny permission checks.
72
74
  4. **Direct Evidence Reading (`bash`):** The agent directly opens and inspects promising files with `cat`, `grep`, or `find` to verify facts against ground truth.
@@ -175,7 +177,7 @@ AutoRAG Agent connects to external tools and communication platforms using dedic
175
177
  | **RSS / News** | `rss` | Native HTTP Poller | RSS 2.0 & Atom feeds (24h deduplication) | Lexical |
176
178
  | **macOS Spotlight** | `spotlight` | Native `mdfind` CLI | macOS system metadata and content index | System Native |
177
179
 
178
- For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md).
180
+ For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md). Non-interactive `sync`/`index` steps get a 30-minute per-connector budget (`connector.indexTimeoutMs`) because first-run imports routinely take minutes; interactive search keeps its 60-second default.
179
181
 
180
182
  ---
181
183
 
@@ -198,6 +200,8 @@ bun add @autorag/librarian
198
200
  - **No Java required:** Document parsing (HWP/HWPX/HWPML, PDF, DOCX, XLSX/XLS) runs in-process through [`kordoc`](https://github.com/chrisryugj/kordoc).
199
201
  - **Rust Toolchain (Optional):** Automatically compiles Jikji (`jikji-cli`) if installed.
200
202
  - **MinSync:** Automatically downloaded and installed into `<workspace>/.autorag/bin` on first run.
203
+ - **Everything (Windows only, bundled):** The package ships the portable Everything 1.4.1.1032 and its ES 1.1.0.38 CLI (x64 and ARM64, SHA-256 pinned). On Windows, AutoRAG extracts them into `<workspace>/.autorag/everything/` and runs a private, user-level instance that indexes only your configured search roots: no administrator rights, no Everything service, no whole-drive scan, no HTTP/ETP server, and no change to any Everything you already run. Set `"everything": false` in the config to turn it off. macOS and Linux are not affected.
204
+ - **FSearch (macOS/Linux only, separate install):** Install [`fsearch-cli`](https://github.com/NomaDamas/fsearch-mac) yourself (e.g. `brew install NomaDamas/fsearch-mac/fsearch-mac` (installs the `fsearch-cli` binary); GPL-2.0, spawned as a separate process, never bundled or linked). On macOS and Linux, AutoRAG builds a per-workspace database at `<workspace>/.autorag/fsearch/` indexing only your configured search roots, and keeps a `fsearch-cli watch` daemon live (FSEvents/inotify) for sub-second name search. It never touches the FSearch app's own database. Without fsearch-cli, name search falls back to a slow bounded filesystem walk. Set `"fsearch": false` in the config to turn it off. Windows is not affected (Everything covers it).
201
205
 
202
206
  ---
203
207
 
@@ -279,7 +283,7 @@ agent.recordFeedbackByNumbers(response.sessionId, [1], [2]);
279
283
  | Command | Description |
280
284
  |---|---|
281
285
  | `autorag init` | Initialize `~/.autorag/config.json` with search roots, document languages, and model settings |
282
- | `autorag refresh` | Refresh parsed mirrors, MinSync CDC chunks, datasources, and Jikji |
286
+ | `autorag refresh` | Refresh parsed mirrors, MinSync CDC chunks, datasources, Jikji, and the platform file-name index (Everything on Windows, FSearch on macOS/Linux) |
283
287
  | `autorag search "<query>"` | Run the librarian agent to curate structured answers |
284
288
  | `autorag status` | Inspect corpus freshness, indexing status, and vector readiness |
285
289
  | `autorag health` | Check model provider authentication, token validity, and API reachability |
@@ -325,6 +329,8 @@ AutoRAG Agent stands on the shoulders of fantastic open-source projects:
325
329
  - **[Pi Framework](https://github.com/earendil-works/pi-mono)** by [@earendil-works](https://github.com/earendil-works) — The foundational agent framework powering AutoRAG's reasoning loop.
326
330
  - **[MinSync](https://github.com/Marker-Inc-Korea/minsync)** — Ultra-fast incremental Change Data Capture (CDC) chunking and local BM25/vector indexing.
327
331
  - **[Jikji](https://github.com/NomaDamas/jikji)** by [NomaDamas](https://github.com/NomaDamas) — High-performance find-first local document discovery.
332
+ - **[Everything](https://www.voidtools.com/)** and **[ES](https://github.com/voidtools/ES)** by voidtools (David Carpenter) — Instant Windows file-name indexing and its command-line interface, bundled under the MIT License.
333
+ - **[FSearch](https://github.com/cboxdoerfer/fsearch)** and **[fsearch-cli](https://github.com/NomaDamas/fsearch-mac)** — Everything-style file-name search for macOS/Linux (GPL-2.0-or-later). Never bundled or linked: users install fsearch-cli separately and AutoRAG spawns it as a separate process (mere aggregation per the FSF GPL FAQ).
328
334
  - **[dupey](https://github.com/NomaDamas/dupey)** by [NomaDamas](https://github.com/NomaDamas) — Fast duplicate and near-duplicate document family detection.
329
335
  - **Federated CLI Authors:** External datasource tools [`lazykatok`](https://github.com/changeroa/lazykatok), [`discrawl`](https://github.com/openclaw/discrawl), [`mailcrawl`](https://github.com/NomaDamas/mailcrawl), [`wacrawl`](https://github.com/openclaw/wacrawl), [`telecrawl`](https://github.com/openclaw/telecrawl), [`slacrawl`](https://github.com/openclaw/slacrawl), [`notcrawl`](https://github.com/openclaw/notcrawl), [`qmd`](https://github.com/tobi/qmd), and [`rclone`](https://rclone.org).
330
336
  - **[kordoc](https://github.com/chrisryugj/kordoc)** by [chrisryugj](https://github.com/chrisryugj) — HWP/HWPX/HWPML, PDF, DOCX and XLSX parsing with nested-table fidelity, used as AutoRAG's default document parser.
@@ -360,6 +366,7 @@ Common failures and their fix:
360
366
  | A datasource is healthy in its own CLI but absent from results | — | add its tag/scope to `datasourceAccess` |
361
367
  | A datasource errors during refresh | `datasource-index-failed` | run that CLI's own `doctor` |
362
368
  | MinSync or Jikji missing | `minsync-unavailable`, `jikji-unavailable` | check the Rust toolchain, re-run refresh |
369
+ | Windows file-name search fails during refresh | `everything-index-failed` | read the ES exit code and stderr in the message, then `autorag refresh --method everything --json` |
363
370
 
364
371
  Native datasource stores stay owned by their CLIs — AutoRAG never rebuilds them. Fix a broken archive with `lazykatok doctor`, `discrawl --json metadata`, `slacrawl --json doctor`, `wacrawl --json doctor`, `telecrawl --json doctor`, `notcrawl doctor`, `qmd status`, or `mailcrawl doctor`, then re-run `autorag refresh --method datasources --json`.
365
372
 
@@ -368,3 +375,5 @@ Native datasource stores stay owned by their CLIs — AutoRAG never rebuilds the
368
375
  - **AutoRAG 2.0 (AutoRAG Agent):** Released under the [MIT License](LICENSE).
369
376
  - **Legacy Python AutoRAG (`legacy/`):** Released under the [Apache License 2.0](legacy/LICENSE).
370
377
  - Production third-party notices and licenses are documented in [`NOTICE`](NOTICE).
378
+ - The bundled Windows binaries keep their own licenses: Everything (MIT, plus PCRE BSD-3-Clause) in [`licenses/everything-MIT-and-PCRE-BSD.txt`](licenses/everything-MIT-and-PCRE-BSD.txt) and ES (MIT) in [`licenses/es-MIT.txt`](licenses/es-MIT.txt). Everything's source code is not public; AutoRAG redistributes the unmodified voidtools portable ZIPs.
379
+ - FSearch/fsearch-cli (GPL-2.0-or-later) are **not** distributed with AutoRAG: no code is copied, linked, or bundled. Users install fsearch-cli themselves and AutoRAG communicates with it only through its command-line interface and daemon socket — separate programs, per the [FSF mere-aggregation FAQ](https://www.gnu.org/licenses/gpl-faq.html#MereAggregation). Source: https://github.com/NomaDamas/fsearch-mac.
@@ -3,6 +3,8 @@ import type { Api, Model } from "@earendil-works/pi-ai";
3
3
  import { type DatasourceAccessContextOptions } from "../datasource/access-context.js";
4
4
  import type { DatasourceIndexResult, DatasourceSkill } from "../datasource/types.js";
5
5
  import { type DupeyCliOptions } from "../dupey/index.js";
6
+ import { type EverythingClientOptions, type EverythingSearchRequest, type EverythingSearchResult } from "../everything/index.js";
7
+ import { type FSearchClientOptions, type FSearchFailureReason, type FSearchSearchRequest, type FSearchSearchResult } from "../fsearch/index.js";
6
8
  import { type JikjiFailureReason, type JikjiOptions } from "../jikji/index.js";
7
9
  import { type LanguageTag } from "../language.js";
8
10
  import type { ResultFeedback } from "../memory/memory.js";
@@ -17,18 +19,48 @@ import { RetrievalEngine } from "../retrieval/engine.js";
17
19
  import { RetrievalMethodRegistry } from "../retrieval/registry.js";
18
20
  import type { CuratedResult, RetrievalDiagnostic, RetrievalOptions, RetrievalResult } from "../retrieval/types.js";
19
21
  import { type ScanDuplicateDocumentsDetails } from "./dupey-tool.js";
22
+ import { type AutoRAGFastAnswerDetails } from "./fast-answer-tool.js";
20
23
  import { type JikjiFindProviderResult } from "./jikji-find-tool.js";
21
24
  import { type RefreshProgressCounts, type RefreshProgressPhase } from "./refresh-progress.js";
22
25
  import { type SearchDocumentDiagnostic, type SearchDocumentsResponse, type SearchDocumentsStreamEvent } from "./search-documents.js";
23
26
  import { type WatcherFactory, type WatchRefreshHandle } from "./watch-refresh.js";
24
27
  import { type WebFetchToolOptions } from "./web-fetch-tool.js";
25
28
  import { type WebSearchToolOptions } from "./web-search-tool.js";
29
+ /**
30
+ * Hard caps on retrieval, baseline prefetch, and the candidate lists handed to
31
+ * the model. Every field is optional: an omitted field keeps the shipped
32
+ * default below, so this only exists to let an operator tighten or widen a
33
+ * specific cap without rebuilding. Values must be positive integers.
34
+ */
35
+ export interface AutoRAGRetrievalLimits {
36
+ /** `search_all_documents` merge ceiling when the model omits `topK`. Default 500. */
37
+ readonly mergedEvidenceCeiling?: number;
38
+ /** `search_datasource_*` merge default when the model omits `topK`. Default 50. */
39
+ readonly singleDatasourceTopK?: number;
40
+ /** MinSync semantic retrieval default `topK`. Default 50. */
41
+ readonly minSyncTopK?: number;
42
+ /** MinSync fetch cap when a scope narrows the query. Default 100. */
43
+ readonly minSyncScopedQueryTopK?: number;
44
+ /** Instance scopes listed in one datasource tool description. Default 8. */
45
+ readonly toolDescriptionInstanceScopes?: number;
46
+ /** Baseline evidence prefetched for the fast answer. */
47
+ readonly prefetch?: {
48
+ /** Jikji find candidate count. Default 30. */
49
+ readonly jikjiTopK?: number;
50
+ /** MinSync retrieve candidate count. Default 100. */
51
+ readonly minSyncTopK?: number;
52
+ /** Max Jikji answer paths rendered into the baseline. Default 100. */
53
+ readonly jikjiPathLimit?: number;
54
+ /** Max results rendered per baseline section. Default 100. */
55
+ readonly sectionLimit?: number;
56
+ };
57
+ }
26
58
  export interface AutoRefreshOptions {
27
59
  readonly intervalMs: number;
28
60
  readonly immediate?: boolean;
29
61
  }
30
62
  /** Methods that `refresh` can selectively run. Defaults to all when omitted. */
31
- export type RefreshMethod = "parsed" | "minsync" | "datasources" | "jikji";
63
+ export type RefreshMethod = "parsed" | "minsync" | "datasources" | "jikji" | "everything" | "fsearch";
32
64
  export interface AutoRAGRefreshOptions {
33
65
  /** Restrict refresh to specific methods. Defaults to all when undefined. */
34
66
  readonly methods?: readonly RefreshMethod[];
@@ -45,11 +77,30 @@ export interface AutoRAGRefreshResult extends Omit<ParsedMirrorSyncResult, "diag
45
77
  readonly diagnostics: readonly SearchDocumentDiagnostic[];
46
78
  readonly minsync?: AutoRAGMinSyncRefreshResult;
47
79
  readonly datasources?: readonly DatasourceIndexResult[];
80
+ /** Windows-only Everything file-name index outcome; absent on other platforms or when not selected. */
81
+ readonly everything?: AutoRAGEverythingRefreshResult;
82
+ /** macOS/Linux-only FSearch file-name index outcome; absent on other platforms or when not selected. */
83
+ readonly fsearch?: AutoRAGFSearchRefreshResult;
84
+ }
85
+ export interface AutoRAGEverythingRefreshResult {
86
+ readonly ok: boolean;
87
+ readonly indexedItems?: number;
88
+ readonly reason?: string;
89
+ }
90
+ export interface AutoRAGFSearchRefreshResult {
91
+ readonly ok: boolean;
92
+ readonly indexedItems?: number;
93
+ /** Stable failure kind (e.g. "binary-missing") when ok is false. */
94
+ readonly reason?: FSearchFailureReason;
95
+ /** Verbatim underlying failure text when ok is false. */
96
+ readonly message?: string;
48
97
  }
49
98
  export interface AutoRAGRefreshComponentStatus {
50
99
  readonly minsync?: string;
51
100
  readonly jikji?: string;
52
101
  readonly datasources?: string;
102
+ readonly everything?: string;
103
+ readonly fsearch?: string;
53
104
  }
54
105
  /** Path-opaque snapshot of corpus freshness and the last refresh outcome. */
55
106
  export interface AutoRAGRefreshStatus {
@@ -139,6 +190,23 @@ export interface AutoRAGAgentOptions {
139
190
  tools?: AgentTool[];
140
191
  minSync?: Omit<MinSyncVectorMethodOptions, "root"> | false;
141
192
  jikji?: JikjiOptions | false;
193
+ /**
194
+ * Windows-only instant file/folder name search through the bundled
195
+ * voidtools Everything (portable, user-level, folder-only index over
196
+ * `searchPaths`). Enabled by default on Windows; ignored elsewhere.
197
+ * `false` disables it. The remaining fields are test seams.
198
+ */
199
+ everything?: Omit<EverythingClientOptions, "root" | "folders"> | false;
200
+ /**
201
+ * macOS/Linux-only instant file/folder name search through the user's
202
+ * fsearch-cli (FSearch, GPL — spawned as a separate process, never
203
+ * bundled). Indexes only `searchPaths` into `<workspace>/.autorag/fsearch/`
204
+ * and keeps a per-workspace `fsearch-cli watch` daemon live; searches fall
205
+ * back to a bounded slow filesystem walk when fsearch-cli is not
206
+ * installed. Enabled by default on macOS/Linux; ignored elsewhere.
207
+ * `false` disables it. The remaining fields are test seams.
208
+ */
209
+ fsearch?: Omit<FSearchClientOptions, "root" | "folders"> | false;
142
210
  /**
143
211
  * Internet web tools (`web_search` + `web_fetch`), ported from oh-my-pi's
144
212
  * provider-chain web module. Default enabled and credential-free: the
@@ -154,11 +222,24 @@ export interface AutoRAGAgentOptions {
154
222
  webSearch?: (WebSearchToolOptions & {
155
223
  fetch?: WebFetchToolOptions | false;
156
224
  }) | false;
225
+ /**
226
+ * Post-merge reranking. When set (and not `false`), merged retrieval evidence
227
+ * is reordered by a dedicated rerank model — OpenRouter by default. A
228
+ * configured-but-unavailable reranker is reported as a diagnostic and the
229
+ * merged order is preserved. `false` disables reranking.
230
+ */
231
+ rerank?: RerankAgentOptions | false;
157
232
  autoRefresh?: AutoRefreshOptions;
158
233
  parserOptions?: DefaultParserRegistryOptions;
159
234
  dupey?: DupeyCliOptions | false;
160
235
  excludeExactDuplicates?: boolean;
161
236
  excludePaths?: readonly string[];
237
+ /**
238
+ * Hard caps on retrieval, baseline prefetch, and model-facing candidate
239
+ * lists. Omitted fields keep their shipped defaults — see
240
+ * {@link AutoRAGRetrievalLimits}. Values must be positive integers.
241
+ */
242
+ limits?: AutoRAGRetrievalLimits;
162
243
  datasourceSkills?: readonly DatasourceSkill[];
163
244
  datasourceAccess?: DatasourceAccessContextOptions;
164
245
  /** Non-fatal diagnostics from config/agent construction (e.g. skipped unknown datasources). */
@@ -177,6 +258,23 @@ export interface AutoRAGAgentOptions {
177
258
  /** Two-phase progressive answers with per-phase thinking control. Default enabled. */
178
259
  thinking?: AutoRAGThinkingOptions | false;
179
260
  }
261
+ /** Post-merge reranking options. Mirrors the CLI `RerankConfig` (secrets via env). */
262
+ export interface RerankAgentOptions {
263
+ /** Provider id. @default "openrouter" */
264
+ provider?: string;
265
+ /** Wire model id. @default "voyageai/rerank-3-lite" */
266
+ model?: string;
267
+ /** API key. Prefer `apiKeyEnv`; this is a programmatic seam. */
268
+ apiKey?: string;
269
+ /** Environment variable holding the provider API key. */
270
+ apiKeyEnv?: string;
271
+ /** Override the provider base URL. */
272
+ baseUrl?: string;
273
+ /** Return only the top N merged results. */
274
+ topN?: number;
275
+ /** Per-request timeout in milliseconds. */
276
+ timeoutMs?: number;
277
+ }
180
278
  export interface AutoRAGSearchSession {
181
279
  readonly agent: Agent;
182
280
  prompt(text: string): Promise<void>;
@@ -233,9 +331,13 @@ export declare class AutoRAGAgent {
233
331
  private readonly methodRegistry;
234
332
  private readonly retriever;
235
333
  private readonly merger;
334
+ private readonly reranker;
335
+ private readonly rerankTopN;
236
336
  private readonly datasourceFilter;
237
337
  private readonly minSyncMethod;
238
338
  private readonly jikjiClient;
339
+ private readonly everythingClient;
340
+ private readonly fsearchClient;
239
341
  private readonly datasourceSkills;
240
342
  private readonly datasourceAccessOptions;
241
343
  private readonly startupDiagnostics;
@@ -252,6 +354,7 @@ export declare class AutoRAGAgent {
252
354
  readonly remoteSession: boolean;
253
355
  private activeRetrievalOptions;
254
356
  private searchToolCallCount;
357
+ private readonly limits;
255
358
  constructor(options: AutoRAGAgentOptions);
256
359
  scanDuplicateDocuments(): Promise<ScanDuplicateDocumentsDetails>;
257
360
  private withMemoryContext;
@@ -322,12 +425,15 @@ export declare class AutoRAGAgent {
322
425
  * via emit_fast_answer, without any further tool calls.
323
426
  */
324
427
  buildFastAnswerPrompt(query: string, options: RetrievalOptions, baseline: string): string;
428
+ /** Discovery-tool hint naming only the registered discovery tools; empty when none. */
429
+ private discoveryHint;
325
430
  /**
326
- * Verification-phase prompt for two-phase searches. The user already saw
327
- * the fast answer; the model now verifies it against sources with thinking
328
- * on and finalizes with emit_autorag_results exactly once.
431
+ * Verification-phase prompt for two-phase searches. The fast answer, when a
432
+ * consumer already received it, is embedded verbatim so the model can diff
433
+ * against it; the model then verifies with thinking on and finalizes with
434
+ * emit_autorag_results exactly once, returning only the delta.
329
435
  */
330
- buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: string | undefined): string;
436
+ buildRefinementPrompt(query: string, options: RetrievalOptions, fastAnswer: AutoRAGFastAnswerDetails | undefined, fastAnswerDelivered: boolean): string;
331
437
  buildSearchPrompt(query: string, options: RetrievalOptions, initialRetrievalContext?: string): string;
332
438
  refresh(force?: boolean, opts?: AutoRAGRefreshOptions): Promise<AutoRAGRefreshResult>;
333
439
  /**
@@ -341,7 +447,7 @@ export declare class AutoRAGAgent {
341
447
  */
342
448
  getRefreshStatus(): Promise<AutoRAGRefreshStatus>;
343
449
  /**
344
- * Synchronous per-component readiness snapshot (minsync/jikji/datasources).
450
+ * Synchronous per-component readiness snapshot (minsync/jikji/datasources/everything).
345
451
  * `minsync` is "ready" only after a successful sync wrote its cursor;
346
452
  * "configured" means the binary resolved but no index exists yet.
347
453
  */
@@ -366,6 +472,23 @@ export declare class AutoRAGAgent {
366
472
  private scanMirrorStaleness;
367
473
  private exactDuplicateExclusions;
368
474
  syncMinSync(force?: boolean): Promise<MinSyncSyncResult | undefined>;
475
+ /** Provider for the Windows-only everything_search tool. */
476
+ searchEverything(request: EverythingSearchRequest): Promise<EverythingSearchResult>;
477
+ /**
478
+ * Exit this workspace's Everything instance. The instance otherwise stays
479
+ * running on purpose (live folder monitoring between CLI invocations), so
480
+ * call this only when the workspace is being torn down. No-op off Windows.
481
+ */
482
+ stopEverything(): Promise<void>;
483
+ /** Provider for the macOS/Linux-only fsearch_search tool. */
484
+ searchFsearch(request: FSearchSearchRequest): Promise<FSearchSearchResult>;
485
+ /**
486
+ * Terminate this workspace's fsearch-cli watch daemon. The daemon otherwise
487
+ * stays running on purpose (live index updates between CLI invocations), so
488
+ * call this only when the workspace is being torn down. No-op off
489
+ * macOS/Linux.
490
+ */
491
+ stopFsearch(): Promise<void>;
369
492
  prepareJikji(): Promise<readonly AutoRAGJikjiPrepareResult[] | undefined>;
370
493
  private executeJikjiPrepare;
371
494
  /**
@@ -453,6 +576,12 @@ export declare class AutoRAGAgent {
453
576
  private retrievalEngine;
454
577
  getRetrievalEngine(): RetrievalEngine;
455
578
  getSystemPrompt(): string;
579
+ /**
580
+ * Reorder merged evidence with the configured reranker. A configured-but-
581
+ * unavailable reranker, or a rerank failure, is reported as a diagnostic and
582
+ * the merged order is preserved — a reranker outage never hides evidence.
583
+ */
584
+ private applyRerank;
456
585
  private rerankWithMemory;
457
586
  private remoteFilteredRetrievalMethod;
458
587
  private normalizeRetrievalOptions;
@@ -0,0 +1,35 @@
1
+ import type { AgentTool } from "@earendil-works/pi-agent-core";
2
+ import { Type } from "typebox";
3
+ import type { EverythingSearchRequest, EverythingSearchResult } from "../everything/index.js";
4
+ export declare const EVERYTHING_SEARCH_TOOL_NAME = "everything_search";
5
+ export interface EverythingSearchProvider {
6
+ searchEverything(request: EverythingSearchRequest): Promise<EverythingSearchResult>;
7
+ }
8
+ export interface EverythingSearchDetails {
9
+ readonly method: typeof EVERYTHING_SEARCH_TOOL_NAME;
10
+ readonly resultCount: number;
11
+ readonly sources: readonly string[];
12
+ /** Retrieval-trace shape: each hit's absolute path plus its rendered line. */
13
+ readonly results: readonly {
14
+ readonly source: string;
15
+ readonly excerpt: string;
16
+ }[];
17
+ }
18
+ declare const everythingSearchSchema: Type.TObject<{
19
+ query: Type.TString;
20
+ regex: Type.TOptional<Type.TBoolean>;
21
+ matchCase: Type.TOptional<Type.TBoolean>;
22
+ matchPath: Type.TOptional<Type.TBoolean>;
23
+ wholeWord: Type.TOptional<Type.TBoolean>;
24
+ kind: Type.TOptional<Type.TUnion<[Type.TLiteral<"files">, Type.TLiteral<"folders">]>>;
25
+ path: Type.TOptional<Type.TString>;
26
+ sort: Type.TOptional<Type.TUnion<[Type.TLiteral<"name-ascending">, Type.TLiteral<"name-descending">, Type.TLiteral<"path-ascending">, Type.TLiteral<"path-descending">, Type.TLiteral<"size-ascending">, Type.TLiteral<"size-descending">, Type.TLiteral<"date-modified-ascending">, Type.TLiteral<"date-modified-descending">]>>;
27
+ offset: Type.TOptional<Type.TInteger>;
28
+ maxResults: Type.TOptional<Type.TInteger>;
29
+ }>;
30
+ /**
31
+ * Windows-only instant file/folder name search through the bundled voidtools
32
+ * Everything instance that indexes the configured search folders.
33
+ */
34
+ export declare function createEverythingSearchTool(provider: EverythingSearchProvider): AgentTool<typeof everythingSearchSchema, EverythingSearchDetails>;
35
+ export {};
@@ -0,0 +1,35 @@
1
+ import type { AgentTool } from "@earendil-works/pi-agent-core";
2
+ import { Type } from "typebox";
3
+ import type { FSearchSearchRequest, FSearchSearchResult } from "../fsearch/index.js";
4
+ export declare const FSEARCH_SEARCH_TOOL_NAME = "fsearch_search";
5
+ export interface FSearchSearchProvider {
6
+ searchFsearch(request: FSearchSearchRequest): Promise<FSearchSearchResult>;
7
+ }
8
+ export interface FSearchSearchDetails {
9
+ readonly method: typeof FSEARCH_SEARCH_TOOL_NAME;
10
+ readonly resultCount: number;
11
+ readonly sources: readonly string[];
12
+ /** Retrieval-trace shape: each hit's absolute path plus its rendered line. */
13
+ readonly results: readonly {
14
+ readonly source: string;
15
+ readonly excerpt: string;
16
+ }[];
17
+ }
18
+ declare const fsearchSearchSchema: Type.TObject<{
19
+ query: Type.TString;
20
+ regex: Type.TOptional<Type.TBoolean>;
21
+ matchCase: Type.TOptional<Type.TBoolean>;
22
+ matchPath: Type.TOptional<Type.TBoolean>;
23
+ kind: Type.TOptional<Type.TUnion<[Type.TLiteral<"files">, Type.TLiteral<"folders">]>>;
24
+ path: Type.TOptional<Type.TString>;
25
+ sort: Type.TOptional<Type.TUnion<[Type.TLiteral<"name-ascending">, Type.TLiteral<"name-descending">, Type.TLiteral<"path-ascending">, Type.TLiteral<"path-descending">, Type.TLiteral<"size-ascending">, Type.TLiteral<"size-descending">, Type.TLiteral<"date-modified-ascending">, Type.TLiteral<"date-modified-descending">]>>;
26
+ offset: Type.TOptional<Type.TInteger>;
27
+ maxResults: Type.TOptional<Type.TInteger>;
28
+ }>;
29
+ /**
30
+ * macOS/Linux instant file/folder name search through the user's fsearch-cli
31
+ * (FSearch) database that indexes the configured search folders. Degrades to
32
+ * a bounded slow filesystem walk when fsearch-cli is not installed.
33
+ */
34
+ export declare function createFSearchSearchTool(provider: FSearchSearchProvider): AgentTool<typeof fsearchSearchSchema, FSearchSearchDetails>;
35
+ export {};
@@ -46,6 +46,8 @@ export interface JikjiFindProvider {
46
46
  }): Promise<JikjiFindProviderResult>;
47
47
  }
48
48
  export interface JikjiFindDetails {
49
+ /** Provider diagnostics, including failed roots alongside healthy answers. */
50
+ readonly diagnostics?: readonly JikjiDiagnostic[];
49
51
  readonly method: "jikji_find";
50
52
  readonly answerCount: number;
51
53
  readonly handoffAction: JikjiHandoffAction | undefined;
@@ -1,4 +1,4 @@
1
- export type RefreshProgressPhase = "parsed" | "minsync" | "datasources" | "jikji" | "finalizing";
1
+ export type RefreshProgressPhase = "parsed" | "minsync" | "datasources" | "jikji" | "everything" | "fsearch" | "finalizing";
2
2
  export interface RefreshProgressCounts {
3
3
  readonly scanned: number;
4
4
  readonly written: number;
@@ -10,7 +10,7 @@ export type SearchDocumentDiagnosticSeverity = "info" | "warning" | "error";
10
10
  * (#21/#22) does not require another source-breaking type change; codes not yet
11
11
  * emitted are still valid members.
12
12
  */
13
- export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "minsync-staging-excluded" | "minsync-sync-failed" | "embedder-unavailable" | "embedding-identity-mismatch" | "parser-skipped" | "parser-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "retrieval-method-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit";
13
+ export type SearchDocumentDiagnosticCode = "empty-query" | "no-verified-results" | "unknown-warning" | "caller-tool-dropped" | "minsync-unavailable" | "minsync-staging-excluded" | "minsync-sync-failed" | "embedder-unavailable" | "embedding-identity-mismatch" | "parser-skipped" | "parser-failed" | "parser-warning" | "duplicate-excluded" | "unsupported-file" | "stale-index" | "deleted-mirror" | "pdf-extract-thin" | "retrieval-method-failed" | "rerank-failed" | "jikji-unavailable" | "jikji-prepare-failed" | "jikji-find-failed" | "everything-index-failed" | "fsearch-index-failed" | "fsearch-binary-missing" | "refresh-failed" | "refresh-interrupted" | "watch-failed" | "watch-limited" | "unknown-datasource-skill" | "missing-final-emit" | "model-request-failed";
14
14
  export interface SearchDocumentDiagnostic {
15
15
  readonly code: SearchDocumentDiagnosticCode;
16
16
  readonly severity: SearchDocumentDiagnosticSeverity;
@@ -2,7 +2,7 @@ import { type RefreshMethod } from "../../agent/agent.js";
2
2
  import type { CommandContext } from "./types.js";
3
3
  /**
4
4
  * `autorag refresh` — parse configured search paths and resync every active
5
- * index (parsed mirror, MinSync, datasources, jikji). Model-free: no LLM
5
+ * index (parsed mirror, MinSync, datasources, jikji, and Everything on Windows). Model-free: no LLM
6
6
  * is constructed. Output is rendered through the path-opaque refresh renderer;
7
7
  * the raw result (which carries absolute `indexPath`) is never printed.
8
8
  *
@@ -1,5 +1,5 @@
1
1
  import type { Api, Model } from "@earendil-works/pi-ai";
2
- import type { AutoRAGAgentOptions } from "../agent/agent.js";
2
+ import type { AutoRAGAgentOptions, AutoRAGRetrievalLimits } from "../agent/agent.js";
3
3
  import { type LoadLocalAutoRAGModelOptions } from "../agent/local-model.js";
4
4
  import type { DatasourceAccessContextOptions } from "../datasource/access-context.js";
5
5
  import { type DatasourcesConfig } from "../datasource/skills/factory.js";
@@ -50,6 +50,28 @@ export interface WebSearchCliConfig {
50
50
  timeoutSeconds?: number;
51
51
  } | false;
52
52
  }
53
+ /**
54
+ * Post-merge reranking config. Routes merged evidence through a dedicated
55
+ * rerank model. `provider` is `openrouter` today; `model` is the OpenRouter
56
+ * wire id (default `voyageai/rerank-3-lite`). Secrets never appear here — only
57
+ * the environment-variable name that holds the provider API key.
58
+ */
59
+ export interface RerankConfig {
60
+ /** `false` disables reranking. Missing means enabled when the block is present. */
61
+ enabled?: boolean;
62
+ /** Provider id. @default "openrouter" */
63
+ provider?: string;
64
+ /** Wire model id. @default "voyageai/rerank-3-lite" */
65
+ model?: string;
66
+ /** Environment variable holding the provider API key. @default "OPENROUTER_API_KEY" */
67
+ apiKeyEnv?: string;
68
+ /** Override the provider base URL (e.g. a gateway). */
69
+ baseUrl?: string;
70
+ /** Return only the top N merged results. Omitted ⇒ all distinct results are reordered. */
71
+ topN?: number;
72
+ /** Per-request timeout in milliseconds. */
73
+ timeoutMs?: number;
74
+ }
53
75
  export interface P2pConfig {
54
76
  enabled?: boolean;
55
77
  port?: number;
@@ -81,8 +103,10 @@ export interface AgentModelConfig {
81
103
  */
82
104
  api?: Api;
83
105
  /**
84
- * Endpoint base URL. When set, AutoRAG builds a Model from this config
85
- * instead of requiring a pi-ai catalog entry. Omit for catalog/local models.
106
+ * Endpoint base URL. For a pi-ai catalog `provider/id`, it overrides only the
107
+ * catalog endpoint and keeps the catalog's reasoning, compat, and limits. For an
108
+ * id outside the catalog, AutoRAG builds a generic Model from this config.
109
+ * Omit for catalog/local models that use the catalog endpoint.
86
110
  */
87
111
  baseUrl?: string;
88
112
  /**
@@ -103,7 +127,25 @@ export interface CliConfig {
103
127
  model?: AgentModelConfig;
104
128
  minSync?: MinSyncMethodConfig;
105
129
  jikji?: Record<string, unknown> | false;
130
+ /** Windows-only bundled Everything file-name search. Default enabled on Windows; `false` disables. */
131
+ everything?: {
132
+ enabled?: boolean;
133
+ timeoutMs?: number;
134
+ startupTimeoutMs?: number;
135
+ indexTimeoutMs?: number;
136
+ } | false;
137
+ /** macOS/Linux fsearch-cli file-name search. Default enabled on macOS/Linux; `false` disables. */
138
+ fsearch?: {
139
+ enabled?: boolean;
140
+ binaryPath?: string;
141
+ timeoutMs?: number;
142
+ startupTimeoutMs?: number;
143
+ indexTimeoutMs?: number;
144
+ watch?: boolean;
145
+ } | false;
106
146
  webSearch?: WebSearchCliConfig;
147
+ /** Post-merge reranking. Absent ⇒ reranking disabled. `false` disables it. */
148
+ rerank?: RerankConfig | false;
107
149
  parserOptions?: Record<string, unknown>;
108
150
  dupey?: {
109
151
  enabled?: boolean;
@@ -113,6 +155,8 @@ export interface CliConfig {
113
155
  excludeExactDuplicates?: boolean;
114
156
  /** Absolute or workspace-relative files/directories omitted from local indexing. */
115
157
  excludePaths?: string[];
158
+ /** Hard caps on retrieval, baseline prefetch, and model-facing candidate lists. */
159
+ limits?: AutoRAGRetrievalLimits;
116
160
  /** Trusted datasource skill configuration (skill name → config). */
117
161
  datasources?: DatasourcesConfig;
118
162
  /** Trusted datasource allow-tags/allow-scopes. Absent ⇒ default-deny. */
@@ -151,6 +195,8 @@ export declare function normalizeEmbedder(raw: unknown, path: string): MinSyncEm
151
195
  * {@link ConfigError}.
152
196
  */
153
197
  export declare function normalizeIndexingConfig(raw: RawIndexingMethods): NormalizedIndexingConfig;
198
+ /** Validate the `limits` section and map it onto the agent option. */
199
+ export declare function normalizeLimitsConfig(raw: unknown): AutoRAGRetrievalLimits;
154
200
  export declare function resolveConfig(input: ResolveConfigInput): CliConfig;
155
201
  /**
156
202
  * Resolve config without writing, migrating, or locking. Health and other
@@ -158,6 +204,8 @@ export declare function resolveConfig(input: ResolveConfigInput): CliConfig;
158
204
  * would resolve them but never copied into `~/.autorag/config.json`.
159
205
  */
160
206
  export declare function resolveConfigReadOnly(input: ResolveConfigInput): CliConfig;
207
+ /** Normalize and validate the `rerank` config section, filling in defaults. */
208
+ export declare function normalizeRerankConfig(raw: unknown, path: string): RerankConfig | false;
161
209
  export declare function buildAgentOptions(config: CliConfig): Omit<AutoRAGAgentOptions, "model">;
162
210
  export declare function resolveModel(config: CliConfig): Model<Api>;
163
211
  export interface ResolvedAgentModel {