@autorag/librarian 2.10.3 → 2.10.5
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/NOTICE +3 -0
- package/README.md +39 -5
- package/dist/agent/agent.d.ts +19 -4
- package/dist/agent/answer-guidelines.d.ts +17 -0
- package/dist/agent/pi-session.d.ts +21 -0
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/agent/web-search-tool.d.ts +2 -2
- package/dist/cli/commands/types.d.ts +2 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1218 -725
- package/dist/cli/whatsapp-extension.d.ts +21 -0
- package/dist/core.js +1903 -1482
- package/dist/datasource/sidecar/descriptors.d.ts +1 -0
- package/dist/datasource/skills/lazykatok/skill.d.ts +13 -0
- package/dist/everything/client.d.ts +5 -0
- package/dist/filesystem/path-exclusions.d.ts +2 -0
- package/dist/fsearch/client.d.ts +3 -2
- package/dist/fsearch/walk.d.ts +2 -0
- package/dist/index.js +1887 -1466
- package/dist/mcp/index.js +1887 -1466
- package/dist/minsync/client.d.ts +8 -0
- package/dist/minsync/embedder-config.d.ts +11 -1
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/minsync/kiwi.d.ts +17 -0
- package/dist/minsync/lexical-language.d.ts +18 -0
- package/dist/minsync/types.d.ts +9 -0
- package/dist/web/search/types.d.ts +22 -18
- package/package.json +2 -1
- package/skills/autorag-doctor/SKILL.md +1 -0
- package/skills/autorag-lite-setup/SKILL.md +1 -1
- package/skills/autorag-setup/SKILL.md +1 -1
package/dist/minsync/client.d.ts
CHANGED
|
@@ -38,6 +38,14 @@ export declare class MinSyncClient {
|
|
|
38
38
|
private writeIdentity;
|
|
39
39
|
private identityMismatch;
|
|
40
40
|
sync(force?: boolean, signal?: AbortSignal): Promise<MinSyncSyncResult>;
|
|
41
|
+
/**
|
|
42
|
+
* The tokenizer to run this sync with: always {@link MINSYNC_LEXICAL_LANGUAGE}, which fails every sync when the
|
|
43
|
+
* Kiwi native library is missing. A workspace that is new, or tokenized differently, then gets whitespace
|
|
44
|
+
* tokenization instead and the sync reports `lexicalFallback`. An index already built with the multilingual
|
|
45
|
+
* tokenizer is left alone: switching it would re-embed every chunk, and the probe can miss a library that the OS
|
|
46
|
+
* loader finds on its own.
|
|
47
|
+
*/
|
|
48
|
+
private resolveLexicalLanguage;
|
|
41
49
|
private lockHeldResult;
|
|
42
50
|
private checkAndSync;
|
|
43
51
|
query(text: string, topK: number, mode?: MinSyncQueryMode, signal?: AbortSignal): Promise<readonly MinSyncQueryHit[]>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MinSyncLexicalLanguage } from "./lexical-language.js";
|
|
1
2
|
import type { MinSyncEmbedderConfig } from "./types.js";
|
|
2
3
|
export interface MinSyncEmbeddingIdentity {
|
|
3
4
|
readonly provider: string;
|
|
@@ -23,6 +24,11 @@ export declare function minSyncConfigPath(workspacePath: string): string;
|
|
|
23
24
|
export declare function minSyncEmbeddingIdentityPath(workspacePath: string): string;
|
|
24
25
|
export declare function configuredMaxChunkSize(workspacePath: string): number | undefined;
|
|
25
26
|
export declare function configuredVectorDimension(workspacePath: string): number | undefined;
|
|
27
|
+
/**
|
|
28
|
+
* The BM25 tokenizer in `[lexical].language`, or undefined when there is no config. A config without the section
|
|
29
|
+
* (written before MinSync had one) behaves as MinSync's default, `simple`.
|
|
30
|
+
*/
|
|
31
|
+
export declare function configuredLexicalLanguage(workspacePath: string): string | undefined;
|
|
26
32
|
/**
|
|
27
33
|
* Atomically rewrite allowlisted embedder fields in MinSync config.toml.
|
|
28
34
|
* Reads the existing file, merges the allowlisted fields from `embedder`,
|
|
@@ -32,9 +38,13 @@ export declare function configuredVectorDimension(workspacePath: string): number
|
|
|
32
38
|
* Allowlisted [embedder] fields: id, base_url, query_prefix, passage_prefix,
|
|
33
39
|
* batch_size, max_retries, max_concurrent, timeout_seconds (from timeoutMs / 1000 ceil).
|
|
34
40
|
* Dimension is written under [vectorstore.options] as `dimension`.
|
|
41
|
+
* `managed.maxChunkSize` goes to [chunker.options] and `managed.lexicalLanguage` to [lexical].language. MinSync
|
|
42
|
+
* itself records the tokenizer an index was built with in its cursor and, when [lexical].language differs, deletes
|
|
43
|
+
* and re-indexes every chunk on the next sync, so changing it needs no `--full` from the caller.
|
|
35
44
|
*
|
|
36
45
|
* Returns true if the file was rewritten, false if the file does not exist.
|
|
37
46
|
*/
|
|
38
|
-
export declare function rewriteEmbedderConfig(workspacePath: string, embedder: MinSyncEmbedderConfig,
|
|
47
|
+
export declare function rewriteEmbedderConfig(workspacePath: string, embedder: MinSyncEmbedderConfig, managed?: {
|
|
39
48
|
readonly maxChunkSize?: number;
|
|
49
|
+
readonly lexicalLanguage?: MinSyncLexicalLanguage;
|
|
40
50
|
}): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** What the probe reads, injectable so every platform's layout can be checked from any host. */
|
|
2
|
+
export interface KiwiProbeEnvironment {
|
|
3
|
+
readonly env: NodeJS.ProcessEnv;
|
|
4
|
+
readonly platform: NodeJS.Platform;
|
|
5
|
+
readonly home: string | undefined;
|
|
6
|
+
readonly exists: (path: string) => boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* MinSync's `ko` tokenizer loads the Kiwi native library and its base model at run time (through `kiwi-rs`); neither
|
|
10
|
+
* ships with MinSync. Without them every sync that needs Korean tokenization fails, so AutoRAG checks first.
|
|
11
|
+
*
|
|
12
|
+
* This mirrors the filesystem part of `kiwi-rs`'s discovery (`KIWI_LIBRARY_PATH` / `KIWI_MODEL_PATH`, then the
|
|
13
|
+
* per-user `~/.local/kiwi` install and the well-known system directories). Names left to the OS loader search path
|
|
14
|
+
* are not probed, so a library found only that way reads as missing; point `KIWI_LIBRARY_PATH` at it to fix that.
|
|
15
|
+
* kiwi-rs treats an explicit path as authoritative, and so does this probe.
|
|
16
|
+
*/
|
|
17
|
+
export declare function kiwiAvailable(environment?: KiwiProbeEnvironment): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The BM25 tokenizer presets AutoRAG sets in MinSync's `[lexical].language`. MinSync also has `ko`, `ja`, `zh` and
|
|
3
|
+
* `ar`, which AutoRAG never selects.
|
|
4
|
+
*/
|
|
5
|
+
export type MinSyncLexicalLanguage = "simple" | "multilingual";
|
|
6
|
+
/**
|
|
7
|
+
* The tokenizer AutoRAG always asks MinSync for, whatever the global `languages` setting says.
|
|
8
|
+
*
|
|
9
|
+
* `simple` splits on whitespace only, so a Korean word with a particle (인증서를) never matches its stem (인증서).
|
|
10
|
+
* `ko` fixes that by indexing only Kiwi's morphemes, but then a compound (연구목표) exists only as 연구 and 목표 and an
|
|
11
|
+
* exact-term query loses to documents that merely contain both pieces. `multilingual` indexes the original
|
|
12
|
+
* whitespace-separated words as well as every analyzer's tokens, so exact terms and inflected forms both match. On
|
|
13
|
+
* a sample of real Korean documents (60 stem queries with inflected forms, 40 exact-term queries, BM25 only) it had the
|
|
14
|
+
* best recall on both and kept most of `simple`'s top-5 precision on exact terms, where `ko` lost most of it.
|
|
15
|
+
*
|
|
16
|
+
* The preset needs the Kiwi native library; see `kiwi.ts`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const MINSYNC_LEXICAL_LANGUAGE: MinSyncLexicalLanguage;
|
package/dist/minsync/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Embedder configuration for MinSync vector indexing. Shared by config and method layers. */
|
|
2
|
+
import type { MinSyncLexicalLanguage } from "./lexical-language.js";
|
|
2
3
|
export interface MinSyncEmbedderConfig {
|
|
3
4
|
/** Select an AutoRAG-owned embedding runtime profile. */
|
|
4
5
|
readonly profile?: "qwen3-embedding-0.6b";
|
|
@@ -41,6 +42,14 @@ export interface MinSyncSyncResult {
|
|
|
41
42
|
readonly stagingExcluded?: readonly string[];
|
|
42
43
|
/** Files MinSync skipped (exit 6, `partial`); the sync itself completed and the next sync retries them. */
|
|
43
44
|
readonly filesFailed?: readonly MinSyncFileFailure[];
|
|
45
|
+
/**
|
|
46
|
+
* Set when the multilingual tokenizer needs the Kiwi native library and it was not found, so the index was
|
|
47
|
+
* built with whitespace tokenization instead. The sync itself succeeded.
|
|
48
|
+
*/
|
|
49
|
+
readonly lexicalFallback?: {
|
|
50
|
+
readonly requested: MinSyncLexicalLanguage;
|
|
51
|
+
readonly used: MinSyncLexicalLanguage;
|
|
52
|
+
};
|
|
44
53
|
}
|
|
45
54
|
export interface MinSyncFileFailure {
|
|
46
55
|
readonly path: string;
|
|
@@ -32,10 +32,6 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
32
32
|
readonly value: "xai";
|
|
33
33
|
readonly label: "xAI";
|
|
34
34
|
readonly description: "xAI Responses web_search via the agent's xAI model credentials (XAI_API_KEY)";
|
|
35
|
-
}, {
|
|
36
|
-
readonly value: "perplexity";
|
|
37
|
-
readonly label: "Perplexity";
|
|
38
|
-
readonly description: "Anonymous Perplexity ask endpoint; no key or signup required";
|
|
39
35
|
}, {
|
|
40
36
|
readonly value: "parallel";
|
|
41
37
|
readonly label: "Parallel";
|
|
@@ -44,14 +40,18 @@ export declare const SEARCH_PROVIDER_OPTIONS: readonly [{
|
|
|
44
40
|
readonly value: "searxng";
|
|
45
41
|
readonly label: "SearXNG";
|
|
46
42
|
readonly description: "Advanced: requires a self-hosted SEARXNG_ENDPOINT; never part of the default experience";
|
|
47
|
-
}, {
|
|
48
|
-
readonly value: "startpage";
|
|
49
|
-
readonly label: "Startpage";
|
|
50
|
-
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
51
43
|
}, {
|
|
52
44
|
readonly value: "duckduckgo";
|
|
53
45
|
readonly label: "DuckDuckGo";
|
|
54
46
|
readonly description: "Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs";
|
|
47
|
+
}, {
|
|
48
|
+
readonly value: "perplexity";
|
|
49
|
+
readonly label: "Perplexity";
|
|
50
|
+
readonly description: "Anonymous Perplexity ask endpoint; no key or signup required";
|
|
51
|
+
}, {
|
|
52
|
+
readonly value: "startpage";
|
|
53
|
+
readonly label: "Startpage";
|
|
54
|
+
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
55
55
|
}, {
|
|
56
56
|
readonly value: "ecosia";
|
|
57
57
|
readonly label: "Ecosia";
|
|
@@ -78,8 +78,12 @@ export type SearchProviderId = Exclude<(typeof SEARCH_PROVIDER_OPTIONS)[number][
|
|
|
78
78
|
/**
|
|
79
79
|
* Auto-resolution priority order. Derived from {@link SEARCH_PROVIDER_OPTIONS}
|
|
80
80
|
* (minus `auto`) so any dropdown/setting and `resolveProviderChain()` share
|
|
81
|
-
* one source of truth and never drift apart: credential-
|
|
82
|
-
*
|
|
81
|
+
* one source of truth and never drift apart: model-credential-reusing
|
|
82
|
+
* providers first, then the keyless routes that live probing shows to be
|
|
83
|
+
* healthy and fast (`parallel`, `duckduckgo`; `searxng` sits between them
|
|
84
|
+
* and is skipped unless an endpoint is configured), then the routes that
|
|
85
|
+
* are routinely walled for anonymous clients (`perplexity` sign-up wall,
|
|
86
|
+
* `startpage` Anubis PoW, `ecosia`/`google`/`mojeek` bot challenges), with
|
|
83
87
|
* the public fan-out last (explicit selection only).
|
|
84
88
|
*/
|
|
85
89
|
export declare const SEARCH_PROVIDER_ORDER: readonly SearchProviderId[];
|
|
@@ -100,10 +104,6 @@ export declare const SEARCH_PROVIDER_CHOICES: ({
|
|
|
100
104
|
readonly value: "xai";
|
|
101
105
|
readonly label: "xAI";
|
|
102
106
|
readonly description: "xAI Responses web_search via the agent's xAI model credentials (XAI_API_KEY)";
|
|
103
|
-
} | {
|
|
104
|
-
readonly value: "perplexity";
|
|
105
|
-
readonly label: "Perplexity";
|
|
106
|
-
readonly description: "Anonymous Perplexity ask endpoint; no key or signup required";
|
|
107
107
|
} | {
|
|
108
108
|
readonly value: "parallel";
|
|
109
109
|
readonly label: "Parallel";
|
|
@@ -112,14 +112,18 @@ export declare const SEARCH_PROVIDER_CHOICES: ({
|
|
|
112
112
|
readonly value: "searxng";
|
|
113
113
|
readonly label: "SearXNG";
|
|
114
114
|
readonly description: "Advanced: requires a self-hosted SEARXNG_ENDPOINT; never part of the default experience";
|
|
115
|
-
} | {
|
|
116
|
-
readonly value: "startpage";
|
|
117
|
-
readonly label: "Startpage";
|
|
118
|
-
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
119
115
|
} | {
|
|
120
116
|
readonly value: "duckduckgo";
|
|
121
117
|
readonly label: "DuckDuckGo";
|
|
122
118
|
readonly description: "Credential-free best-effort fallback; may be bot-challenged on datacenter/shared-egress IPs";
|
|
119
|
+
} | {
|
|
120
|
+
readonly value: "perplexity";
|
|
121
|
+
readonly label: "Perplexity";
|
|
122
|
+
readonly description: "Anonymous Perplexity ask endpoint; no key or signup required";
|
|
123
|
+
} | {
|
|
124
|
+
readonly value: "startpage";
|
|
125
|
+
readonly label: "Startpage";
|
|
126
|
+
readonly description: "Credential-free scrape of Startpage (Google-backed) results; may be bot-challenged";
|
|
123
127
|
} | {
|
|
124
128
|
readonly value: "ecosia";
|
|
125
129
|
readonly label: "Ecosia";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorag/librarian",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.5",
|
|
4
4
|
"description": "Self-evolving librarian agent on Pi framework with pluggable retrieval methods",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@earendil-works/pi-ai": "^1.2.0",
|
|
56
56
|
"@earendil-works/pi-coding-agent": "1.2.0",
|
|
57
57
|
"@earendil-works/pi-tui": "1.2.0",
|
|
58
|
+
"@llblab/pi-telegram": "0.57.2",
|
|
58
59
|
"@modelcontextprotocol/server": "^2.3.1",
|
|
59
60
|
"@openrouter/sdk": "^1.4.25",
|
|
60
61
|
"chardet": "^2.2.0",
|
|
@@ -223,6 +223,7 @@ to retry those files once without re-indexing healthy ones.
|
|
|
223
223
|
| `minsync-sync-failed` | MinSync indexing failed; the message carries MinSync's own reason | Fix the reported cause, then `autorag refresh --method minsync` |
|
|
224
224
|
| `minsync-file-skipped` | MinSync skipped one file (unreadable, unparsable, or rejected by the embedder) and kept its older chunks; retried on the next sync | Fix that file's permissions/content, then `autorag refresh --method minsync` |
|
|
225
225
|
| `minsync-lock-held` | Another `minsync` run holds `.minsync/lock`, often an orphan left by a killed host; retryable | Wait for it to finish or stop that `minsync` process, then `autorag refresh --method minsync` |
|
|
226
|
+
| `lexical-tokenizer-unavailable` | Warning: the BM25 tokenizer needs the Kiwi library and model, which were not found, so MinSync tokenizes on whitespace and `인증서를` does not match `인증서` | Install Kiwi (set `KIWI_LIBRARY_PATH` and `KIWI_MODEL_PATH`, or install under `~/.local/kiwi`), then `autorag refresh --method minsync` |
|
|
226
227
|
| `jikji-unavailable` | Jikji binary missing or install failed | Check cargo, retry refresh |
|
|
227
228
|
| `everything-index-failed` | Windows Everything instance could not start or index; message carries ES exit code and stderr | Fix the reported cause, `autorag refresh --method everything --json` |
|
|
228
229
|
| `embedding-identity-mismatch` | Indexed vectors use a different embedder | `autorag index rebuild --method minsync` |
|
|
@@ -169,7 +169,7 @@ AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json autorag lite refresh --jso
|
|
|
169
169
|
are missing or broken, run a full refresh or return to setup rather than
|
|
170
170
|
silently degrading to lexical-only search.
|
|
171
171
|
- MinSync's default embedder is in-process native Qwen3 embeddings
|
|
172
|
-
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.
|
|
172
|
+
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.10): no
|
|
173
173
|
embedder flags, no API key, and no external daemon (such as Ollama) are
|
|
174
174
|
needed, and no corpus text leaves the machine. For gateway-profiled
|
|
175
175
|
embeddings, prefetch with `autorag models prefetch --profile qwen3-embedding-0.6b`.
|
|
@@ -190,7 +190,7 @@ told duplicate exclusion is off. Set `"excludeExactDuplicates": false` to
|
|
|
190
190
|
index every copy.
|
|
191
191
|
|
|
192
192
|
MinSync's default embedder is in-process native Qwen3 embeddings
|
|
193
|
-
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.
|
|
193
|
+
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.10). The
|
|
194
194
|
default needs no embedder flags, no API key, and no external daemon (such as
|
|
195
195
|
Ollama) — all embeddings run in-process locally and privately. For workspaces
|
|
196
196
|
using the loopback llama-server gateway, prefetch the verified model with
|