@autorag/librarian 2.2.0 → 2.4.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 +194 -47
- package/dist/agent/agent.d.ts +34 -47
- package/dist/agent/bash-tool.d.ts +2 -11
- package/dist/agent/dupey-tool.d.ts +15 -0
- package/dist/agent/emit-results-tool.d.ts +14 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/local-model.d.ts +12 -0
- package/dist/agent/search-bm25-tool.d.ts +11 -3
- package/dist/agent/search-documents.d.ts +2 -2
- package/dist/agent/search-minsync-tool.d.ts +2 -2
- package/dist/agent/system-prompt.d.ts +1 -2
- package/dist/cli/commands/duplicates.d.ts +4 -0
- package/dist/cli/commands/health.d.ts +9 -65
- package/dist/cli/commands/index.d.ts +3 -3
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/commands/tui.d.ts +36 -0
- package/dist/cli/commands/ui.d.ts +13 -0
- package/dist/cli/config.d.ts +27 -22
- package/dist/cli/index.js +14965 -12563
- package/dist/cli/tui-commands.d.ts +16 -0
- package/dist/cli/tui-session-store.d.ts +16 -0
- package/dist/datasource/access-context.d.ts +6 -12
- package/dist/datasource/aliased-skill.d.ts +28 -0
- package/dist/datasource/chunk-store.d.ts +2 -0
- package/dist/datasource/connector-skill.d.ts +3 -0
- package/dist/datasource/connector.d.ts +4 -0
- package/dist/datasource/crawler-skill.d.ts +6 -0
- package/dist/datasource/crawler-types.d.ts +2 -0
- package/dist/datasource/described-skill.d.ts +17 -0
- package/dist/datasource/index.d.ts +4 -2
- package/dist/datasource/result-filter.d.ts +2 -1
- package/dist/datasource/skills/clawgallery/client.d.ts +9 -0
- package/dist/datasource/skills/clawgallery/index.d.ts +5 -0
- package/dist/datasource/skills/clawgallery/methods.d.ts +19 -0
- package/dist/datasource/skills/clawgallery/paths.d.ts +7 -0
- package/dist/datasource/skills/clawgallery/skill.d.ts +35 -0
- package/dist/datasource/skills/clawgallery/types.d.ts +58 -0
- package/dist/datasource/skills/cloud-drive/index.d.ts +2 -0
- package/dist/datasource/skills/cloud-drive/rclone-connector.d.ts +47 -0
- package/dist/datasource/skills/cloud-drive/skill.d.ts +14 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +3 -0
- package/dist/datasource/skills/discrawl/types.d.ts +4 -8
- package/dist/datasource/skills/factory.d.ts +9 -0
- package/dist/datasource/skills/gmail/himalaya-connector.d.ts +12 -1
- package/dist/datasource/skills/katok/methods.d.ts +6 -4
- package/dist/datasource/skills/katok/types.d.ts +8 -26
- package/dist/datasource/skills/mailcrawl/client.d.ts +15 -0
- package/dist/datasource/skills/mailcrawl/config.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/index.d.ts +4 -0
- package/dist/datasource/skills/mailcrawl/methods.d.ts +15 -0
- package/dist/datasource/skills/mailcrawl/skill.d.ts +34 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +71 -0
- package/dist/datasource/skills/obsidian/skill.d.ts +2 -0
- package/dist/datasource/skills/obsidian/types.d.ts +2 -0
- package/dist/datasource/types.d.ts +5 -2
- package/dist/dupey/cli.d.ts +40 -0
- package/dist/dupey/filter.d.ts +8 -0
- package/dist/dupey/index.d.ts +2 -0
- package/dist/filesystem/cloud-placeholder.d.ts +26 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8889 -9292
- package/dist/jikji/client.d.ts +1 -0
- package/dist/memory/check-memory-tool.d.ts +1 -0
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/memory.d.ts +33 -3
- package/dist/memory/renderer.d.ts +2 -1
- package/dist/minsync/client.d.ts +5 -1
- package/dist/minsync/embedder-config.d.ts +4 -1
- package/dist/minsync/index.d.ts +4 -4
- package/dist/minsync/installer.d.ts +1 -0
- package/dist/minsync/method.d.ts +22 -1
- package/dist/minsync/types.d.ts +5 -0
- package/dist/mirror/sync.d.ts +3 -1
- package/dist/observability/run-log.d.ts +1 -26
- package/dist/parser/defaults.d.ts +2 -0
- package/dist/parser/index.d.ts +2 -2
- package/dist/parser/opendataloader-pdf.d.ts +10 -0
- package/dist/parser/types.d.ts +7 -0
- package/dist/process/portable-spawn.d.ts +10 -0
- package/dist/retrieval/index.d.ts +2 -2
- package/dist/retrieval/methods/bm25.d.ts +7 -36
- package/dist/ui/browse.d.ts +11 -0
- package/dist/ui/catalog.d.ts +59 -0
- package/dist/ui/config-store.d.ts +43 -0
- package/dist/ui/discover.d.ts +19 -0
- package/dist/ui/html.d.ts +2 -0
- package/dist/ui/probe.d.ts +24 -0
- package/dist/ui/prompt.d.ts +21 -0
- package/dist/ui/server.d.ts +28 -0
- package/package.json +17 -15
- package/skills/autorag/SKILL.md +79 -108
- package/skills/autorag-setup/SKILL.md +170 -395
- package/dist/datasource/skills/discrawl/config.d.ts +0 -9
- package/dist/datasource/skills/gdrive/connector.d.ts +0 -30
- package/dist/datasource/skills/gdrive/index.d.ts +0 -3
- package/dist/datasource/skills/gdrive/rclone-connector.d.ts +0 -51
- package/dist/datasource/skills/gdrive/skill.d.ts +0 -24
- package/dist/subagents/contracts.d.ts +0 -90
- package/dist/subagents/dispatch-templates.d.ts +0 -104
- package/dist/subagents/dispatch-validation.d.ts +0 -169
- package/dist/subagents/explorer-tools-extension.d.ts +0 -4
- package/dist/subagents/explorer-tools-extension.js +0 -130
- package/dist/subagents/local-models.d.ts +0 -14
- package/dist/subagents/model-policy.d.ts +0 -31
- package/dist/subagents/runtime.d.ts +0 -52
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorag/librarian",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Self-evolving librarian agent on Pi framework with pluggable retrieval methods",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,39 +28,41 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "bun build src/index.ts src/cli/index.ts
|
|
31
|
+
"build": "bun build src/index.ts src/cli/index.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
|
|
32
32
|
"prepublishOnly": "bun run typecheck && bun run build",
|
|
33
33
|
"prepare": "bun run build",
|
|
34
|
-
"test": "
|
|
34
|
+
"test": "node scripts/run-test-files.mjs",
|
|
35
|
+
"test:windows": "node scripts/run-test-files.mjs",
|
|
35
36
|
"check": "biome check --write .",
|
|
37
|
+
"lint": "biome check .",
|
|
36
38
|
"typecheck": "tsc --noEmit"
|
|
37
39
|
},
|
|
38
40
|
"engines": {
|
|
39
41
|
"node": ">=24.0.0"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@earendil-works/pi-agent-core": "^0.84.
|
|
43
|
-
"@earendil-works/pi-ai": "^0.84.
|
|
44
|
-
"@earendil-works/pi-coding-agent": "0.84.
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
44
|
+
"@earendil-works/pi-agent-core": "^0.84.4",
|
|
45
|
+
"@earendil-works/pi-ai": "^0.84.4",
|
|
46
|
+
"@earendil-works/pi-coding-agent": "0.84.4",
|
|
47
|
+
"@earendil-works/pi-tui": "0.84.4",
|
|
48
|
+
"@opendataloader/pdf": "^2.5.7",
|
|
47
49
|
"@rhwp/core": "0.8.4",
|
|
48
50
|
"chardet": "^2.2.0",
|
|
49
|
-
"fast-xml-parser": "^5.11.
|
|
51
|
+
"fast-xml-parser": "^5.11.1",
|
|
50
52
|
"iconv-lite": "^0.7.3",
|
|
51
53
|
"jszip": "^3.10.1",
|
|
52
|
-
"mailparser": "^3.9.
|
|
53
|
-
"
|
|
54
|
-
"slides-grab": "^1.5.0",
|
|
54
|
+
"mailparser": "^3.9.20",
|
|
55
|
+
"slides-grab": "^1.5.1",
|
|
55
56
|
"smol-toml": "1.8.0",
|
|
56
57
|
"tesseract.js": "^7.0.0",
|
|
57
|
-
"typebox": "^1.3.
|
|
58
|
+
"typebox": "^1.3.25",
|
|
59
|
+
"xlsx": "^0.18.5",
|
|
58
60
|
"yaml": "^2.9.0"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
|
-
"@biomejs/biome": "2.5.
|
|
63
|
+
"@biomejs/biome": "2.5.12",
|
|
62
64
|
"@types/mailparser": "^3.4.6",
|
|
63
|
-
"@types/node": "^26.
|
|
65
|
+
"@types/node": "^26.4.1",
|
|
64
66
|
"typescript": "^7.0.2",
|
|
65
67
|
"vitest": "^4.1.11"
|
|
66
68
|
}
|
package/skills/autorag/SKILL.md
CHANGED
|
@@ -1,149 +1,120 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag
|
|
3
|
-
description:
|
|
3
|
+
description: Search, summarize, compare, and answer questions from an already configured AutoRAG librarian over local documents and authorized datasources. Use when the user asks AutoRAG to search PDFs, wikis, notes, or a knowledge base. Use autorag-setup for install, model, roots, indexing, or datasource changes.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# AutoRAG Librarian Skill
|
|
7
8
|
|
|
8
9
|
Use this skill when AutoRAG is already configured and the user asks to search,
|
|
9
10
|
summarize, compare, or answer questions from local PDFs, wikis, notes, research
|
|
10
|
-
papers,
|
|
11
|
-
settings, subscription or API-provider detection, or changing indexed folders,
|
|
12
|
-
use the `autorag-setup` skill instead.
|
|
11
|
+
papers, knowledge bases, or authorized datasources.
|
|
13
12
|
|
|
14
|
-
AutoRAG is
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
AutoRAG is the specialized librarian agent. One configured model plans the
|
|
14
|
+
search, calls BM25, MinSync, Jikji, datasource, and filesystem tools, reads
|
|
15
|
+
sources, judges evidence, and curates the final answer. There is no subagent or
|
|
16
|
+
separate model role.
|
|
17
|
+
|
|
18
|
+
AutoRAG reads source documents and writes indexes only under the configured
|
|
19
|
+
workspace `.autorag/` directory and Jikji's per-source `.jikji/` caches. Never
|
|
20
|
+
move, rename, edit, or delete source files.
|
|
18
21
|
|
|
19
22
|
## Preflight
|
|
20
23
|
|
|
21
|
-
Confirm
|
|
22
|
-
|
|
23
|
-
`searchPaths
|
|
24
|
+
Confirm a config exists at `--config`, `AUTORAG_CONFIG`,
|
|
25
|
+
`$AUTORAG_HOME/config.json`, or `~/.autorag/config.json`. Inspect only
|
|
26
|
+
non-secret `searchPaths` and `model` metadata, then run:
|
|
24
27
|
|
|
25
28
|
```bash
|
|
26
|
-
autorag
|
|
27
|
-
autorag
|
|
29
|
+
autorag duplicates --json
|
|
30
|
+
autorag status --json
|
|
31
|
+
autorag health --json
|
|
28
32
|
```
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
### Duplicate-file review
|
|
35
|
+
|
|
36
|
+
Use `autorag duplicates` when the user asks to find duplicate files, choose
|
|
37
|
+
likely latest copies, or reduce corpus/index space. The command and the
|
|
38
|
+
`scan_duplicate_documents` Agent tool are read-only and never delete or move
|
|
39
|
+
source files. Exact means dupey's canonical extracted-text hash matches;
|
|
40
|
+
near/contains families require human review. Exact duplicate exclusion during
|
|
41
|
+
refresh is enabled by default and can be disabled with
|
|
42
|
+
`"excludeExactDuplicates": false` in `config.json`.
|
|
43
|
+
|
|
44
|
+
`status` is model-free and path-opaque. `health` resolves the single model,
|
|
45
|
+
checks credential presence, and normally probes one live completion. If the
|
|
46
|
+
model, authentication, configuration, or indexes are unhealthy, use
|
|
47
|
+
`autorag-setup` rather than guessing private provider details.
|
|
38
48
|
|
|
39
|
-
|
|
49
|
+
BM25, MinSync, and Jikji should normally be healthy. MinSync and Jikji
|
|
50
|
+
auto-install on first use by default. If they are missing or stale, run a full
|
|
51
|
+
`autorag refresh` or return to setup rather than silently degrading to
|
|
52
|
+
lexical-only search.
|
|
53
|
+
|
|
54
|
+
## Search
|
|
55
|
+
|
|
56
|
+
Prefer `--json --debug` when another agent will consume the result or record
|
|
57
|
+
feedback. `--json` alone omits `sessionId`. `--debug` adds session/diagnostics
|
|
58
|
+
fields and does not print filesystem paths.
|
|
40
59
|
|
|
41
60
|
```bash
|
|
42
|
-
autorag search "what were the key findings in the Q3 report" --top-k 5
|
|
61
|
+
autorag search "what were the key findings in the Q3 report" --top-k 5 --json --debug
|
|
43
62
|
```
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
`
|
|
64
|
+
`--json --debug` includes `answer`, numbered `results` (`number`, `title`,
|
|
65
|
+
`summary`, optional `source`), and `sessionId`. Use that `sessionId` for
|
|
66
|
+
feedback. `--json` without `--debug` is only `answer` plus `results`.
|
|
47
67
|
|
|
48
|
-
- `--scope`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- `--
|
|
68
|
+
- `--scope` narrows datasource retrieval to a requested sub-path; it cannot
|
|
69
|
+
grant access.
|
|
70
|
+
- `--tags` further narrows already-authorized datasource results and never
|
|
71
|
+
grants new access.
|
|
72
|
+
- `--json` is required for programmatic consumption.
|
|
73
|
+
- `--debug` is required for `sessionId`, evidence, and diagnostics.
|
|
53
74
|
|
|
54
|
-
Do not bypass
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
error output includes a hint pointing to `autorag health` for diagnosis.
|
|
75
|
+
Do not bypass the librarian with ad hoc raw search when the user requested
|
|
76
|
+
AutoRAG. The search loop can use Jikji, BM25, MinSync, datasource retrieval, and
|
|
77
|
+
direct source reading as appropriate. If search fails because of model,
|
|
78
|
+
provider, auth, or timeout problems, diagnose with `autorag health --json`.
|
|
59
79
|
|
|
60
|
-
Record feedback so retrieval memory
|
|
80
|
+
Record feedback so retrieval memory can learn. Numbers refer to the returned
|
|
81
|
+
knowledge units. Supply at least one feedback list:
|
|
61
82
|
|
|
62
83
|
```bash
|
|
63
|
-
autorag feedback <sessionId> --useful 1,3 --not-useful 2
|
|
84
|
+
autorag feedback <sessionId> --useful 1,3 --not-useful 2 --json
|
|
64
85
|
```
|
|
65
86
|
|
|
66
|
-
Supply at least one of `--useful` or `--not-useful`. Numbers refer to the
|
|
67
|
-
numbered knowledge units from that session's search output.
|
|
68
|
-
|
|
69
87
|
## Maintenance
|
|
70
88
|
|
|
71
89
|
```bash
|
|
72
|
-
autorag status
|
|
73
|
-
autorag health
|
|
74
|
-
autorag refresh
|
|
75
|
-
autorag refresh --method bm25,minsync
|
|
76
|
-
autorag watch --once
|
|
90
|
+
autorag status --json
|
|
91
|
+
autorag health --json
|
|
92
|
+
autorag refresh --json
|
|
93
|
+
autorag refresh --method bm25,minsync,jikji --json
|
|
94
|
+
autorag watch --once --json
|
|
77
95
|
autorag watch
|
|
78
|
-
autorag refresh --force
|
|
79
|
-
autorag index rebuild --yes
|
|
80
|
-
autorag index reset --method bm25 --yes
|
|
81
|
-
autorag memory inspect
|
|
96
|
+
autorag refresh --force --json
|
|
97
|
+
autorag index rebuild --yes --json
|
|
98
|
+
autorag index reset --method bm25 --yes --json
|
|
99
|
+
autorag memory inspect --json
|
|
82
100
|
```
|
|
83
101
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
by default — no explicit configuration is needed for standard lexical + semantic
|
|
91
|
-
retrieval. MinSync uses a pre-installed binary (`autoInstall: false`); configure
|
|
92
|
-
`minSync.embedder` via `autorag init --embedder-*` flags for remote embedding.
|
|
93
|
-
|
|
94
|
-
### Keep indexes fresh on a schedule (agent responsibility)
|
|
95
|
-
|
|
96
|
-
There is **no always-on network service** in the CLI. Agents and operators must
|
|
97
|
-
install an OS-appropriate periodic job that runs a model-free index tick:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Preferred scheduled command (single non-daemon refresh)
|
|
101
|
-
NODE_OPTIONS=--max-old-space-size=16384 autorag watch --once
|
|
102
|
-
# Equivalent one-shot refresh
|
|
103
|
-
NODE_OPTIONS=--max-old-space-size=16384 autorag refresh
|
|
104
|
-
```
|
|
102
|
+
Prefer a full refresh so parsed mirrors, BM25, MinSync, Jikji, and configured
|
|
103
|
+
datasources stay aligned. `--method` accepts
|
|
104
|
+
`parsed,bm25,minsync,datasources,jikji,all`. Use it only for deliberate
|
|
105
|
+
narrowing. Scheduled maintenance should use non-daemon `autorag watch --once`,
|
|
106
|
+
typically every 15–30 minutes, with the same config used by search and no
|
|
107
|
+
overlapping runs.
|
|
105
108
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
| OS | Preferred scheduler | Pattern |
|
|
110
|
-
|---|---|---|
|
|
111
|
-
| macOS | `cron` or `launchd` (`~/Library/LaunchAgents`) | `*/30 * * * * ... autorag watch --once` or a KeepAlive=false StartInterval plist |
|
|
112
|
-
| Linux | `cron` / `systemd --user` timer | crontab `*/30 * * * *` or a oneshot service + timer |
|
|
113
|
-
| Windows | Task Scheduler | repeating task every 30 minutes running `autorag watch --once` under the user profile |
|
|
114
|
-
|
|
115
|
-
Rules for scheduled watch:
|
|
116
|
-
|
|
117
|
-
1. Prefer `autorag watch --once` (or `autorag refresh`) over a permanent
|
|
118
|
-
long-running `autorag watch` daemon in user agents — daemons die on reboot
|
|
119
|
-
and are harder to supervise from skill workflows.
|
|
120
|
-
2. Use the same config the search path uses (`~/.autorag/config.json` or an
|
|
121
|
-
explicit `--config` / `AUTORAG_CONFIG`).
|
|
122
|
-
3. Raise Node heap for large home trees: `NODE_OPTIONS=--max-old-space-size=16384`.
|
|
123
|
-
4. Redirect logs somewhere under the home/user temp tree, never into source
|
|
124
|
-
document folders.
|
|
125
|
-
5. After install/setup, **create or verify** the scheduled job before claiming
|
|
126
|
-
ongoing indexing is covered. Re-check with `crontab -l`, `systemctl --user list-timers`,
|
|
127
|
-
or Task Scheduler inspection when the user asks about freshness.
|
|
128
|
-
6. Do not schedule concurrent overlapping ticks; if a prior refresh is still
|
|
129
|
-
running, skip or wait (lock/log rather than stampeding MiniSync/BM25 writers).
|
|
130
|
-
|
|
131
|
-
Destructive index commands:
|
|
132
|
-
|
|
133
|
-
- `autorag index reset --yes` removes parsed, BM25, and MinSync directories under
|
|
134
|
-
workspace `.autorag` only. Add `--method bm25|minsync|parsed` to scope which
|
|
135
|
-
indexes are removed (e.g. `--method bm25` removes only the BM25 index).
|
|
136
|
-
- `autorag index rebuild --yes` resets those indexes then forced-refreshes.
|
|
137
|
-
`--method` scopes both the reset and the rebuild refresh.
|
|
138
|
-
|
|
139
|
-
Never run reset/rebuild against source documents. `memory inspect` is
|
|
140
|
-
read-only and path-opaque.
|
|
109
|
+
Reset and rebuild commands remove only selected workspace `.autorag` indexes.
|
|
110
|
+
Never target source documents. `memory inspect` is read-only and path-opaque.
|
|
141
111
|
|
|
142
112
|
## Rules
|
|
143
113
|
|
|
144
114
|
- Use only configured and approved search paths.
|
|
145
115
|
- Never expose provider credentials or authentication payloads.
|
|
146
|
-
- Never invent
|
|
147
|
-
-
|
|
116
|
+
- Never invent provider identities or model ids.
|
|
117
|
+
- A Pi-usable subscription is valid; a subscription Pi cannot invoke is not.
|
|
148
118
|
- Preserve real source mapping and numbered feedback identifiers.
|
|
149
|
-
- Prefer `--json` when another agent
|
|
119
|
+
- Prefer `--json --debug` when another agent consumes search output or will
|
|
120
|
+
call `autorag feedback`.
|