@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
|
@@ -1,213 +1,149 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag-setup
|
|
3
|
-
description:
|
|
3
|
+
description: Install and configure AutoRAG, or repair its single search model, approved document roots, retrieval indexes, datasource skills, and health checks without exposing credentials. Use when autorag is missing, init/refresh/health fails, indexes are stale, or the user wants to add folders or datasources.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
|
-
# AutoRAG
|
|
7
|
+
# AutoRAG setup
|
|
7
8
|
|
|
8
|
-
Use this skill
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
normal searches and feedback.
|
|
9
|
+
Use this skill when AutoRAG is unconfigured, the `autorag` CLI is missing, model
|
|
10
|
+
resolution fails, indexes are missing or stale, or the user wants to change the
|
|
11
|
+
document collection or datasources.
|
|
12
12
|
|
|
13
|
-
## Safety
|
|
13
|
+
## Safety
|
|
14
14
|
|
|
15
15
|
- 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.
|
|
16
|
+
- Never print, copy, migrate, compare, or persist credential values. Store only
|
|
17
|
+
environment-variable names such as `apiKeyEnv`.
|
|
19
18
|
- Do not scan the whole filesystem or home directory without explicit approval.
|
|
20
19
|
- Never move, rename, edit, or delete source documents.
|
|
21
|
-
-
|
|
22
|
-
|
|
20
|
+
- Do not index system trees, app bundles, caches, credential stores,
|
|
21
|
+
`node_modules`, `.git`, `dist`, `build`, `target`, `.cache`, `.autorag`, or
|
|
22
|
+
`.jikji`.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Install the CLI if needed
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
usable configuration from available evidence.
|
|
26
|
+
The CLI is `@autorag/librarian` (`autorag`). Runtime is Node.js ≥ 24 or Bun.
|
|
28
27
|
|
|
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.
|
|
44
|
-
|
|
45
|
-
If no compatible authenticated runtime exists, report the exact missing public
|
|
46
|
-
provider/authentication requirement. Do not write a configuration that cannot
|
|
47
|
-
run. Ask one concise question only when multiple equally suitable public
|
|
48
|
-
providers remain and runtime evidence cannot choose between them.
|
|
49
|
-
|
|
50
|
-
## Select role models
|
|
51
|
-
|
|
52
|
-
Select only models actually advertised by the authenticated runtime:
|
|
28
|
+
```bash
|
|
29
|
+
command -v autorag >/dev/null || bun install -g @autorag/librarian
|
|
30
|
+
autorag --help
|
|
31
|
+
```
|
|
53
32
|
|
|
54
|
-
|
|
55
|
-
- `agents.explorer`: faster, cheaper high-recall model with sufficient context.
|
|
56
|
-
- If only one usable model exists, configure it for both roles.
|
|
57
|
-
- Preserve an existing working explicit pair.
|
|
58
|
-
- Never invent model IDs or write a private provider alias into distributed or
|
|
59
|
-
user-facing configuration.
|
|
33
|
+
If Bun is unavailable, `npm install -g @autorag/librarian` is acceptable.
|
|
60
34
|
|
|
61
|
-
|
|
62
|
-
If role models are intentionally omitted, leave them unset so search-time
|
|
63
|
-
resolution can still pick up an authenticated local runtime when available.
|
|
35
|
+
## Inspect existing configuration
|
|
64
36
|
|
|
65
|
-
|
|
37
|
+
Check `--config`, `AUTORAG_CONFIG`, `$AUTORAG_HOME/config.json`, or
|
|
38
|
+
`~/.autorag/config.json`. Relevant fields are:
|
|
66
39
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
40
|
+
- `searchPaths`, `workspacePath`, and `memoryPath`
|
|
41
|
+
- `model.provider`, `model.id`, `model.api`, `model.baseUrl`, `model.apiKeyEnv`
|
|
42
|
+
- `bm25`, `minSync`, and `jikji`
|
|
43
|
+
- `datasources`, `datasourceAccess`, and `ui`
|
|
70
44
|
|
|
71
|
-
|
|
45
|
+
Preserve explicit user choices and a working config unless the user asks to
|
|
46
|
+
replace them or health checks fail.
|
|
72
47
|
|
|
73
|
-
|
|
48
|
+
## Configure one search model
|
|
74
49
|
|
|
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>`) |
|
|
50
|
+
AutoRAG is the specialized librarian agent. One configured model plans the
|
|
51
|
+
search, calls retrieval and filesystem tools, reads sources, judges evidence,
|
|
52
|
+
and curates the answer in one loop. There are no orchestrator/explorer roles.
|
|
80
53
|
|
|
81
|
-
|
|
82
|
-
for
|
|
83
|
-
|
|
54
|
+
Prefer a model with reliable tool calling and structured output, enough context
|
|
55
|
+
for source excerpts, high output TPS, and low first-token latency. Use a larger
|
|
56
|
+
reasoning model only when difficult synthesis or domain judgment matters more
|
|
57
|
+
than latency.
|
|
84
58
|
|
|
85
|
-
|
|
59
|
+
Start from a provider/model the current runtime can actually call. A Pi-usable
|
|
60
|
+
ChatGPT, Claude, Gemini, or other authenticated subscription is valid; an
|
|
61
|
+
installed CLI or subscription that Pi cannot invoke is not. For custom
|
|
62
|
+
OpenAI-compatible endpoints, record the real wire API, base URL, and credential
|
|
63
|
+
environment-variable name.
|
|
86
64
|
|
|
87
|
-
|
|
88
|
-
Mark each as **recommended** or **optional**, and never enable a path that does
|
|
89
|
-
not exist.
|
|
65
|
+
Allowed `api` values:
|
|
90
66
|
|
|
91
|
-
|
|
67
|
+
- `openai-completions`
|
|
68
|
+
- `openai-responses`
|
|
69
|
+
- `anthropic-messages`
|
|
70
|
+
- `openai-codex-responses`
|
|
71
|
+
- `azure-openai-responses`
|
|
92
72
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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 |
|
|
73
|
+
If no callable setup can be established, ask the user for the provider, model
|
|
74
|
+
id, API protocol, base URL when custom, and credential environment-variable
|
|
75
|
+
name. Do not invent provider identities or model ids.
|
|
100
76
|
|
|
101
|
-
|
|
102
|
-
Skip `~/Library`, `~/Applications`, and Time Machine volumes unless the user
|
|
103
|
-
explicitly points there.
|
|
77
|
+
## Propose and approve document roots
|
|
104
78
|
|
|
105
|
-
|
|
79
|
+
Explicit user paths win. Otherwise inspect only these likely document-dense
|
|
80
|
+
candidates for existence and approximate supported-file counts, then ask for
|
|
81
|
+
approval before indexing:
|
|
106
82
|
|
|
107
|
-
|
|
|
83
|
+
| OS | Recommended | Optional |
|
|
108
84
|
|---|---|---|
|
|
109
|
-
|
|
|
110
|
-
|
|
|
111
|
-
|
|
|
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 |
|
|
121
|
-
|---|---|---|
|
|
122
|
-
| Recommended | `%USERPROFILE%\Documents` | Document library (also OneDrive Documents if that is the real shell folder) |
|
|
123
|
-
| Recommended | `%USERPROFILE%\Downloads` | Incoming PDFs and exports |
|
|
124
|
-
| Recommended | `%USERPROFILE%\Desktop` | Working files |
|
|
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.
|
|
85
|
+
| macOS | `~/Documents`, `~/Downloads`, `~/Desktop` | `~/Notes`, `~/Obsidian`, user-named project docs |
|
|
86
|
+
| Linux | XDG Documents/Downloads/Desktop or their `~/` defaults | `~/Notes`, `~/Sync`, Nextcloud/Syncthing roots |
|
|
87
|
+
| Windows | Documents, Downloads, Desktop shell folders | OneDrive document roots, user-named project docs |
|
|
145
88
|
|
|
146
|
-
|
|
147
|
-
`
|
|
89
|
+
Supported parsed formats are `md`, `markdown`, `txt`, `text`, `pdf`, `docx`,
|
|
90
|
+
`pptx`, `xlsx`, `xls`, `hwp`, `hwpx`, and `eml`. OCR for `jpg`, `jpeg`, `png`, `bmp`,
|
|
91
|
+
and `tiff` is optional (`parserOptions.ocr.enabled`). Do not present legacy
|
|
92
|
+
`.doc` as a supported parsed format.
|
|
148
93
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```text
|
|
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.
|
|
94
|
+
Keep the first-run set small, usually one to three roots. Present a concrete
|
|
95
|
+
proposal and require `yes`, a narrowed keep-list, a custom list, or `skip`
|
|
96
|
+
before running `refresh`.
|
|
171
97
|
|
|
172
98
|
## Initialize
|
|
173
99
|
|
|
174
|
-
Write the approved paths and selected role models:
|
|
175
|
-
|
|
176
100
|
```bash
|
|
177
101
|
autorag init \
|
|
178
|
-
--search-paths "/path/to/
|
|
179
|
-
--
|
|
180
|
-
--
|
|
181
|
-
--
|
|
182
|
-
--explorer-model-id EXPLORER_MODEL
|
|
102
|
+
--search-paths "/path/to/documents,/path/to/notes" \
|
|
103
|
+
--workspace "/path/to/workspace" \
|
|
104
|
+
--model-provider PROVIDER \
|
|
105
|
+
--model-id MODEL
|
|
183
106
|
```
|
|
184
107
|
|
|
185
|
-
|
|
186
|
-
|
|
108
|
+
If the authenticated local runtime already supplies the intended model, model
|
|
109
|
+
flags may be omitted. For a custom endpoint, add `api`, `baseUrl`, and
|
|
110
|
+
`apiKeyEnv` to the single `model` object in the trusted config:
|
|
187
111
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
112
|
+
```json
|
|
113
|
+
{
|
|
114
|
+
"searchPaths": ["/path/to/documents"],
|
|
115
|
+
"model": {
|
|
116
|
+
"provider": "openrouter",
|
|
117
|
+
"id": "anthropic/claude-sonnet-4",
|
|
118
|
+
"api": "openai-completions",
|
|
119
|
+
"baseUrl": "https://openrouter.ai/api/v1",
|
|
120
|
+
"apiKeyEnv": "OPENROUTER_API_KEY"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
191
124
|
|
|
192
|
-
|
|
125
|
+
Use `--force` only when intentionally replacing an existing config. Legacy cwd
|
|
126
|
+
`autorag.config.json` is a migration source only and is never deleted by init.
|
|
193
127
|
|
|
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`).
|
|
128
|
+
### Retrieval defaults
|
|
198
129
|
|
|
199
|
-
MinSync
|
|
200
|
-
|
|
201
|
-
|
|
130
|
+
BM25, MinSync, and Jikji are enabled by default. Leave them enabled unless the
|
|
131
|
+
user explicitly asks otherwise. MinSync auto-installs a verified GitHub release
|
|
132
|
+
into `<workspace>/.autorag/bin` on first use (`minSync.autoInstall` defaults to
|
|
133
|
+
true). Set `"autoInstall": false` only when managing the binary yourself. Jikji
|
|
134
|
+
auto-installs `jikji-cli` through cargo when enabled (`jikji.autoInstall`
|
|
135
|
+
defaults to true; requires the Rust toolchain).
|
|
202
136
|
|
|
203
|
-
|
|
137
|
+
Exact duplicate exclusion is enabled by default. AutoRAG invokes the external
|
|
138
|
+
`dupey` CLI before parsed-mirror indexing, keeps the newest filesystem copy for
|
|
139
|
+
each exact canonical-text hash, and excludes older copies from the mirror. Set
|
|
140
|
+
`"excludeExactDuplicates": false` to index every copy. Missing dupey is
|
|
141
|
+
non-fatal; refresh continues without this optimization.
|
|
204
142
|
|
|
205
|
-
|
|
206
|
-
into `minSync.embedder` in the config:
|
|
143
|
+
Optional MinSync embedder settings:
|
|
207
144
|
|
|
208
145
|
```bash
|
|
209
146
|
autorag init \
|
|
210
|
-
--search-paths "/path/to/docs" \
|
|
211
147
|
--embedder-id "text-embedding-3-small" \
|
|
212
148
|
--embedder-base-url "https://api.openai.com/v1" \
|
|
213
149
|
--embedder-api-key-env "OPENAI_API_KEY" \
|
|
@@ -215,256 +151,95 @@ autorag init \
|
|
|
215
151
|
--embedder-batch-size 64
|
|
216
152
|
```
|
|
217
153
|
|
|
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:
|
|
154
|
+
Only store the environment-variable name, never its value. Dimension and batch
|
|
155
|
+
size must be positive integers.
|
|
229
156
|
|
|
230
|
-
|
|
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`
|
|
157
|
+
## Configure datasource skills when requested
|
|
234
158
|
|
|
235
|
-
|
|
159
|
+
Prefer `autorag ui --no-open` to connect datasources. It writes the same trusted
|
|
160
|
+
`datasources` / `datasourceAccess` fields as a hand-edited config, stores
|
|
161
|
+
env-var names rather than secrets, and prints a loopback URL (`127.0.0.1`).
|
|
162
|
+
Do not bind non-loopback hosts unless the user explicitly set `ui.allowRemote`.
|
|
236
163
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
`
|
|
164
|
+
Datasource skills belong in trusted config and remain default-deny. Builtin
|
|
165
|
+
template names are `kakao`, `whatsapp`, `telegram`, `slack`, `discord`,
|
|
166
|
+
`clawgallery`, `notion`, `github`, `cloud-drive`, `gmail`, `mail-export`,
|
|
167
|
+
`mailcrawl`, `obsidian`, `rss`, and `spotlight`. Config keys may be connection
|
|
168
|
+
aliases with `"type": "<template>"`. Unknown names are skipped with an
|
|
169
|
+
`unknown-datasource-skill` warning; they do not fail config resolution.
|
|
170
|
+
`scope` and tags can narrow trusted access but cannot grant it.
|
|
242
171
|
|
|
243
172
|
```jsonc
|
|
244
173
|
{
|
|
245
174
|
"datasources": {
|
|
246
|
-
"
|
|
247
|
-
"
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
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"] } },
|
|
175
|
+
"github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
|
|
176
|
+
"google-drive": { "type": "cloud-drive", "connector": { "provider": "google-drive", "remote": "gdrive:" } },
|
|
177
|
+
"archive-drive": { "type": "cloud-drive", "connector": { "remote": "archive:" } },
|
|
178
|
+
"gmail": { "connector": { "backend": "himalaya", "account": "gmail", "folder": "INBOX" } },
|
|
179
|
+
"mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
|
|
255
180
|
"obsidian": { "connector": { "vaultPath": "/path/to/vault" } },
|
|
256
|
-
"rss":
|
|
181
|
+
"rss": { "connector": { "feeds": [{ "url": "https://example.com/feed.xml" }] } }
|
|
257
182
|
},
|
|
258
183
|
"datasourceAccess": {
|
|
259
|
-
"allowedTags": ["
|
|
260
|
-
"allowedScopes": ["/
|
|
184
|
+
"allowedTags": ["github", "cloud-drive", "gmail", "mailcrawl", "obsidian", "rss"],
|
|
185
|
+
"allowedScopes": ["/github/**", "/google-drive/**", "/archive-drive/**", "/gmail/**", "/mailcrawl/**", "/obsidian/**", "/rss/**"]
|
|
261
186
|
}
|
|
262
187
|
}
|
|
263
188
|
```
|
|
264
189
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
- REST connector tokens are configured as **environment variable names** (`tokenEnv`), never
|
|
268
|
-
raw secrets in the file. Each skill has a default env var
|
|
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:
|
|
190
|
+
Tokens are environment-variable names, not raw secrets. CLI-backed connectors
|
|
191
|
+
keep authentication in their external tool configuration.
|
|
330
192
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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:
|
|
392
|
-
|
|
393
|
-
```bash
|
|
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
|
-
```
|
|
399
|
-
|
|
400
|
-
If role models must be preserved and you are rewriting via `init --force`, pass
|
|
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:
|
|
406
|
-
|
|
407
|
-
```bash
|
|
408
|
-
autorag refresh
|
|
409
|
-
autorag status
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Narrow temporarily without re-init
|
|
413
|
-
|
|
414
|
-
For a one-off search scope, prefer `autorag search "…" --scope <virtual-subpath>`
|
|
415
|
-
through the `autorag` skill after setup. Scope narrows retrieval; it does not
|
|
416
|
-
add new roots to the permanent index set.
|
|
417
|
-
|
|
418
|
-
### Env/flag overrides for automation
|
|
419
|
-
|
|
420
|
-
Machine-driven agents may point at a custom list without rewriting the default
|
|
421
|
-
home config:
|
|
422
|
-
|
|
423
|
-
```bash
|
|
424
|
-
AUTORAG_SEARCH_PATHS="/docs,/notes" autorag refresh
|
|
425
|
-
# or
|
|
426
|
-
autorag refresh --search-paths "/docs,/notes"
|
|
427
|
-
```
|
|
193
|
+
Mailcrawl must be installed separately (`@nomadamas/mailcrawl@0.1.4` or newer)
|
|
194
|
+
and configured through its own Himalaya account. AutoRAG runs its local `sync`
|
|
195
|
+
and `index` lifecycle, then uses the mailcrawl CLI for BM25, semantic, or
|
|
196
|
+
hybrid search. Do not use 0.1.3 or earlier: a no-op sync followed by `index`
|
|
197
|
+
fails with `text array must be non-empty`.
|
|
428
198
|
|
|
429
|
-
|
|
430
|
-
persist planned long-term folders with `autorag init` so later searches and
|
|
431
|
-
refreshes share the same set.
|
|
199
|
+
## Verify and build indexes
|
|
432
200
|
|
|
433
|
-
|
|
201
|
+
Configuration alone is not a successful setup:
|
|
434
202
|
|
|
435
203
|
```bash
|
|
436
|
-
autorag status
|
|
437
|
-
autorag
|
|
438
|
-
autorag
|
|
439
|
-
autorag
|
|
440
|
-
autorag refresh --force # force a full re-sync when needed
|
|
441
|
-
autorag index rebuild --yes # wipe parsed/BM25/MinSync under .autorag, then forced refresh
|
|
442
|
-
autorag memory inspect # read-only retrieval memory snapshot
|
|
204
|
+
autorag status --json
|
|
205
|
+
autorag health --json
|
|
206
|
+
autorag refresh --json
|
|
207
|
+
autorag search "summarize the collection" --top-k 3 --json --debug
|
|
443
208
|
```
|
|
444
209
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
-
|
|
468
|
-
|
|
469
|
-
-
|
|
470
|
-
|
|
210
|
+
- `status` is model-free and path-opaque.
|
|
211
|
+
- `health` resolves the single model, checks credential presence, and normally
|
|
212
|
+
performs one live completion probe.
|
|
213
|
+
- `health --skip-probes` is only for intentionally offline validation and does
|
|
214
|
+
not prove live provider access.
|
|
215
|
+
- `refresh` syncs parsed mirrors, BM25, MinSync, Jikji, and authorized
|
|
216
|
+
datasources. `--method <csv>` may deliberately narrow it
|
|
217
|
+
(`parsed,bm25,minsync,datasources,jikji,all`).
|
|
218
|
+
- Use `refresh --force` for a full resync only when incremental refresh is not
|
|
219
|
+
enough. Keep destructive reset/rebuild operations scoped to workspace
|
|
220
|
+
`.autorag` indexes, never source documents.
|
|
221
|
+
|
|
222
|
+
## Keep indexes fresh
|
|
223
|
+
|
|
224
|
+
For continuous freshness, create or verify an OS-appropriate scheduled
|
|
225
|
+
`autorag watch --once` job, typically every 15–30 minutes. Prefer cron or
|
|
226
|
+
launchd on macOS, cron or a user systemd timer on Linux, and Task Scheduler on
|
|
227
|
+
Windows. Use the same config as search, avoid overlapping runs, and keep logs
|
|
228
|
+
outside source trees.
|
|
229
|
+
|
|
230
|
+
## Environment overrides
|
|
231
|
+
|
|
232
|
+
- `AUTORAG_HOME`
|
|
233
|
+
- `AUTORAG_CONFIG`
|
|
234
|
+
- `AUTORAG_SEARCH_PATHS`
|
|
235
|
+
- `AUTORAG_WORKSPACE`
|
|
236
|
+
- `AUTORAG_MEMORY_PATH`
|
|
237
|
+
- `AUTORAG_MODEL_PROVIDER`
|
|
238
|
+
- `AUTORAG_MODEL_ID`
|
|
239
|
+
|
|
240
|
+
## Completion condition
|
|
241
|
+
|
|
242
|
+
Setup is complete only when the CLI is installed, roots are approved, a
|
|
243
|
+
non-secret single-model config is written, `status` is acceptable, live `health`
|
|
244
|
+
passes, `refresh` builds the requested indexes, one real structured search
|
|
245
|
+
succeeds, and any requested ongoing schedule is installed or verified.
|