@autorag/librarian 2.5.1 → 2.5.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.
- package/NOTICE +3 -0
- package/README.md +230 -490
- package/dist/agent/agent.d.ts +40 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/search-single-datasource-tool.d.ts +63 -0
- package/dist/agent/web-fetch-tool.d.ts +32 -0
- package/dist/agent/web-search-tool.d.ts +48 -0
- package/dist/cli/commands/lite-retrieve.d.ts +15 -0
- package/dist/cli/commands/search.d.ts +6 -0
- package/dist/cli/config.d.ts +20 -0
- package/dist/cli/index.js +17643 -10464
- package/dist/core.d.ts +3 -1
- package/dist/core.js +11081 -3945
- package/dist/datasource/connector-skill.d.ts +6 -0
- package/dist/datasource/crawler-skill.d.ts +2 -0
- package/dist/datasource/errors.d.ts +26 -0
- package/dist/datasource/index.d.ts +3 -2
- package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +2 -2
- package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
- package/dist/datasource/skills/github-gist/index.d.ts +3 -0
- package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
- package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
- package/dist/datasource/skills/lark/client.d.ts +23 -0
- package/dist/datasource/skills/lark/index.d.ts +2 -0
- package/dist/datasource/skills/lark/skill.d.ts +36 -0
- package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
- package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
- package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
- package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
- package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
- package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
- package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
- package/dist/datasource/skills/slack/index.d.ts +8 -0
- package/dist/datasource/tool-naming.d.ts +11 -0
- package/dist/datasource/types.d.ts +4 -4
- package/dist/embedding-runtime/manifest.d.ts +8 -0
- package/dist/embedding-runtime/types.d.ts +4 -0
- package/dist/index.js +11598 -4461
- package/dist/minsync/types.d.ts +7 -0
- package/dist/process/terminate-tree.d.ts +2 -0
- package/dist/retrieval/engine.d.ts +14 -5
- package/dist/retrieval/index.d.ts +2 -1
- package/dist/retrieval/merger.d.ts +30 -5
- package/dist/retrieval/skip.d.ts +41 -0
- package/dist/retrieval/types.d.ts +24 -3
- package/dist/web/entities.d.ts +10 -0
- package/dist/web/fetch/convert.d.ts +35 -0
- package/dist/web/fetch/feeds.d.ts +37 -0
- package/dist/web/fetch/html-renderer.d.ts +54 -0
- package/dist/web/fetch/index.d.ts +12 -0
- package/dist/web/fetch/negotiate.d.ts +27 -0
- package/dist/web/fetch/page-loader.d.ts +60 -0
- package/dist/web/fetch/render.d.ts +23 -0
- package/dist/web/fetch/turndown/gfm.d.ts +11 -0
- package/dist/web/fetch/turndown/html.d.ts +5 -0
- package/dist/web/fetch/turndown/index.d.ts +10 -0
- package/dist/web/fetch/turndown/service.d.ts +21 -0
- package/dist/web/fetch/turndown/types.d.ts +73 -0
- package/dist/web/fetch/url-target.d.ts +29 -0
- package/dist/web/search/browser-headers.d.ts +17 -0
- package/dist/web/search/browser-loader.d.ts +56 -0
- package/dist/web/search/browser-page.d.ts +41 -0
- package/dist/web/search/credentials.d.ts +10 -0
- package/dist/web/search/format.d.ts +30 -0
- package/dist/web/search/index.d.ts +46 -0
- package/dist/web/search/model-auth.d.ts +36 -0
- package/dist/web/search/provider.d.ts +62 -0
- package/dist/web/search/providers/anthropic.d.ts +9 -0
- package/dist/web/search/providers/base.d.ts +106 -0
- package/dist/web/search/providers/codex.d.ts +9 -0
- package/dist/web/search/providers/duckduckgo.d.ts +22 -0
- package/dist/web/search/providers/ecosia.d.ts +29 -0
- package/dist/web/search/providers/gemini.d.ts +9 -0
- package/dist/web/search/providers/google.d.ts +22 -0
- package/dist/web/search/providers/mojeek.d.ts +24 -0
- package/dist/web/search/providers/parallel.d.ts +10 -0
- package/dist/web/search/providers/perplexity.d.ts +10 -0
- package/dist/web/search/providers/public.d.ts +15 -0
- package/dist/web/search/providers/responses-api.d.ts +26 -0
- package/dist/web/search/providers/searxng.d.ts +19 -0
- package/dist/web/search/providers/startpage.d.ts +25 -0
- package/dist/web/search/providers/utils.d.ts +39 -0
- package/dist/web/search/providers/xai.d.ts +9 -0
- package/dist/web/search/query.d.ts +193 -0
- package/dist/web/search/types.d.ts +198 -0
- package/dist/web/search/utils.d.ts +8 -0
- package/licenses/embedding-assets.json +20 -4
- package/package.json +2 -1
- package/skills/autorag/SKILL.md +2 -1
- package/skills/autorag-doctor/SKILL.md +238 -0
- package/skills/autorag-lite-search/SKILL.md +29 -7
- package/skills/autorag-lite-setup/SKILL.md +22 -15
- package/skills/autorag-setup/SKILL.md +40 -19
- package/dist/agent/search-datasource-tool.d.ts +0 -29
- package/dist/datasource/skills/katok/client.d.ts +0 -21
- package/dist/datasource/skills/katok/index.d.ts +0 -12
- package/dist/datasource/skills/katok/paths.d.ts +0 -40
- package/dist/datasource/skills/katok/types.d.ts +0 -123
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autorag-doctor
|
|
3
|
+
description: Diagnose and repair a broken or half-working AutoRAG install so every configured source is both indexed and searchable. Checks AutoRAG, MinSync, Jikji, the embedding gateway, and every CLI-backed datasource (lazykatok, discrawl, slacrawl, wacrawl, telecrawl, notcrawl, qmd, mailcrawl, rclone, Spotlight), then fixes orphan locks, orphan processes, embedding dimension or identity mismatches, stale indexes, and missing setup. Use when search returns nothing or too little, refresh hangs or fails, a datasource disappeared from results, indexes look stale, the gateway will not start, or the user asks to check, diagnose, verify, or repair AutoRAG.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# AutoRAG doctor
|
|
8
|
+
|
|
9
|
+
Goal: every configured datasource is **indexed** *and* **actually returns
|
|
10
|
+
hits**. A green `status` is not enough — the run is done only when a real query
|
|
11
|
+
returns a real hit per datasource, or the datasource is reported as genuinely
|
|
12
|
+
empty or not configured.
|
|
13
|
+
|
|
14
|
+
Always finish with the status table in [Report](#report).
|
|
15
|
+
|
|
16
|
+
## Safety
|
|
17
|
+
|
|
18
|
+
- Never delete, move, or edit source documents.
|
|
19
|
+
- Never delete a datasource's **native** store (`~/Library/Application Support/katok`, `~/.discrawl`,
|
|
20
|
+
`~/.mailcrawl`, `.qmd`, Telegram/WhatsApp/Notion archives). AutoRAG only
|
|
21
|
+
reads them; rebuilding them is the owning CLI's job.
|
|
22
|
+
- Only AutoRAG-owned state under `AUTORAG_HOME` and the workspace `.autorag`
|
|
23
|
+
directory may be reset.
|
|
24
|
+
- Never print token or password values. Report credential **names** only.
|
|
25
|
+
- Kill a process only after confirming it is an AutoRAG-owned orphan.
|
|
26
|
+
|
|
27
|
+
## 1. Triage the core
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
autorag status --json
|
|
31
|
+
autorag health --json
|
|
32
|
+
autorag gateway status --format json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- `status` reports `state`, `stale`, `diagnostics`, and per-component state for
|
|
36
|
+
`minsync`, `jikji`, and `datasources`. `stale: true` or any `stale-index`
|
|
37
|
+
diagnostic means the corpus changed since the last successful refresh.
|
|
38
|
+
- `health` resolves the single search model and does one live completion probe.
|
|
39
|
+
`--skip-probes` only proves config shape, never live access; do not claim a
|
|
40
|
+
healthy model from it.
|
|
41
|
+
- The gateway is on-demand: `stopped` is normal when nothing is embedding.
|
|
42
|
+
`unavailable` **while** a refresh is running is a real failure.
|
|
43
|
+
|
|
44
|
+
Config lives at `--config`, `AUTORAG_CONFIG`, `$AUTORAG_HOME/config.json`, or
|
|
45
|
+
`~/.autorag/config.json`. Read `searchPaths`, `workspacePath`, `minSync`,
|
|
46
|
+
`jikji`, `datasources`, and `datasourceAccess` before changing anything.
|
|
47
|
+
|
|
48
|
+
If the CLI itself is missing or the config does not exist, stop and run the
|
|
49
|
+
`autorag-setup` skill first — doctor repairs an existing install, it does not
|
|
50
|
+
create one.
|
|
51
|
+
|
|
52
|
+
## 2. Probe every datasource natively
|
|
53
|
+
|
|
54
|
+
Each CLI owns its archive, so ask the CLI, not AutoRAG. A datasource is only
|
|
55
|
+
`active` when its binary exists, its store is present, and its own check passes.
|
|
56
|
+
|
|
57
|
+
| Datasource | Native check | Re-sync when empty or stale |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| MinSync (local docs) | `minsync status`, `minsync check`, `minsync verify` | `autorag refresh --method minsync` |
|
|
60
|
+
| Jikji (discovery) | `jikji doctor` | `autorag refresh --method jikji` |
|
|
61
|
+
| KakaoTalk | `lazykatok doctor` | `lazykatok sync && lazykatok index` |
|
|
62
|
+
| Discord | `discrawl --json metadata` | `discrawl sync` |
|
|
63
|
+
| Slack | `slacrawl --json doctor` | `slacrawl sync` |
|
|
64
|
+
| WhatsApp | `wacrawl --json doctor` | `wacrawl import` |
|
|
65
|
+
| Telegram | `telecrawl --json doctor`, `telecrawl --json status` | `telecrawl import` |
|
|
66
|
+
| Notion | `notcrawl doctor`, `notcrawl status` | `notcrawl sync --source desktop` |
|
|
67
|
+
| Obsidian / notes | `qmd status` | `qmd update && qmd embed` |
|
|
68
|
+
| Mail | `mailcrawl doctor`, `mailcrawl status` | `mailcrawl sync && mailcrawl index` |
|
|
69
|
+
| Cloud drive | `rclone listremotes` | `autorag refresh --method datasources` |
|
|
70
|
+
| Spotlight (macOS) | `mdutil -s /` | indexed by the OS; no AutoRAG sync |
|
|
71
|
+
| Lark / Feishu | `lark-cli auth status --format json` | no local sync; search is remote |
|
|
72
|
+
|
|
73
|
+
Rules:
|
|
74
|
+
|
|
75
|
+
- A missing binary is **not configured**, not a failure. Report it with the
|
|
76
|
+
install command and move on.
|
|
77
|
+
- An empty store is a legitimate zero-hit result. `telecrawl` and `slacrawl`
|
|
78
|
+
return JSON `null` (not `[]`) for no hits — treat that as empty, not broken.
|
|
79
|
+
- A configured datasource whose native check fails is a **failure** and must be
|
|
80
|
+
repaired or reported explicitly. Never report a skip as a pass.
|
|
81
|
+
- Zero hits with a non-empty store means the CLI's search path is suspect, not
|
|
82
|
+
the data. Cross-check against the raw index before concluding (for example
|
|
83
|
+
`slacrawl sql "select count(*) from message_fts where message_fts match 'x';"`
|
|
84
|
+
against `slacrawl search x`). A populated index plus an empty CLI result is an
|
|
85
|
+
upstream bug: report it with the exact reproduction instead of re-syncing.
|
|
86
|
+
|
|
87
|
+
## 3. Prove searchability
|
|
88
|
+
|
|
89
|
+
Indexing without retrieval is a failed run. Probe retrieval per datasource with
|
|
90
|
+
the model-free path, then once end to end:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
autorag lite retrieve "a word that certainly appears" --top-k 3 --json --debug
|
|
94
|
+
autorag lite retrieve "recent topic" --tags discord --top-k 3 --json --debug
|
|
95
|
+
autorag lite retrieve "recent mail subject" --scope "/mailcrawl/**" --top-k 3 --json --debug
|
|
96
|
+
autorag search "summarize the collection" --top-k 3 --json --debug
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
- **Always pass `--debug` when diagnosing, and read the diagnostics.** A run
|
|
100
|
+
that silently dropped a whole retrieval method still looks successful, just
|
|
101
|
+
with fewer results; only the diagnostics name it (`minsync-unavailable`,
|
|
102
|
+
`retrieval-method-failed`). `autorag search --json` hides `diagnostics`,
|
|
103
|
+
`sessionId`, and per-result evidence unless `--debug` is set. `lite retrieve
|
|
104
|
+
--json` always carries the `diagnostics` array, but its human-readable output
|
|
105
|
+
hides it without `--debug`.
|
|
106
|
+
- A method missing from the returned `method` values means that method
|
|
107
|
+
contributed nothing. During a full MinSync re-sync this is expected: the
|
|
108
|
+
store is being rebuilt, `minsync status` reports `NotSynced`, and local-file
|
|
109
|
+
hits stay absent until it finishes. Confirm with `minsync status` before
|
|
110
|
+
treating it as a failure, and never kill a running sync to "fix" it.
|
|
111
|
+
- `lite retrieve` needs no model, so it isolates retrieval from model failures.
|
|
112
|
+
- Use `--tags` / `--scope` to force one datasource; they can only narrow
|
|
113
|
+
trusted access, never grant it. A datasource absent from `datasourceAccess`
|
|
114
|
+
returns nothing no matter how healthy its store is — fix the config, not the
|
|
115
|
+
store.
|
|
116
|
+
- `autorag evidence SESSION --json` (session id comes from `--json --debug`)
|
|
117
|
+
shows the exact chunk behind a numbered result; use it to confirm a hit is
|
|
118
|
+
real and its source is readable.
|
|
119
|
+
- Local-file hits must map to an absolute, existing path. Datasource hits keep
|
|
120
|
+
source-native identities such as `/kakao/personal/chunks/42`; those are not
|
|
121
|
+
filesystem paths and must never be passed to `cat`.
|
|
122
|
+
|
|
123
|
+
## 4. Repair playbook
|
|
124
|
+
|
|
125
|
+
### Orphan lock
|
|
126
|
+
|
|
127
|
+
The embedding runtime keeps `embedding-runtime.lock`, `embedding-runtime.pid`,
|
|
128
|
+
and `embedding-runtime.port` in `AUTORAG_HOME`. It reclaims them automatically
|
|
129
|
+
when the recorded PID is dead; a `lock-conflict` means the PID is **alive**.
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
autorag gateway status --format json
|
|
133
|
+
autorag gateway stop
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Only when `gateway stop` cannot clear it, and the recorded PID is confirmed
|
|
137
|
+
dead (`kill -0 PID` fails), remove the three files by hand and retry.
|
|
138
|
+
|
|
139
|
+
Index locks are owned by their engines: MinSync/tantivy locks under
|
|
140
|
+
`<workspace>/.autorag/`, and per-CLI locks such as
|
|
141
|
+
`<workspace>/.autorag/datasources/discrawl/.discrawl-sync.lock`. Delete one
|
|
142
|
+
only after confirming no owning process is alive; otherwise wait for the run
|
|
143
|
+
that holds it.
|
|
144
|
+
|
|
145
|
+
### Orphan process
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
pgrep -fl 'autorag|autorag-gateway|minsync' | grep -v pgrep
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
A refresh that was killed mid-run can leave the gateway or a `minsync` child
|
|
152
|
+
alive. Stop the gateway with `autorag gateway stop` first; only kill a PID
|
|
153
|
+
directly when it is confirmed orphaned (no parent CLI, no live refresh).
|
|
154
|
+
Re-run `autorag status --json` afterwards to confirm `inFlight: false`.
|
|
155
|
+
|
|
156
|
+
### Embedding model mismatch
|
|
157
|
+
|
|
158
|
+
`embedding-identity-mismatch` or a dimension error means the vectors on disk
|
|
159
|
+
were built with a different embedder than the configured one. Vectors of two
|
|
160
|
+
different dimensions can never be compared, so the index must be rebuilt:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
autorag models prefetch --profile qwen3-embedding-0.6b
|
|
164
|
+
autorag index rebuild --method minsync
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The current default is the local `native:Qwen/Qwen3-Embedding-0.6B` runtime at
|
|
168
|
+
1024 dimensions. A workspace still pinned to the legacy 768-dimension
|
|
169
|
+
Ollama/TEI path must be reindexed explicitly, or pinned to an explicit profile.
|
|
170
|
+
Changing `embedder.dimension` in config **without** a rebuild leaves retrieval
|
|
171
|
+
silently empty. Keep embeddings local; do not point the embedder at a remote
|
|
172
|
+
endpoint to work around a local failure.
|
|
173
|
+
|
|
174
|
+
### Stale index
|
|
175
|
+
|
|
176
|
+
`stale-index` diagnostics or `stale: true` mean sources changed after the last
|
|
177
|
+
refresh.
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
autorag refresh --method parsed,minsync --json
|
|
181
|
+
autorag refresh --force --json
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Use `--force` only when incremental refresh does not clear it. For continuous
|
|
185
|
+
freshness install an hourly `autorag watch --once` job (cron, launchd, systemd
|
|
186
|
+
timer, or Task Scheduler).
|
|
187
|
+
|
|
188
|
+
### Missing or wrong setup
|
|
189
|
+
|
|
190
|
+
- `unknown-datasource-skill`: the config key is not a builtin template and has
|
|
191
|
+
no `"type"`. It is skipped, not fatal — fix the name or add `"type"`.
|
|
192
|
+
- `datasource-index-failed` / `sync-failed`: the backing CLI errored. Run that
|
|
193
|
+
CLI's own check from the table above and fix it there.
|
|
194
|
+
- `minsync-unavailable` / `jikji-unavailable`: the binary is missing and
|
|
195
|
+
auto-install failed. Both install through cargo; verify the Rust toolchain,
|
|
196
|
+
then `autorag refresh --method minsync` to retry.
|
|
197
|
+
- `auth-error` / `rate-limited`: model or datasource credentials. Report the
|
|
198
|
+
missing environment-variable **name** and let the user supply it.
|
|
199
|
+
- A datasource configured but not listed in `datasourceAccess.allowedTags` /
|
|
200
|
+
`allowedScopes` is default-denied and invisible to search. Add it there.
|
|
201
|
+
|
|
202
|
+
## Diagnostic codes
|
|
203
|
+
|
|
204
|
+
| Code | Meaning | First move |
|
|
205
|
+
|---|---|---|
|
|
206
|
+
| `stale-index` | Sources changed since last refresh | `autorag refresh --method parsed,minsync` |
|
|
207
|
+
| `index-not-ready` | Index missing or never built | `autorag refresh --json` |
|
|
208
|
+
| `minsync-unavailable` | MinSync binary missing or install failed | Check cargo, retry refresh |
|
|
209
|
+
| `jikji-unavailable` | Jikji binary missing or install failed | Check cargo, retry refresh |
|
|
210
|
+
| `embedding-identity-mismatch` | Indexed vectors use a different embedder | `autorag index rebuild --method minsync` |
|
|
211
|
+
| `embedder-unavailable` | Embedding gateway or runtime down | `autorag gateway status --format json` |
|
|
212
|
+
| `lock-conflict` | Another runtime holds the lock | `autorag gateway stop` |
|
|
213
|
+
| `datasource-index-failed` | Backing CLI failed to index | Run that CLI's own doctor |
|
|
214
|
+
| `datasource-empty` | Store has no matching content | Re-sync with the CLI, or accept as empty |
|
|
215
|
+
| `unknown-datasource-skill` | Config name is not a known template | Fix the name or add `"type"` |
|
|
216
|
+
| `retrieval-method-failed` | One method errored during the query | Read `--debug` diagnostics |
|
|
217
|
+
| `auth-error` | Credentials missing or rejected | Report the env var name |
|
|
218
|
+
|
|
219
|
+
## Report
|
|
220
|
+
|
|
221
|
+
Always end with this table, one row per datasource and per AutoRAG component:
|
|
222
|
+
|
|
223
|
+
| Source | Configured | Indexed | Searchable | Issue found | Fix applied |
|
|
224
|
+
|---|---|---|---|---|---|
|
|
225
|
+
| minsync | yes | yes | yes (3 hits) | – | – |
|
|
226
|
+
| discord | yes | yes | no | stale archive | `discrawl sync` |
|
|
227
|
+
| telegram | no | – | – | CLI not installed | reported |
|
|
228
|
+
|
|
229
|
+
`Searchable` must come from an actual query in step 3, never inferred from
|
|
230
|
+
index state. Follow the table with the exact remaining action for every row
|
|
231
|
+
that is not fully green.
|
|
232
|
+
|
|
233
|
+
## Completion condition
|
|
234
|
+
|
|
235
|
+
Done only when: core triage is clean or every remaining diagnostic is
|
|
236
|
+
explained, every configured datasource passed its native check, every one of
|
|
237
|
+
them returned a real hit or is proven empty, every repair was re-verified by
|
|
238
|
+
re-running the failing check, and the report table was delivered.
|
|
@@ -58,6 +58,7 @@ The JSON envelope is:
|
|
|
58
58
|
"content": "..."
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
|
+
"unsearched": [],
|
|
61
62
|
"diagnostics": []
|
|
62
63
|
}
|
|
63
64
|
```
|
|
@@ -79,11 +80,32 @@ The JSON envelope is:
|
|
|
79
80
|
`method` that produced it. Source identities are source-native: real file
|
|
80
81
|
paths for local files, datasource identities for datasource results. Never
|
|
81
82
|
rewrite, guess, or flatten them.
|
|
82
|
-
- `
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
- `unsearched` lists the retrieval surfaces that did not run for this query.
|
|
84
|
+
`ok: true` with a non-empty `unsearched` means the answer is partial: for
|
|
85
|
+
example local MinSync files are skipped while an index sync holds the
|
|
86
|
+
workspace lock, leaving only datasource hits. Check `unsearched.length > 0`
|
|
87
|
+
before concluding that the returned sources are the whole corpus. Each entry
|
|
88
|
+
is:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"surface": "minsync",
|
|
93
|
+
"methods": ["hybrid", "minsync"],
|
|
94
|
+
"reason": "MinSyncQueryError: another sync is in progress (/Users/me/corpus/.autorag/minsync)"
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`surface` is `minsync` for local files or the datasource id. `reason` is the
|
|
99
|
+
underlying failure verbatim — the CLI's failure kind, exit status, stderr and
|
|
100
|
+
real paths — so the operator can act on it directly. Report it to the user as
|
|
101
|
+
given; do not summarize it away.
|
|
102
|
+
- `diagnostics` carry the same transparency: `source` is the component or
|
|
103
|
+
method label, `reason` repeats the underlying error, and codes include
|
|
104
|
+
`retrieval-method-failed` and `minsync-unavailable`. A degraded component
|
|
105
|
+
produces a diagnostic, not a failed run; check `diagnostics` before trusting
|
|
106
|
+
an empty result set.
|
|
107
|
+
- `--debug` adds per-result metadata and the diagnostics list to human output.
|
|
108
|
+
Skipped-surface warnings print without it, and their reasons carry real
|
|
87
109
|
filesystem paths.
|
|
88
110
|
- Exit codes: 0 on success (results may be empty, and a stale index is a
|
|
89
111
|
warning rather than a failure), 2 for usage, config, not-ready, or
|
|
@@ -168,6 +190,6 @@ autorag feedback <sessionId> --useful 1,3 --not-useful 2 --json
|
|
|
168
190
|
- Never expose provider credentials or authentication payloads.
|
|
169
191
|
- Treat report `source` values as opaque: persist them verbatim, never read
|
|
170
192
|
the filesystem through them.
|
|
171
|
-
-
|
|
172
|
-
|
|
193
|
+
- Surface diagnostics and `unsearched` reasons to the user as written; they
|
|
194
|
+
carry the real error text needed to fix the failure.
|
|
173
195
|
- Prefer `--json` whenever another agent consumes the output.
|
|
@@ -63,15 +63,18 @@ include `AUTORAG_HOME`, `AUTORAG_CONFIG`, `AUTORAG_SEARCH_PATHS`,
|
|
|
63
63
|
setup. Configure datasources directly in trusted config, wizard-style:
|
|
64
64
|
|
|
65
65
|
1. Probe every datasource for setup feasibility before asking the user
|
|
66
|
-
anything: the backing CLI exists (`
|
|
67
|
-
`wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`)
|
|
68
|
-
local store or archive is present
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
anything: the backing CLI exists (`lazykatok`, `discrawl`, `slacrawl`,
|
|
67
|
+
`wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`) and its
|
|
68
|
+
local store or archive is present. CLI-backed datasources own their own
|
|
69
|
+
archive, index, and authentication, so environment credentials (such as bot
|
|
70
|
+
tokens) are never required or checked for them. Non-CLI connectors
|
|
71
|
+
(such as `github`) require their credential environment variable
|
|
72
|
+
(`GITHUB_TOKEN`).
|
|
71
73
|
2. Auto-configure every datasource that probes feasible — write its trusted
|
|
72
74
|
`datasources` / `datasourceAccess` entries without asking. For example,
|
|
73
|
-
when Slack (`slacrawl`) and Discord (`discrawl`) are installed
|
|
74
|
-
automatically.
|
|
75
|
+
when Slack (`slacrawl`) and Discord (`discrawl`) are installed with local
|
|
76
|
+
stores present, set both up automatically. Discord uses discrawl's local
|
|
77
|
+
desktop wiretap archive; no Discord bot token is configured or needed.
|
|
75
78
|
3. Skip every datasource that probes infeasible (for example Notion or
|
|
76
79
|
Telegram when their CLIs are not installed) and always report the skipped
|
|
77
80
|
list to the user, with what is missing for each.
|
|
@@ -85,7 +88,7 @@ Datasource skills belong in trusted config and remain default-deny.
|
|
|
85
88
|
|
|
86
89
|
Config keys may be builtin template names (`kakao`, `whatsapp`, `telegram`,
|
|
87
90
|
`slack`, `discord`, `clawgallery`, `notion`, `github`, `cloud-drive`,
|
|
88
|
-
`mail-export`, `mailcrawl`, `obsidian`, `rss`, `spotlight`) or connection
|
|
91
|
+
`mail-export`, `mailcrawl`, `obsidian`, `rss`, `spotlight`, `lark`) or connection
|
|
89
92
|
aliases with `"type": "<template>"`. Unknown names are skipped with an
|
|
90
93
|
`unknown-datasource-skill` warning; they do not fail config resolution.
|
|
91
94
|
`datasourceAccess.allowedTags` and `allowedScopes` narrow trusted access and
|
|
@@ -112,11 +115,14 @@ autorag lite refresh --force --json
|
|
|
112
115
|
- MinSync and Jikji auto-install on first use by default. If they are missing
|
|
113
116
|
or broken, run a full refresh or return to setup rather than silently
|
|
114
117
|
degrading to lexical-only search.
|
|
115
|
-
- MinSync's default embedder is
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
- MinSync's default embedder is in-process native Qwen3 embeddings
|
|
119
|
+
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.5+): no
|
|
120
|
+
embedder flags, no API key, and no external daemon (such as Ollama) are
|
|
121
|
+
needed, and no corpus text leaves the machine. For gateway-profiled
|
|
122
|
+
embeddings, prefetch with `autorag models prefetch --profile qwen3-embedding-0.6b`.
|
|
123
|
+
The legacy Ollama/TEI adapter path (EmbeddingGemma, 768 dimensions) is for
|
|
124
|
+
manual QA only. Override the embedder only when intentionally using a
|
|
125
|
+
different provider.
|
|
120
126
|
- Exact duplicate exclusion during refresh is enabled by default via the
|
|
121
127
|
external `dupey` CLI. Install dupey during setup when it is missing
|
|
122
128
|
(`command -v dupey || cargo install dupey`) and tell the user the feature is
|
|
@@ -174,8 +180,9 @@ autorag lite duplicates --json
|
|
|
174
180
|
## Unavailable components and failure handling
|
|
175
181
|
|
|
176
182
|
Missing optional components degrade gracefully: refresh and retrieval continue
|
|
177
|
-
with
|
|
178
|
-
|
|
183
|
+
with diagnostics such as `minsync-unavailable` or `retrieval-method-failed`
|
|
184
|
+
instead of failing the whole run. Each one quotes the underlying error verbatim,
|
|
185
|
+
and `lite retrieve --json` also names the skipped surface under `unsearched`. Exit codes are 0
|
|
179
186
|
on success, 2 for config or usage errors, and 1 for runtime errors. When a
|
|
180
187
|
component stays unavailable after a full refresh, return to setup rather than
|
|
181
188
|
accepting silently degraded search.
|
|
@@ -143,11 +143,17 @@ is impossible, refresh continues without this optimization and the user is
|
|
|
143
143
|
told duplicate exclusion is off. Set `"excludeExactDuplicates": false` to
|
|
144
144
|
index every copy.
|
|
145
145
|
|
|
146
|
-
MinSync's default embedder is
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
146
|
+
MinSync's default embedder is in-process native Qwen3 embeddings
|
|
147
|
+
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.5+). The
|
|
148
|
+
default needs no embedder flags, no API key, and no external daemon (such as
|
|
149
|
+
Ollama) — all embeddings run in-process locally and privately. For workspaces
|
|
150
|
+
using the loopback llama-server gateway, prefetch the verified model with
|
|
151
|
+
`autorag models prefetch --profile qwen3-embedding-0.6b` (or verify with
|
|
152
|
+
`autorag models verify --profile qwen3-embedding-0.6b`).
|
|
153
|
+
|
|
154
|
+
The legacy Ollama/TEI adapter path (EmbeddingGemma, 768 dimensions) is
|
|
155
|
+
supported only for existing legacy workspaces and manual QA; do not use it as a
|
|
156
|
+
fresh install default.
|
|
151
157
|
|
|
152
158
|
Override the embedder only when intentionally using a different, for example
|
|
153
159
|
remote, provider:
|
|
@@ -163,26 +169,36 @@ autorag init \
|
|
|
163
169
|
|
|
164
170
|
Only store the environment-variable name, never its value. Dimension and batch
|
|
165
171
|
size must be positive integers, and the dimension must match the embedder
|
|
166
|
-
(EmbeddingGemma is 768; text-embedding-3-small is 1536).
|
|
172
|
+
(default Qwen3 is 1024; legacy EmbeddingGemma is 768; text-embedding-3-small is 1536).
|
|
167
173
|
|
|
168
174
|
## Probe and configure datasource skills (setup wizard)
|
|
169
175
|
|
|
176
|
+
Use `autorag setup` to probe the local runtime, model profile, and known
|
|
177
|
+
datasources automatically:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
autorag setup --format json
|
|
181
|
+
```
|
|
182
|
+
|
|
170
183
|
`autorag ui` is still in development — do not recommend it for datasource
|
|
171
184
|
setup. Configure datasources directly in trusted config, wizard-style:
|
|
172
185
|
|
|
173
186
|
1. Probe every datasource for setup feasibility before asking the user
|
|
174
|
-
anything: the backing CLI exists (`
|
|
175
|
-
`wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`)
|
|
176
|
-
local store or archive is present
|
|
177
|
-
|
|
178
|
-
|
|
187
|
+
anything: the backing CLI exists (`lazykatok`, `discrawl`, `slacrawl`,
|
|
188
|
+
`wacrawl`, `telecrawl`, `notcrawl`, `qmd`, `mailcrawl`, `rclone`, `lark-cli`) and its
|
|
189
|
+
local store or archive is present. CLI-backed datasources own their own
|
|
190
|
+
archive, index, and authentication, so environment credentials (such as bot
|
|
191
|
+
tokens) are never required or checked for them. Non-CLI connectors
|
|
192
|
+
(such as `github`) require their credential environment variable
|
|
193
|
+
(`GITHUB_TOKEN`).
|
|
179
194
|
2. Auto-configure every datasource that probes feasible — write its trusted
|
|
180
195
|
`datasources` / `datasourceAccess` entries without asking. For example,
|
|
181
|
-
when Slack (`slacrawl`) and Discord (`discrawl`) are installed
|
|
182
|
-
automatically.
|
|
196
|
+
when Slack (`slacrawl`) and Discord (`discrawl`) are installed with local
|
|
197
|
+
stores present, set both up automatically. Discord uses discrawl's local
|
|
198
|
+
desktop wiretap archive; no Discord bot token is configured or needed.
|
|
183
199
|
3. Skip every datasource that probes infeasible (for example Notion or
|
|
184
|
-
Telegram when their CLIs are not
|
|
185
|
-
list to the user, with what is missing for each.
|
|
200
|
+
Telegram when their CLIs or native stores are not present) and always
|
|
201
|
+
report the skipped list to the user, with what is missing for each.
|
|
186
202
|
4. Set up a skipped datasource only when the user explicitly asks for it:
|
|
187
203
|
install or authenticate the backing CLI first, then configure it.
|
|
188
204
|
5. E-mail datasources (`mail-export`, `mailcrawl`) matter to most
|
|
@@ -191,8 +207,8 @@ setup. Configure datasources directly in trusted config, wizard-style:
|
|
|
191
207
|
|
|
192
208
|
Datasource skills belong in trusted config and remain default-deny. Builtin
|
|
193
209
|
template names are `kakao`, `whatsapp`, `telegram`, `slack`, `discord`,
|
|
194
|
-
`clawgallery`, `notion`, `github`, `cloud-drive`, `mail-export`,
|
|
195
|
-
`mailcrawl`, `obsidian`, `rss`, and `
|
|
210
|
+
`clawgallery`, `notion`, `github`, `github-gist`, `cloud-drive`, `mail-export`,
|
|
211
|
+
`mailcrawl`, `obsidian`, `rss`, `spotlight`, and `lark`. Config keys may be connection
|
|
196
212
|
aliases with `"type": "<template>"`. Unknown names are skipped with an
|
|
197
213
|
`unknown-datasource-skill` warning; they do not fail config resolution.
|
|
198
214
|
`scope` and tags can narrow trusted access but cannot grant it.
|
|
@@ -201,6 +217,7 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
|
|
|
201
217
|
{
|
|
202
218
|
"datasources": {
|
|
203
219
|
"github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
|
|
220
|
+
"github-gist": { "connector": { "tokenEnv": "GITHUB_TOKEN" } },
|
|
204
221
|
"google-drive": { "type": "cloud-drive", "connector": { "provider": "google-drive", "remote": "gdrive:" } },
|
|
205
222
|
"archive-drive": { "type": "cloud-drive", "connector": { "remote": "archive:" } },
|
|
206
223
|
"mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
|
|
@@ -217,11 +234,13 @@ aliases with `"type": "<template>"`. Unknown names are skipped with an
|
|
|
217
234
|
Tokens are environment-variable names, not raw secrets. CLI-backed connectors
|
|
218
235
|
keep authentication in their external tool configuration.
|
|
219
236
|
|
|
220
|
-
Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.
|
|
237
|
+
Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.2.0` or newer)
|
|
221
238
|
and configured through its own Himalaya account. AutoRAG runs its local `sync`
|
|
222
239
|
and `index` lifecycle, then uses the mailcrawl CLI for BM25, semantic, or
|
|
223
240
|
hybrid search. Do not use 0.1.3 or earlier: a no-op sync followed by `index`
|
|
224
|
-
fails with `text array must be non-empty`.
|
|
241
|
+
fails with `text array must be non-empty`. 0.2.0 defaults to the in-process
|
|
242
|
+
native `Qwen/Qwen3-Embedding-0.6B` embedder and keeps vectors in LanceDB, so a
|
|
243
|
+
cold cache makes the first `index` download ONNX weights and run for minutes.
|
|
225
244
|
Use mailcrawl for Gmail, IMAP, and Maildir retrieval. The former Gmail REST
|
|
226
245
|
datasource is removed.
|
|
227
246
|
|
|
@@ -230,12 +249,14 @@ datasource is removed.
|
|
|
230
249
|
Configuration alone is not a successful setup:
|
|
231
250
|
|
|
232
251
|
```bash
|
|
252
|
+
autorag setup --format json
|
|
233
253
|
autorag status --json
|
|
234
254
|
autorag health --json
|
|
235
255
|
autorag refresh --json
|
|
236
256
|
autorag search "summarize the collection" --top-k 3 --json --debug
|
|
237
257
|
```
|
|
238
258
|
|
|
259
|
+
- `setup` probes runtime health, model profile, and datasource readiness.
|
|
239
260
|
- `status` is model-free and path-opaque.
|
|
240
261
|
- `health` resolves the single model, checks credential presence, and normally
|
|
241
262
|
performs one live completion probe.
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
-
import { Type } from "typebox";
|
|
3
|
-
import type { RetrievalDiagnostic, RetrievalResult } from "../retrieval/types.js";
|
|
4
|
-
import { type SearchDocumentRetrievalTraceResult } from "./search-documents.js";
|
|
5
|
-
export declare const SEARCH_DATASOURCE_DOCUMENTS_TOOL_NAME = "search_datasource_documents";
|
|
6
|
-
declare const searchDatasourceSchema: Type.TObject<{
|
|
7
|
-
query: Type.TString;
|
|
8
|
-
topK: Type.TOptional<Type.TInteger>;
|
|
9
|
-
scope: Type.TOptional<Type.TString>;
|
|
10
|
-
}>;
|
|
11
|
-
export interface SearchDatasourceDocumentsDetails {
|
|
12
|
-
readonly method: "datasource";
|
|
13
|
-
readonly resultCount: number;
|
|
14
|
-
readonly sources: readonly string[];
|
|
15
|
-
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
16
|
-
/** Top candidates in traceable shape (additive; used for the run's retrieval trace). */
|
|
17
|
-
readonly results?: readonly SearchDocumentRetrievalTraceResult[];
|
|
18
|
-
}
|
|
19
|
-
export interface DatasourceSearchProvider {
|
|
20
|
-
searchDatasourceDocuments(query: string, options?: {
|
|
21
|
-
readonly topK?: number;
|
|
22
|
-
readonly scope?: string;
|
|
23
|
-
}): Promise<{
|
|
24
|
-
readonly results: readonly RetrievalResult[];
|
|
25
|
-
readonly diagnostics: readonly RetrievalDiagnostic[];
|
|
26
|
-
}>;
|
|
27
|
-
}
|
|
28
|
-
export declare function createSearchDatasourceDocumentsTool(provider: DatasourceSearchProvider): AgentTool<typeof searchDatasourceSchema, SearchDatasourceDocumentsDetails>;
|
|
29
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { KatokChunkResult, KatokContextResult, KatokDoctorResult, KatokIndexResult, KatokOptions, KatokParentResult, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSyncResult } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Thin external `katok` CLI wrapper. Every method spawns the `katok` binary as
|
|
4
|
-
* a child process, parses JSON from stdout, and returns a discriminated ok/fail
|
|
5
|
-
* union. No method throws for expected failures (missing binary, CLI nonzero
|
|
6
|
-
* exit, timeout, oversized output, or invalid JSON). The client never opens the
|
|
7
|
-
* KakaoTalk database directly.
|
|
8
|
-
*/
|
|
9
|
-
export declare class KatokClient {
|
|
10
|
-
private readonly options;
|
|
11
|
-
constructor(options?: KatokOptions);
|
|
12
|
-
doctor(signal?: AbortSignal): Promise<KatokDoctorResult>;
|
|
13
|
-
sync(signal?: AbortSignal): Promise<KatokSyncResult>;
|
|
14
|
-
index(signal?: AbortSignal): Promise<KatokIndexResult>;
|
|
15
|
-
search(mode: KatokSearchMode, query: string, options?: KatokSearchOptions): Promise<KatokSearchResult>;
|
|
16
|
-
chunkGet(chunkId: string, signal?: AbortSignal): Promise<KatokChunkResult>;
|
|
17
|
-
context(chunkId: string, signal?: AbortSignal): Promise<KatokContextResult>;
|
|
18
|
-
parent(chunkId: string, signal?: AbortSignal): Promise<KatokParentResult>;
|
|
19
|
-
/** Single retrieval pipeline: build env, spawn, parse-free raw result. */
|
|
20
|
-
private run;
|
|
21
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* KakaoTalk datasource skill barrel.
|
|
3
|
-
*
|
|
4
|
-
* Re-exports the retrieval methods and skill plus the underlying client/types
|
|
5
|
-
* from sibling modules. Public source paths are path-opaque virtual paths of
|
|
6
|
-
* the form `/kakao/<instance-id>/chunks/<chunk-id>`.
|
|
7
|
-
*/
|
|
8
|
-
export { KatokClient } from "./client.js";
|
|
9
|
-
export { KatokBm25Method, type KatokMethodOptions, type KatokSearchClient, KatokSemanticMethod } from "./methods.js";
|
|
10
|
-
export { KatokSkill, type KatokSkillClient, type KatokSkillOptions } from "./skill.js";
|
|
11
|
-
export type { KatokChunkResult, KatokDoctorResult, KatokFailureReason, KatokHit, KatokIndexResult, KatokOptions, KatokSearchMode, KatokSearchOptions, KatokSearchResult, KatokSyncResult, } from "./types.js";
|
|
12
|
-
export { DEFAULT_KATOK_OPTIONS } from "./types.js";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Path helpers for the KakaoTalk (`katok`) datasource skill.
|
|
3
|
-
*
|
|
4
|
-
* All paths are workspace-relative and live under
|
|
5
|
-
* `<workspaceRoot>/.autorag/datasources/katok`. The client never exposes raw
|
|
6
|
-
* filesystem paths to callers; chunk identifiers are surfaced as opaque
|
|
7
|
-
* slash-hierarchical sources of the form
|
|
8
|
-
* `/kakao/<instance-id>/chunks/<chunk-id>`.
|
|
9
|
-
*/
|
|
10
|
-
export declare const AUTORAG_DIRNAME = ".autorag";
|
|
11
|
-
export declare const DATASOURCES_DIRNAME = "datasources";
|
|
12
|
-
export declare const KATOK_DATASOURCE_DIRNAME = "katok";
|
|
13
|
-
/** Logical datasource kind for source identifiers. */
|
|
14
|
-
export declare const KATOK_SOURCE_KIND: "kakao";
|
|
15
|
-
/**
|
|
16
|
-
* Root directory for katok-managed state under a workspace. This is where the
|
|
17
|
-
* external `katok` CLI stores its index, chunks, and sync state.
|
|
18
|
-
*/
|
|
19
|
-
export declare function katokDatasourceRoot(workspaceRoot: string): string;
|
|
20
|
-
/** Directory holding the katok chunk index. */
|
|
21
|
-
export declare function katokIndexPath(workspaceRoot: string): string;
|
|
22
|
-
/** Directory holding materialized katok chunks. */
|
|
23
|
-
export declare function katokChunksPath(workspaceRoot: string): string;
|
|
24
|
-
/** Directory holding katok sync state. */
|
|
25
|
-
export declare function katokSyncPath(workspaceRoot: string): string;
|
|
26
|
-
/**
|
|
27
|
-
* Builds the path-opaque, slash-hierarchical source identifier for a single
|
|
28
|
-
* katok chunk. Callers (the KatokSkill methods) use this to populate
|
|
29
|
-
* `RetrievalResult.source` so no real filesystem path ever leaks.
|
|
30
|
-
*/
|
|
31
|
-
export declare function katokSourcePath(instanceId: string, chunkId: string): string;
|
|
32
|
-
/**
|
|
33
|
-
* Parses a katok source identifier back into its `{ instanceId, chunkId }`
|
|
34
|
-
* components. Returns `undefined` for malformed or non-kakao sources so that
|
|
35
|
-
* deny decisions remain explicit rather than undefined-as-deny.
|
|
36
|
-
*/
|
|
37
|
-
export declare function parseKatokSourcePath(source: string): {
|
|
38
|
-
readonly instanceId: string;
|
|
39
|
-
readonly chunkId: string;
|
|
40
|
-
} | undefined;
|