@autorag/librarian 2.2.0 → 2.3.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 +84 -42
- package/dist/agent/agent.d.ts +16 -41
- package/dist/agent/bash-tool.d.ts +0 -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-documents.d.ts +1 -1
- 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/init.d.ts +1 -1
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/config.d.ts +10 -14
- package/dist/cli/index.js +10383 -11845
- 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/index.d.ts +2 -0
- package/dist/datasource/skills/cloud-drive/index.d.ts +1 -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/factory.d.ts +7 -0
- package/dist/datasource/skills/gdrive/rclone-connector.d.ts +16 -24
- package/dist/datasource/skills/obsidian/skill.d.ts +1 -0
- 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/index.d.ts +1 -0
- package/dist/index.js +5063 -6881
- 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/mirror/sync.d.ts +3 -1
- package/dist/observability/run-log.d.ts +1 -26
- package/dist/process/portable-spawn.d.ts +10 -0
- package/package.json +5 -4
- package/skills/autorag/SKILL.md +59 -96
- package/skills/autorag-setup/SKILL.md +144 -400
- 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
|
@@ -1,213 +1,133 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag-setup
|
|
3
|
-
description: Configure AutoRAG for first use or repair its
|
|
3
|
+
description: Configure AutoRAG for first use or repair its single-agent model, approved document roots, retrieval indexes, datasource skills, and health checks without exposing credentials.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# AutoRAG
|
|
6
|
+
# AutoRAG setup
|
|
7
7
|
|
|
8
|
-
Use this skill
|
|
9
|
-
|
|
10
|
-
initial indexes. After setup succeeds, use the separate `autorag` skill for
|
|
11
|
-
normal searches and feedback.
|
|
8
|
+
Use this skill when AutoRAG is unconfigured, model resolution fails, indexes are
|
|
9
|
+
missing or stale, or the user wants to change the document collection.
|
|
12
10
|
|
|
13
|
-
## Safety
|
|
11
|
+
## Safety
|
|
14
12
|
|
|
15
13
|
- Inspect only non-secret provider/model metadata and credential availability.
|
|
16
|
-
- Never print, copy, migrate, compare, or persist credential values.
|
|
17
|
-
-
|
|
18
|
-
configuration, logs, or user-facing explanations.
|
|
14
|
+
- Never print, copy, migrate, compare, or persist credential values. Store only
|
|
15
|
+
environment-variable names such as `apiKeyEnv`.
|
|
19
16
|
- Do not scan the whole filesystem or home directory without explicit approval.
|
|
20
17
|
- Never move, rename, edit, or delete source documents.
|
|
21
|
-
-
|
|
22
|
-
|
|
18
|
+
- Do not index system trees, app bundles, caches, credential stores,
|
|
19
|
+
`node_modules`, `.git`, `dist`, `build`, `target`, `.cache`, `.autorag`, or
|
|
20
|
+
`.jikji`.
|
|
23
21
|
|
|
24
|
-
##
|
|
22
|
+
## Inspect existing configuration
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
Check `~/.autorag/config.json`, an explicit `--config` path, or
|
|
25
|
+
`AUTORAG_CONFIG`. Relevant fields are:
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
configuration may be used only to determine endpoint compatibility, model
|
|
34
|
-
IDs, credential environment-variable names, and whether credentials exist.
|
|
35
|
-
4. Check Pi authentication entries by provider identity without reading or
|
|
36
|
-
showing their secret payloads.
|
|
37
|
-
5. Treat ChatGPT, Claude, Gemini, and other consumer subscriptions as usable
|
|
38
|
-
only when the active runtime can demonstrably delegate that authenticated
|
|
39
|
-
session to AutoRAG or compatible authentication already exists in AutoRAG's
|
|
40
|
-
Pi state. A subscription is not automatically an API entitlement.
|
|
41
|
-
6. Do not infer usability from an installed CLI, a config filename, or an
|
|
42
|
-
environment-variable name alone. Authentication and protocol compatibility
|
|
43
|
-
must both be established.
|
|
27
|
+
- `searchPaths`, `workspacePath`, and `memoryPath`
|
|
28
|
+
- `model.provider`, `model.id`, `model.api`, `model.baseUrl`, `model.apiKeyEnv`
|
|
29
|
+
- `bm25`, `minSync`, and `jikji`
|
|
30
|
+
- `datasources` and `datasourceAccess`
|
|
44
31
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
run. Ask one concise question only when multiple equally suitable public
|
|
48
|
-
providers remain and runtime evidence cannot choose between them.
|
|
32
|
+
Preserve explicit user choices and a working config unless the user asks to
|
|
33
|
+
replace them or health checks fail.
|
|
49
34
|
|
|
50
|
-
##
|
|
35
|
+
## Configure one search model
|
|
51
36
|
|
|
52
|
-
|
|
37
|
+
AutoRAG is the specialized librarian agent. One configured model plans the
|
|
38
|
+
search, calls retrieval and filesystem tools, reads sources, judges evidence,
|
|
39
|
+
and curates the answer in one loop. There are no orchestrator/explorer roles.
|
|
53
40
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- Never invent model IDs or write a private provider alias into distributed or
|
|
59
|
-
user-facing configuration.
|
|
41
|
+
Prefer a model with reliable tool calling and structured output, enough context
|
|
42
|
+
for source excerpts, high output TPS, and low first-token latency. Use a larger
|
|
43
|
+
reasoning model only when difficult synthesis or domain judgment matters more
|
|
44
|
+
than latency.
|
|
60
45
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
Start from a provider/model the current runtime can actually call. A Pi-usable
|
|
47
|
+
ChatGPT, Claude, Gemini, or other authenticated subscription is valid; an
|
|
48
|
+
installed CLI or subscription that Pi cannot invoke is not. For custom
|
|
49
|
+
OpenAI-compatible endpoints, record the real wire API, base URL, and credential
|
|
50
|
+
environment-variable name.
|
|
64
51
|
|
|
65
|
-
|
|
52
|
+
Allowed `api` values:
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
54
|
+
- `openai-completions`
|
|
55
|
+
- `openai-responses`
|
|
56
|
+
- `anthropic-messages`
|
|
57
|
+
- `openai-codex-responses`
|
|
58
|
+
- `azure-openai-responses`
|
|
70
59
|
|
|
71
|
-
|
|
60
|
+
If no callable setup can be established, ask the user for the provider, model
|
|
61
|
+
id, API protocol, base URL when custom, and credential environment-variable
|
|
62
|
+
name. Do not invent provider identities or model ids.
|
|
72
63
|
|
|
73
|
-
|
|
64
|
+
## Propose and approve document roots
|
|
74
65
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
| Linux | `$HOME` (e.g. `/home/<name>`; honor `XDG_*` when set) |
|
|
79
|
-
| Windows | `%USERPROFILE%` / `$HOME` under Git Bash (e.g. `C:\Users\<name>`) |
|
|
66
|
+
Explicit user paths win. Otherwise inspect only these likely document-dense
|
|
67
|
+
candidates for existence and approximate supported-file counts, then ask for
|
|
68
|
+
approval before indexing:
|
|
80
69
|
|
|
81
|
-
|
|
82
|
-
for existence and approximate document density (counts of supported extensions),
|
|
83
|
-
then present the findings.
|
|
84
|
-
|
|
85
|
-
### 2. Recommend document-dense anchors per OS
|
|
86
|
-
|
|
87
|
-
Offer candidates that commonly hold PDFs, Office docs, notes, and downloads.
|
|
88
|
-
Mark each as **recommended** or **optional**, and never enable a path that does
|
|
89
|
-
not exist.
|
|
90
|
-
|
|
91
|
-
**macOS**
|
|
92
|
-
|
|
93
|
-
| Priority | Path | Why |
|
|
94
|
-
|---|---|---|
|
|
95
|
-
| Recommended | `~/Documents` | Default document library |
|
|
96
|
-
| Recommended | `~/Downloads` | Fresh PDFs, reports, attachments |
|
|
97
|
-
| Recommended | `~/Desktop` | Dropped working files |
|
|
98
|
-
| Optional | `~/Notes`, `~/Obsidian`, `~/iCloud Drive/Documents` when present | Personal knowledge bases |
|
|
99
|
-
| Optional | Current project docs roots the user already named | Repo/wiki collections |
|
|
100
|
-
|
|
101
|
-
Prefer user-visible folders over iCloud container UUIDs or Library internals.
|
|
102
|
-
Skip `~/Library`, `~/Applications`, and Time Machine volumes unless the user
|
|
103
|
-
explicitly points there.
|
|
104
|
-
|
|
105
|
-
**Linux**
|
|
106
|
-
|
|
107
|
-
| Priority | Path | Why |
|
|
108
|
-
|---|---|---|
|
|
109
|
-
| Recommended | `~/Documents` or `$XDG_DOCUMENTS_DIR` | Document library |
|
|
110
|
-
| Recommended | `~/Downloads` or `$XDG_DOWNLOAD_DIR` | Incoming files |
|
|
111
|
-
| Recommended | `~/Desktop` or `$XDG_DESKTOP_DIR` | Working files |
|
|
112
|
-
| Optional | `~/Notes`, `~/Sync`, Nextcloud/Syncthing folders when present | Synced knowledge |
|
|
113
|
-
| Optional | Current project docs roots the user already named | Repo/wiki collections |
|
|
114
|
-
|
|
115
|
-
When XDG user-dirs are configured, prefer those resolved paths over bare
|
|
116
|
-
`~/Documents`-style guesses.
|
|
117
|
-
|
|
118
|
-
**Windows**
|
|
119
|
-
|
|
120
|
-
| Priority | Path | Why |
|
|
70
|
+
| OS | Recommended | Optional |
|
|
121
71
|
|---|---|---|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
| Optional | OneDrive `Documents` / `Desktop` when they differ from the local shell folders | Cloud-backed corp libraries |
|
|
126
|
-
| Optional | Current project docs roots the user already named | Repo/wiki collections |
|
|
127
|
-
|
|
128
|
-
Prefer the shell-known special folders. Do not crawl `AppData`, `Program Files`,
|
|
129
|
-
or system roots.
|
|
130
|
-
|
|
131
|
-
### 3. Density and format filter
|
|
132
|
-
|
|
133
|
-
Prefer folders dense with formats AutoRAG parses into `.autorag/parsed` for
|
|
134
|
-
BM25/MinSync:
|
|
135
|
-
|
|
136
|
-
- text notes: `md`, `markdown`, `txt`, `text`
|
|
137
|
-
- documents: `pdf`, `docx`, `pptx`, `xlsx`, `hwpx`, `eml`
|
|
138
|
-
- optional OCR images only when enabled: `jpg`, `jpeg`, `png`, `bmp`, `tiff`
|
|
139
|
-
|
|
140
|
-
Do not present legacy binary shells that currently fail pure-JS parsing as fully
|
|
141
|
-
supported: bare `doc`, `xls`, and legacy `hwp` (use `docx` / `xlsx` / `hwpx`
|
|
142
|
-
instead). Explorers can still open any readable text under approved paths with
|
|
143
|
-
`read`/`grep`/`find`/`ls`, but those files will not contribute to BM25/MinSync
|
|
144
|
-
indexes.
|
|
145
|
-
|
|
146
|
-
Skip generated/vendor directories including `node_modules`, `.git`, `dist`,
|
|
147
|
-
`build`, `target`, `.cache`, `.autorag`, and `.jikji`.
|
|
72
|
+
| macOS | `~/Documents`, `~/Downloads`, `~/Desktop` | `~/Notes`, `~/Obsidian`, user-named project docs |
|
|
73
|
+
| Linux | XDG Documents/Downloads/Desktop or their `~/` defaults | `~/Notes`, `~/Sync`, Nextcloud/Syncthing roots |
|
|
74
|
+
| Windows | Documents, Downloads, Desktop shell folders | OneDrive document roots, user-named project docs |
|
|
148
75
|
|
|
149
|
-
|
|
76
|
+
Supported index formats include `md`, `markdown`, `txt`, `text`, `pdf`, `docx`,
|
|
77
|
+
`pptx`, `xlsx`, `hwpx`, and `eml`; OCR image formats are optional. Do not
|
|
78
|
+
present legacy `doc`, `xls`, or `hwp` as fully supported parsed formats.
|
|
150
79
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
Recommended index roots (macOS):
|
|
155
|
-
[R] ~/Documents (~120 pdf/md/docx)
|
|
156
|
-
[R] ~/Downloads (~45 pdf/pptx)
|
|
157
|
-
[R] ~/Desktop (~12 md/pdf)
|
|
158
|
-
[O] ~/Notes (~80 md) — optional personal vault
|
|
159
|
-
|
|
160
|
-
Reply with: accept all / keep only Documents+Downloads / custom list
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
Rules:
|
|
164
|
-
|
|
165
|
-
1. Prefer an explicit directory already named by the user over any suggestion.
|
|
166
|
-
2. Do not silently index large or sensitive trees.
|
|
167
|
-
3. Keep the first-run set small (typically 1–3 approved roots). Users can add
|
|
168
|
-
more after the initial index build.
|
|
169
|
-
4. Wallpaper/background folders are rarely useful; only suggest Desktop itself
|
|
170
|
-
(where people leave docs), not OS wallpaper asset caches.
|
|
80
|
+
Keep the first-run set small, usually one to three roots. Present a concrete
|
|
81
|
+
proposal and require `yes`, a narrowed keep-list, a custom list, or `skip`
|
|
82
|
+
before running `refresh`.
|
|
171
83
|
|
|
172
84
|
## Initialize
|
|
173
85
|
|
|
174
|
-
Write the approved paths and selected role models:
|
|
175
|
-
|
|
176
86
|
```bash
|
|
177
87
|
autorag init \
|
|
178
|
-
--search-paths "/path/to/
|
|
179
|
-
--
|
|
180
|
-
--
|
|
181
|
-
--
|
|
182
|
-
--explorer-model-id EXPLORER_MODEL
|
|
88
|
+
--search-paths "/path/to/documents,/path/to/notes" \
|
|
89
|
+
--workspace "/path/to/workspace" \
|
|
90
|
+
--model-provider PROVIDER \
|
|
91
|
+
--model-id MODEL
|
|
183
92
|
```
|
|
184
93
|
|
|
185
|
-
|
|
186
|
-
|
|
94
|
+
If the authenticated local runtime already supplies the intended model, model
|
|
95
|
+
flags may be omitted. For a custom endpoint, add `api`, `baseUrl`, and
|
|
96
|
+
`apiKeyEnv` to the single `model` object in the trusted config:
|
|
187
97
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"searchPaths": ["/path/to/documents"],
|
|
101
|
+
"model": {
|
|
102
|
+
"provider": "openrouter",
|
|
103
|
+
"id": "anthropic/claude-sonnet-4",
|
|
104
|
+
"api": "openai-completions",
|
|
105
|
+
"baseUrl": "https://openrouter.ai/api/v1",
|
|
106
|
+
"apiKeyEnv": "OPENROUTER_API_KEY"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
191
110
|
|
|
192
|
-
|
|
111
|
+
Use `--force` only when intentionally replacing an existing config. Legacy cwd
|
|
112
|
+
`autorag.config.json` is a migration source only and is never deleted by init.
|
|
193
113
|
|
|
194
|
-
|
|
195
|
-
`bm25: { enabled: true }` and `minSync: { enabled: true, autoInstall: false }`
|
|
196
|
-
into the config even when no method flags are supplied. To disable a method,
|
|
197
|
-
set it to `false` in the config file (`"bm25": false` or `"minSync": false`).
|
|
114
|
+
### Retrieval defaults
|
|
198
115
|
|
|
199
|
-
MinSync
|
|
200
|
-
|
|
201
|
-
|
|
116
|
+
BM25, MinSync, and Jikji are enabled by default. Leave them enabled unless the
|
|
117
|
+
user explicitly asks otherwise. MinSync auto-install is off by default and its
|
|
118
|
+
binary must already be installed or on `PATH`; Jikji can install `jikji-cli`
|
|
119
|
+
through cargo when enabled and allowed.
|
|
202
120
|
|
|
203
|
-
|
|
121
|
+
Exact duplicate exclusion is enabled by default. AutoRAG invokes the external
|
|
122
|
+
`dupey` CLI before parsed-mirror indexing, keeps the newest filesystem copy for
|
|
123
|
+
each exact canonical-text hash, and excludes older copies from the mirror. Set
|
|
124
|
+
`"excludeExactDuplicates": false` to index every copy. Missing dupey is
|
|
125
|
+
non-fatal; refresh continues without this optimization.
|
|
204
126
|
|
|
205
|
-
|
|
206
|
-
into `minSync.embedder` in the config:
|
|
127
|
+
Optional MinSync embedder settings:
|
|
207
128
|
|
|
208
129
|
```bash
|
|
209
130
|
autorag init \
|
|
210
|
-
--search-paths "/path/to/docs" \
|
|
211
131
|
--embedder-id "text-embedding-3-small" \
|
|
212
132
|
--embedder-base-url "https://api.openai.com/v1" \
|
|
213
133
|
--embedder-api-key-env "OPENAI_API_KEY" \
|
|
@@ -215,256 +135,80 @@ autorag init \
|
|
|
215
135
|
--embedder-batch-size 64
|
|
216
136
|
```
|
|
217
137
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
value itself. `--embedder-dimension` and `--embedder-batch-size` must be positive
|
|
221
|
-
integers.
|
|
222
|
-
|
|
223
|
-
If role models are intentionally omitted, `autorag init` must leave `agents`
|
|
224
|
-
unset; it must never inject a private provider default. Legacy cwd
|
|
225
|
-
`autorag.config.json` is a migration source only and is never deleted by init.
|
|
226
|
-
|
|
227
|
-
Per-run overrides (flags and env take precedence over the file) are available
|
|
228
|
-
via the role-specific flags or:
|
|
229
|
-
|
|
230
|
-
- `AUTORAG_ORCHESTRATOR_MODEL_PROVIDER` / `AUTORAG_ORCHESTRATOR_MODEL_ID`
|
|
231
|
-
- `AUTORAG_EXPLORER_MODEL_PROVIDER` / `AUTORAG_EXPLORER_MODEL_ID`
|
|
232
|
-
- legacy single-model aliases: `AUTORAG_MODEL_PROVIDER` / `AUTORAG_MODEL_ID`
|
|
233
|
-
- `AUTORAG_SEARCH_PATHS`, `AUTORAG_WORKSPACE`, `AUTORAG_MEMORY_PATH`
|
|
138
|
+
Only store the environment-variable name, never its value. Dimension and batch
|
|
139
|
+
size must be positive integers.
|
|
234
140
|
|
|
235
|
-
## Configure datasource skills
|
|
141
|
+
## Configure datasource skills when requested
|
|
236
142
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
`datasourceAccess` allow-list to `config.json`:
|
|
143
|
+
Datasource skills belong in trusted config and remain default-deny. Common
|
|
144
|
+
entries include WhatsApp, Telegram, Slack, Discord, Notion, GitHub, Google
|
|
145
|
+
Drive, a generic cloud-drive/rclone source, Gmail, local mail exports,
|
|
146
|
+
Obsidian, RSS/news, and Spotlight.
|
|
242
147
|
|
|
243
148
|
```jsonc
|
|
244
149
|
{
|
|
245
150
|
"datasources": {
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"notion": { "connector": { "binaryPath": "notcrawl", "configPath": "/path/to/notcrawl.yaml" } },
|
|
251
|
-
"github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
|
|
252
|
-
"gdrive": { "connector": { "backend": "rclone", "remote": "gdrive:" } },
|
|
253
|
-
"gmail": { "connector": { "backend": "himalaya", "account": "gmail", "folder": "INBOX" } },
|
|
254
|
-
"mail-export": { "connector": { "paths": ["/path/to/exports"] } },
|
|
151
|
+
"github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
|
|
152
|
+
"gdrive": { "connector": { "backend": "rclone", "remote": "gdrive:" } },
|
|
153
|
+
"cloud-drive": { "connector": { "backend": "rclone", "remote": "archive:" } },
|
|
154
|
+
"gmail": { "connector": { "backend": "himalaya", "account": "gmail", "folder": "INBOX" } },
|
|
255
155
|
"obsidian": { "connector": { "vaultPath": "/path/to/vault" } },
|
|
256
|
-
"rss":
|
|
156
|
+
"rss": { "connector": { "feeds": [{ "url": "https://example.com/feed.xml" }] } }
|
|
257
157
|
},
|
|
258
158
|
"datasourceAccess": {
|
|
259
|
-
"allowedTags": ["
|
|
260
|
-
"allowedScopes": ["/
|
|
159
|
+
"allowedTags": ["github", "gdrive", "cloud-drive", "gmail", "obsidian", "rss"],
|
|
160
|
+
"allowedScopes": ["/github/**", "/gdrive/**", "/cloud-drive/**", "/gmail/**", "/obsidian/**", "/rss/**"]
|
|
261
161
|
}
|
|
262
162
|
}
|
|
263
163
|
```
|
|
264
164
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
(`DISCORD_BOT_TOKEN`, `GITHUB_TOKEN`,
|
|
270
|
-
`GDRIVE_ACCESS_TOKEN`, `GMAIL_ACCESS_TOKEN`).
|
|
271
|
-
- **CLI-bridge backends** (recommended where available): `gmail` accepts
|
|
272
|
-
`"backend": "himalaya"` to index any IMAP/Maildir account the external
|
|
273
|
-
[himalaya](https://pimalaya.org) CLI has configured (no OAuth plumbing);
|
|
274
|
-
`gdrive` accepts `"backend": "rclone"` to index a Google Drive remote (or
|
|
275
|
-
any of rclone's 70+ backends) configured via `rclone config` — Docs/Sheets
|
|
276
|
-
are exported as text through `--drive-export-formats`. Auth lives entirely
|
|
277
|
-
in the external tool's own config, matching the katok pattern.
|
|
278
|
-
- `whatsapp` requires the external
|
|
279
|
-
[wacrawl](https://github.com/openclaw/wacrawl) binary
|
|
280
|
-
(`brew install openclaw/tap/wacrawl`). Optional trusted connector fields are
|
|
281
|
-
`binaryPath`, `databasePath`, and `sourcePath`. Live desktop ingestion is
|
|
282
|
-
macOS-only; the crawler owns Full Disk Access and archive setup.
|
|
283
|
-
- `telegram` requires the external
|
|
284
|
-
[telecrawl](https://github.com/openclaw/telecrawl) binary
|
|
285
|
-
(`brew install openclaw/tap/telecrawl`). Optional trusted connector fields
|
|
286
|
-
are `binaryPath`, `databasePath`, and `sourcePath`. Live desktop ingestion
|
|
287
|
-
is macOS-only; the crawler owns Full Disk Access and archive setup.
|
|
288
|
-
- `slack` requires the external
|
|
289
|
-
[slacrawl](https://github.com/openclaw/slacrawl) binary
|
|
290
|
-
(`brew install openclaw/tap/slacrawl`). Optional trusted connector fields
|
|
291
|
-
are `binaryPath`, `configPath`, and `syncSource`; Slack credentials and
|
|
292
|
-
remote source definitions stay in slacrawl's own configuration.
|
|
293
|
-
- `notion` requires the external
|
|
294
|
-
[notcrawl](https://github.com/openclaw/notcrawl) binary
|
|
295
|
-
(`brew install openclaw/tap/notcrawl`). Optional trusted connector fields
|
|
296
|
-
are `binaryPath` and `configPath`; Notion credentials and workspace
|
|
297
|
-
definitions stay in notcrawl's own configuration.
|
|
298
|
-
- Access is **default-deny**: without `datasourceAccess.allowedTags`, no
|
|
299
|
-
datasource skill is announced or searchable, even when configured.
|
|
300
|
-
`allowedScopes` are opaque slash-hierarchical roots like `/slack/<instance>/**`.
|
|
301
|
-
- Per-skill options: `instanceId`, `pollingIntervalMs`, `tags`, and the
|
|
302
|
-
connector-specific `connector` object. `false` or `{ "enabled": false }`
|
|
303
|
-
disables an entry. Unknown skill names fail config resolution.
|
|
304
|
-
- `autorag refresh --method datasources` indexes them; chunks persist under
|
|
305
|
-
`<workspace>/.autorag/datasources/<skill>/<instance>/`.
|
|
306
|
-
- Verify with the manual QA harness: `bun scripts/manual-qa/run-qa.ts`
|
|
307
|
-
(see `docs/manual-qa-datasources.md`).
|
|
308
|
-
|
|
309
|
-
## Build indexes after install
|
|
310
|
-
|
|
311
|
-
Installation + `init` alone does **not** make search useful. Immediately after
|
|
312
|
-
the approved config is written, build the local indexes before handing off to
|
|
313
|
-
the `autorag` skill.
|
|
314
|
-
|
|
315
|
-
### What `autorag refresh` builds
|
|
316
|
-
|
|
317
|
-
`autorag refresh` is the post-setup indexing step. It is model-free and:
|
|
318
|
-
|
|
319
|
-
1. **Parses** approved source files into workspace-local `.autorag/parsed`
|
|
320
|
-
markdown mirrors.
|
|
321
|
-
2. **Prepares BM25** lexical indexes over those mirrors.
|
|
322
|
-
3. **Embeds into the MinSync vector DB** (semantic index) over the same mirrors
|
|
323
|
-
when MinSync is configured/available.
|
|
324
|
-
4. **Prepares Jikji maps/caches** under each approved source's `.jikji/` when
|
|
325
|
-
Jikji is configured (indexing only — find answers come later via
|
|
326
|
-
`jikji_find` at search time).
|
|
327
|
-
5. **Indexes authorized datasources** when datasource skills are configured.
|
|
328
|
-
|
|
329
|
-
Order of operations for first-time setup:
|
|
330
|
-
|
|
331
|
-
```bash
|
|
332
|
-
# 1) write approved folders + role models
|
|
333
|
-
autorag init \
|
|
334
|
-
--search-paths "$HOME/Documents,$HOME/Downloads,$HOME/Desktop" \
|
|
335
|
-
--orchestrator-model-provider PROVIDER \
|
|
336
|
-
--orchestrator-model-id ORCHESTRATOR_MODEL \
|
|
337
|
-
--explorer-model-provider PROVIDER \
|
|
338
|
-
--explorer-model-id EXPLORER_MODEL
|
|
339
|
-
|
|
340
|
-
# 2) verify model/provider auth and explorer subagent preflight
|
|
341
|
-
autorag health
|
|
342
|
-
|
|
343
|
-
# 3) parse sources, build BM25, embed MinSync, prepare Jikji maps
|
|
344
|
-
autorag refresh
|
|
345
|
-
|
|
346
|
-
# 4) verify corpus freshness / index health (path-opaque)
|
|
347
|
-
autorag status
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
Interpret results:
|
|
351
|
-
|
|
352
|
-
- `refresh` prints parse counts and BM25 readiness (and datasource rows when
|
|
353
|
-
present). Re-run with `autorag refresh --force` only when a dirty/partial
|
|
354
|
-
index needs a full rebuild path and a lighter incremental refresh is not
|
|
355
|
-
enough.
|
|
356
|
-
- `--method <csv>` restricts which methods refresh runs:
|
|
357
|
-
`bm25,minsync,parsed,datasources,jikji,all`. When omitted, all methods run.
|
|
358
|
-
Parsed mirrors are always synced when BM25 or MinSync is selected (they index
|
|
359
|
-
over the parsed mirrors). Example: `autorag refresh --method bm25,minsync`.
|
|
360
|
-
- `status` is model-free and path-opaque: inspect freshness and component
|
|
361
|
-
health only; do not expect absolute source paths in the output.
|
|
362
|
-
- `health` checks model/provider auth and explorer subagent setup: it resolves
|
|
363
|
-
both role models, verifies credential presence, and (unless `--skip-probes`)
|
|
364
|
-
probes a completion call per role. Use it to confirm both role models resolve
|
|
365
|
-
from the authenticated runtime or written config without displaying
|
|
366
|
-
credentials or private provider details.
|
|
367
|
-
- Do not claim setup succeeded when authentication, indexes, role-model
|
|
368
|
-
resolution, or subagent dispatch remain unverified.
|
|
369
|
-
- Prefer bounded `refresh` over destructive resets. Reserve
|
|
370
|
-
`autorag index rebuild --yes` for a full wipe+reindex of workspace
|
|
371
|
-
`.autorag` parsed/BM25/MinSync dirs only — never against source documents.
|
|
372
|
-
`index reset` and `index rebuild` also accept `--method` to scope which
|
|
373
|
-
indexes are removed/rebuilt (e.g. `autorag index reset --method bm25 --yes`
|
|
374
|
-
removes only the BM25 index).
|
|
375
|
-
|
|
376
|
-
Large first-time corpora can take several minutes for parse + embed. Stay on
|
|
377
|
-
the approximate status of the running refresh rather than starting concurrent
|
|
378
|
-
index jobs.
|
|
379
|
-
|
|
380
|
-
## Customize and extend indexed folders
|
|
381
|
-
|
|
382
|
-
Users can change the indexed set after the initial install. Always get explicit
|
|
383
|
-
approval before adding paths, then re-init (or rewrite config) and refresh.
|
|
384
|
-
|
|
385
|
-
### Add or replace folders
|
|
386
|
-
|
|
387
|
-
1. Collect the desired absolute paths (user paste, or another short recommended
|
|
388
|
-
proposal using the OS tables above).
|
|
389
|
-
2. Prefer merging with the existing approved list rather than silently dropping
|
|
390
|
-
working roots, unless the user asks to replace everything.
|
|
391
|
-
3. Write the new list:
|
|
165
|
+
Tokens are environment-variable names, not raw secrets. CLI-backed connectors
|
|
166
|
+
keep authentication in their external tool configuration. Unknown skill names
|
|
167
|
+
fail config resolution. `scope` and tags can narrow trusted access but cannot
|
|
168
|
+
grant it.
|
|
392
169
|
|
|
393
|
-
|
|
394
|
-
# Replace/extend the configured search roots, preserve role models already set
|
|
395
|
-
autorag init \
|
|
396
|
-
--force \
|
|
397
|
-
--search-paths "/existing/docs,/new/research,/path/to/notes"
|
|
398
|
-
```
|
|
170
|
+
## Verify and build indexes
|
|
399
171
|
|
|
400
|
-
|
|
401
|
-
the same orchestrator/explorer provider+id pair already in
|
|
402
|
-
`~/.autorag/config.json`. Alternatively edit `searchPaths` in that config when
|
|
403
|
-
the agent can safely update JSON without touching credentials/private fields.
|
|
404
|
-
|
|
405
|
-
4. Rebuild indexes for the new roots:
|
|
172
|
+
Configuration alone is not a successful setup:
|
|
406
173
|
|
|
407
174
|
```bash
|
|
408
|
-
autorag refresh
|
|
409
175
|
autorag status
|
|
176
|
+
autorag health
|
|
177
|
+
autorag refresh
|
|
178
|
+
autorag search "summarize the collection" --top-k 3 --json
|
|
410
179
|
```
|
|
411
180
|
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
autorag
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
| OS | Scheduler | Suggested tick (every 30 min) |
|
|
448
|
-
|---|---|---|
|
|
449
|
-
| macOS | `cron` or LaunchAgent in `~/Library/LaunchAgents` | `*/30 * * * * PATH=... NODE_OPTIONS=--max-old-space-size=16384 autorag watch --once` |
|
|
450
|
-
| Linux | `cron` or `systemd --user` timer | same crontab pattern, or a oneshot unit + timer |
|
|
451
|
-
| Windows | Task Scheduler | repeating task every 30 minutes running `autorag watch --once` |
|
|
452
|
-
|
|
453
|
-
Prefer `watch --once`/`refresh` for scheduled ticks. Reserve long-running `watch` for interactive foreground use. Log under `~/.autorag/` (or user temp), never into source document trees. Avoid overlapping concurrent refreshes.
|
|
454
|
-
|
|
455
|
-
Never run reset/rebuild against source document trees. Indexes live under the
|
|
456
|
-
configured workspace's `.autorag/`; Jikji prepare caches live under
|
|
457
|
-
per-source `.jikji/` when enabled.
|
|
458
|
-
|
|
459
|
-
## Hand off
|
|
460
|
-
|
|
461
|
-
After models authenticate, `autorag health` confirms model/provider auth and
|
|
462
|
-
explorer subagent dispatch, folders are approved, `init` has written the config,
|
|
463
|
-
`refresh` has built parsed + BM25 + MinSync (+ optional Jikji/datasource)
|
|
464
|
-
indexes, and `status` looks healthy:
|
|
465
|
-
|
|
466
|
-
- stop the setup skill
|
|
467
|
-
- use the `autorag` skill for normal queries (`autorag search`, then
|
|
468
|
-
`autorag feedback` with the returned `sessionId`)
|
|
469
|
-
- return to this skill when the user adds folders, fixes providers/models, or
|
|
470
|
-
needs a deliberate reindex
|
|
181
|
+
- `status` is model-free and path-opaque.
|
|
182
|
+
- `health` resolves the single model, checks credential presence, and normally
|
|
183
|
+
performs one live completion probe.
|
|
184
|
+
- `health --skip-probes` is only for intentionally offline validation and does
|
|
185
|
+
not prove live provider access.
|
|
186
|
+
- `refresh` syncs parsed mirrors, BM25, MinSync, Jikji, and authorized
|
|
187
|
+
datasources. `--method <csv>` may deliberately narrow it.
|
|
188
|
+
- Use `refresh --force` for a full resync only when incremental refresh is not
|
|
189
|
+
enough. Keep destructive reset/rebuild operations scoped to workspace
|
|
190
|
+
`.autorag` indexes, never source documents.
|
|
191
|
+
|
|
192
|
+
## Keep indexes fresh
|
|
193
|
+
|
|
194
|
+
For continuous freshness, create or verify an OS-appropriate scheduled
|
|
195
|
+
`autorag watch --once` job, typically every 30 minutes. Prefer cron or launchd
|
|
196
|
+
on macOS, cron or a user systemd timer on Linux, and Task Scheduler on Windows.
|
|
197
|
+
Use the same config as search, avoid overlapping runs, and keep logs outside
|
|
198
|
+
source trees.
|
|
199
|
+
|
|
200
|
+
## Environment overrides
|
|
201
|
+
|
|
202
|
+
- `AUTORAG_CONFIG`
|
|
203
|
+
- `AUTORAG_SEARCH_PATHS`
|
|
204
|
+
- `AUTORAG_WORKSPACE`
|
|
205
|
+
- `AUTORAG_MEMORY_PATH`
|
|
206
|
+
- `AUTORAG_MODEL_PROVIDER`
|
|
207
|
+
- `AUTORAG_MODEL_ID`
|
|
208
|
+
|
|
209
|
+
## Completion condition
|
|
210
|
+
|
|
211
|
+
Setup is complete only when roots are approved, a non-secret single-model
|
|
212
|
+
config is written, `status` is acceptable, live `health` passes, `refresh`
|
|
213
|
+
builds the requested indexes, one real structured search succeeds, and any
|
|
214
|
+
requested ongoing schedule is installed or verified.
|