@autorag/librarian 2.3.0 → 2.4.1
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 +143 -16
- package/dist/agent/agent.d.ts +45 -13
- package/dist/agent/bash-tool.d.ts +2 -0
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/search-documents.d.ts +12 -3
- package/dist/agent/search-minsync-tool.d.ts +2 -2
- package/dist/cli/commands/evidence.d.ts +3 -0
- package/dist/cli/commands/index.d.ts +3 -3
- package/dist/cli/commands/refresh.d.ts +3 -4
- 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/commands/watch.d.ts +1 -1
- package/dist/cli/config.d.ts +17 -19
- package/dist/cli/index.js +14497 -10906
- 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/crawler-types.d.ts +2 -0
- package/dist/datasource/described-skill.d.ts +17 -0
- package/dist/datasource/index.d.ts +3 -3
- 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 +1 -0
- package/dist/datasource/skills/{gdrive → cloud-drive}/rclone-connector.d.ts +4 -0
- package/dist/datasource/skills/cloud-drive/skill.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +4 -8
- package/dist/datasource/skills/factory.d.ts +2 -0
- package/dist/datasource/skills/gmail/index.d.ts +0 -1
- package/dist/datasource/skills/gmail/skill.d.ts +1 -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 +1 -0
- package/dist/datasource/skills/obsidian/types.d.ts +2 -0
- package/dist/datasource/types.d.ts +5 -2
- package/dist/filesystem/cloud-placeholder.d.ts +26 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2591 -1438
- package/dist/jikji/client.d.ts +3 -0
- 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 +17 -8
- package/dist/minsync/types.d.ts +5 -0
- package/dist/mirror/sync.d.ts +1 -1
- 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/retrieval/index.d.ts +0 -2
- package/dist/retrieval/registry.d.ts +2 -2
- package/dist/retrieval/types.d.ts +1 -1
- 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 +17 -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 +13 -12
- package/skills/autorag/SKILL.md +64 -43
- package/skills/autorag-setup/SKILL.md +76 -39
- package/dist/agent/search-bm25-tool.d.ts +0 -18
- 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/skill.d.ts +0 -24
- package/dist/datasource/skills/gmail/himalaya-connector.d.ts +0 -40
- package/dist/retrieval/methods/bm25.d.ts +0 -52
package/skills/autorag/SKILL.md
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag
|
|
3
|
-
description:
|
|
3
|
+
description: Search, summarize, compare, and answer questions from an already configured AutoRAG librarian over local documents and authorized datasources. Use when the user asks AutoRAG to search PDFs, wikis, notes, or a knowledge base. Use autorag-setup for install, model, roots, indexing, or datasource changes.
|
|
4
|
+
license: MIT
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# AutoRAG Librarian Skill
|
|
7
8
|
|
|
8
9
|
Use this skill when AutoRAG is already configured and the user asks to search,
|
|
9
10
|
summarize, compare, or answer questions from local PDFs, wikis, notes, research
|
|
10
|
-
papers, or
|
|
11
|
+
papers, knowledge bases, or authorized datasources.
|
|
11
12
|
|
|
12
13
|
AutoRAG is the specialized librarian agent. One configured model plans the
|
|
13
|
-
search, calls
|
|
14
|
+
search, calls MinSync, Jikji, datasource, and filesystem tools, reads
|
|
14
15
|
sources, judges evidence, and curates the final answer. There is no subagent or
|
|
15
16
|
separate model role.
|
|
16
17
|
|
|
@@ -20,14 +21,14 @@ move, rename, edit, or delete source files.
|
|
|
20
21
|
|
|
21
22
|
## Preflight
|
|
22
23
|
|
|
23
|
-
Confirm
|
|
24
|
-
|
|
24
|
+
Confirm a config exists at `--config`, `AUTORAG_CONFIG`,
|
|
25
|
+
`$AUTORAG_HOME/config.json`, or `~/.autorag/config.json`. Inspect only
|
|
26
|
+
non-secret `searchPaths` and `model` metadata, then run:
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
autorag duplicates
|
|
28
|
-
autorag
|
|
29
|
-
autorag
|
|
30
|
-
autorag health
|
|
29
|
+
autorag duplicates --json
|
|
30
|
+
autorag status --json
|
|
31
|
+
autorag health --json
|
|
31
32
|
```
|
|
32
33
|
|
|
33
34
|
### Duplicate-file review
|
|
@@ -45,59 +46,78 @@ checks credential presence, and normally probes one live completion. If the
|
|
|
45
46
|
model, authentication, configuration, or indexes are unhealthy, use
|
|
46
47
|
`autorag-setup` rather than guessing private provider details.
|
|
47
48
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
MinSync and Jikji should normally be healthy. MinSync and Jikji
|
|
50
|
+
auto-install on first use by default. If they are missing or stale, run a full
|
|
51
|
+
`autorag refresh` or return to setup rather than silently degrading to
|
|
52
|
+
lexical-only search.
|
|
51
53
|
|
|
52
54
|
## Search
|
|
53
55
|
|
|
56
|
+
Prefer `--json --debug` when another agent will consume the result or record
|
|
57
|
+
feedback. `--json` alone omits `sessionId`. `--debug` adds session/diagnostics
|
|
58
|
+
fields and does not print filesystem paths.
|
|
59
|
+
|
|
54
60
|
```bash
|
|
55
|
-
autorag search "what were the key findings in the Q3 report" --top-k 5 --json
|
|
61
|
+
autorag search "what were the key findings in the Q3 report" --top-k 5 --json --debug
|
|
56
62
|
```
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
and
|
|
64
|
+
`--json --debug` includes `answer`, numbered `results` (`number`, `title`,
|
|
65
|
+
`summary`, optional `source`), and `sessionId`. Use that `sessionId` for
|
|
66
|
+
feedback. `--json` without `--debug` is only `answer` plus `results`.
|
|
67
|
+
|
|
68
|
+
To inspect the exact persisted evidence behind numbered results, use:
|
|
60
69
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
70
|
+
```bash
|
|
71
|
+
autorag evidence <sessionId> --result 1 --json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The response includes the original source, retrieval method, stable evidence
|
|
75
|
+
ID, raw excerpt/content, and any available `chunkIndex`, `lineNumber`,
|
|
76
|
+
`retrievalResultId`, and metadata. Omit `--result` to inspect every result in
|
|
77
|
+
the session. Prefer this command whenever the caller wants detailed chunk text
|
|
78
|
+
rather than only the curated summary.
|
|
79
|
+
|
|
80
|
+
- `--scope` narrows datasource retrieval to a requested sub-path; it cannot
|
|
81
|
+
grant access.
|
|
82
|
+
- `--tags` further narrows already-authorized datasource results and never
|
|
83
|
+
grants new access.
|
|
84
|
+
- `--json` is required for programmatic consumption.
|
|
85
|
+
- `--debug` is required for `sessionId` and diagnostics in search output.
|
|
86
|
+
- `autorag evidence` is the detailed source/chunk inspection path.
|
|
66
87
|
|
|
67
88
|
Do not bypass the librarian with ad hoc raw search when the user requested
|
|
68
|
-
AutoRAG. The search loop can use Jikji,
|
|
89
|
+
AutoRAG. The search loop can use Jikji, MinSync lexical/vector/hybrid retrieval, datasource retrieval, and
|
|
69
90
|
direct source reading as appropriate. If search fails because of model,
|
|
70
|
-
provider, auth, or timeout problems, diagnose with `autorag health`.
|
|
91
|
+
provider, auth, or timeout problems, diagnose with `autorag health --json`.
|
|
71
92
|
|
|
72
|
-
Record feedback so retrieval memory can learn
|
|
93
|
+
Record feedback so retrieval memory can learn. Numbers refer to the returned
|
|
94
|
+
knowledge units. Supply at least one feedback list:
|
|
73
95
|
|
|
74
96
|
```bash
|
|
75
|
-
autorag feedback <sessionId> --useful 1,3 --not-useful 2
|
|
97
|
+
autorag feedback <sessionId> --useful 1,3 --not-useful 2 --json
|
|
76
98
|
```
|
|
77
99
|
|
|
78
|
-
Supply at least one feedback list. Numbers refer to the returned knowledge
|
|
79
|
-
units.
|
|
80
|
-
|
|
81
100
|
## Maintenance
|
|
82
101
|
|
|
83
102
|
```bash
|
|
84
|
-
autorag status
|
|
85
|
-
autorag health
|
|
86
|
-
autorag refresh
|
|
87
|
-
autorag refresh --method bm25,minsync,jikji
|
|
88
|
-
autorag watch --once
|
|
103
|
+
autorag status --json
|
|
104
|
+
autorag health --json
|
|
105
|
+
autorag refresh --json
|
|
106
|
+
autorag refresh --method bm25,minsync,jikji --json
|
|
107
|
+
autorag watch --once --json
|
|
89
108
|
autorag watch
|
|
90
|
-
autorag refresh --force
|
|
91
|
-
autorag index rebuild --yes
|
|
92
|
-
autorag index reset --method bm25 --yes
|
|
93
|
-
autorag memory inspect
|
|
109
|
+
autorag refresh --force --json
|
|
110
|
+
autorag index rebuild --yes --json
|
|
111
|
+
autorag index reset --method bm25 --yes --json
|
|
112
|
+
autorag memory inspect --json
|
|
94
113
|
```
|
|
95
114
|
|
|
96
|
-
Prefer a full refresh so parsed mirrors,
|
|
97
|
-
datasources stay aligned.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
115
|
+
Prefer a full refresh so parsed mirrors, MinSync, Jikji, and configured
|
|
116
|
+
datasources stay aligned. `--method` accepts
|
|
117
|
+
`parsed,minsync,datasources,jikji,all`. Use it only for deliberate
|
|
118
|
+
narrowing. Scheduled maintenance should use non-daemon `autorag watch --once`,
|
|
119
|
+
typically every 15–30 minutes, with the same config used by search and no
|
|
120
|
+
overlapping runs.
|
|
101
121
|
|
|
102
122
|
Reset and rebuild commands remove only selected workspace `.autorag` indexes.
|
|
103
123
|
Never target source documents. `memory inspect` is read-only and path-opaque.
|
|
@@ -106,7 +126,8 @@ Never target source documents. `memory inspect` is read-only and path-opaque.
|
|
|
106
126
|
|
|
107
127
|
- Use only configured and approved search paths.
|
|
108
128
|
- Never expose provider credentials or authentication payloads.
|
|
109
|
-
- Never invent
|
|
129
|
+
- Never invent provider identities or model ids.
|
|
110
130
|
- A Pi-usable subscription is valid; a subscription Pi cannot invoke is not.
|
|
111
131
|
- Preserve real source mapping and numbered feedback identifiers.
|
|
112
|
-
- Prefer `--json` when another agent consumes
|
|
132
|
+
- Prefer `--json --debug` when another agent consumes search output or will
|
|
133
|
+
call `autorag feedback`.
|
|
@@ -1,12 +1,14 @@
|
|
|
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
7
|
# AutoRAG setup
|
|
7
8
|
|
|
8
|
-
Use this skill when AutoRAG is unconfigured,
|
|
9
|
-
missing or stale, or the user wants to change the
|
|
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.
|
|
10
12
|
|
|
11
13
|
## Safety
|
|
12
14
|
|
|
@@ -19,15 +21,26 @@ missing or stale, or the user wants to change the document collection.
|
|
|
19
21
|
`node_modules`, `.git`, `dist`, `build`, `target`, `.cache`, `.autorag`, or
|
|
20
22
|
`.jikji`.
|
|
21
23
|
|
|
24
|
+
## Install the CLI if needed
|
|
25
|
+
|
|
26
|
+
The CLI is `@autorag/librarian` (`autorag`). Runtime is Node.js ≥ 24 or Bun.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
command -v autorag >/dev/null || bun install -g @autorag/librarian
|
|
30
|
+
autorag --help
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If Bun is unavailable, `npm install -g @autorag/librarian` is acceptable.
|
|
34
|
+
|
|
22
35
|
## Inspect existing configuration
|
|
23
36
|
|
|
24
|
-
Check
|
|
25
|
-
|
|
37
|
+
Check `--config`, `AUTORAG_CONFIG`, `$AUTORAG_HOME/config.json`, or
|
|
38
|
+
`~/.autorag/config.json`. Relevant fields are:
|
|
26
39
|
|
|
27
40
|
- `searchPaths`, `workspacePath`, and `memoryPath`
|
|
28
41
|
- `model.provider`, `model.id`, `model.api`, `model.baseUrl`, `model.apiKeyEnv`
|
|
29
42
|
- `bm25`, `minSync`, and `jikji`
|
|
30
|
-
- `datasources` and `
|
|
43
|
+
- `datasources`, `datasourceAccess`, and `ui`
|
|
31
44
|
|
|
32
45
|
Preserve explicit user choices and a working config unless the user asks to
|
|
33
46
|
replace them or health checks fail.
|
|
@@ -73,9 +86,10 @@ approval before indexing:
|
|
|
73
86
|
| Linux | XDG Documents/Downloads/Desktop or their `~/` defaults | `~/Notes`, `~/Sync`, Nextcloud/Syncthing roots |
|
|
74
87
|
| Windows | Documents, Downloads, Desktop shell folders | OneDrive document roots, user-named project docs |
|
|
75
88
|
|
|
76
|
-
Supported
|
|
77
|
-
`pptx`, `xlsx`, `hwpx`, and `eml
|
|
78
|
-
|
|
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.
|
|
79
93
|
|
|
80
94
|
Keep the first-run set small, usually one to three roots. Present a concrete
|
|
81
95
|
proposal and require `yes`, a narrowed keep-list, a custom list, or `skip`
|
|
@@ -113,10 +127,12 @@ Use `--force` only when intentionally replacing an existing config. Legacy cwd
|
|
|
113
127
|
|
|
114
128
|
### Retrieval defaults
|
|
115
129
|
|
|
116
|
-
|
|
117
|
-
user explicitly asks otherwise. MinSync auto-
|
|
118
|
-
|
|
119
|
-
|
|
130
|
+
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).
|
|
120
136
|
|
|
121
137
|
Exact duplicate exclusion is enabled by default. AutoRAG invokes the external
|
|
122
138
|
`dupey` CLI before parsed-mirror indexing, keeps the newest filesystem copy for
|
|
@@ -140,42 +156,58 @@ size must be positive integers.
|
|
|
140
156
|
|
|
141
157
|
## Configure datasource skills when requested
|
|
142
158
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
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`.
|
|
163
|
+
|
|
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.
|
|
147
171
|
|
|
148
172
|
```jsonc
|
|
149
173
|
{
|
|
150
174
|
"datasources": {
|
|
151
175
|
"github": { "connector": { "repos": ["owner/repo"], "tokenEnv": "GITHUB_TOKEN" } },
|
|
152
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"gmail": { "connector": { "
|
|
176
|
+
"google-drive": { "type": "cloud-drive", "connector": { "provider": "google-drive", "remote": "gdrive:" } },
|
|
177
|
+
"archive-drive": { "type": "cloud-drive", "connector": { "remote": "archive:" } },
|
|
178
|
+
"gmail": { "connector": { "tokenEnv": "GMAIL_ACCESS_TOKEN", "labelIds": ["INBOX"] } },
|
|
179
|
+
"mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
|
|
155
180
|
"obsidian": { "connector": { "vaultPath": "/path/to/vault" } },
|
|
156
181
|
"rss": { "connector": { "feeds": [{ "url": "https://example.com/feed.xml" }] } }
|
|
157
182
|
},
|
|
158
183
|
"datasourceAccess": {
|
|
159
|
-
"allowedTags": ["github", "
|
|
160
|
-
"allowedScopes": ["/github/**", "/
|
|
184
|
+
"allowedTags": ["github", "cloud-drive", "gmail", "mailcrawl", "obsidian", "rss"],
|
|
185
|
+
"allowedScopes": ["/github/**", "/google-drive/**", "/archive-drive/**", "/gmail/**", "/mailcrawl/**", "/obsidian/**", "/rss/**"]
|
|
161
186
|
}
|
|
162
187
|
}
|
|
163
188
|
```
|
|
164
189
|
|
|
165
190
|
Tokens are environment-variable names, not raw secrets. CLI-backed connectors
|
|
166
|
-
keep authentication in their external tool configuration.
|
|
167
|
-
|
|
168
|
-
|
|
191
|
+
keep authentication in their external tool configuration.
|
|
192
|
+
|
|
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`.
|
|
198
|
+
Use mailcrawl for Himalaya-backed IMAP/Maildir retrieval. The legacy
|
|
199
|
+
`gmail` connector option `backend: "himalaya"` is no longer registered; migrate
|
|
200
|
+
that configuration to an explicit `mailcrawl` datasource.
|
|
169
201
|
|
|
170
202
|
## Verify and build indexes
|
|
171
203
|
|
|
172
204
|
Configuration alone is not a successful setup:
|
|
173
205
|
|
|
174
206
|
```bash
|
|
175
|
-
autorag status
|
|
176
|
-
autorag health
|
|
177
|
-
autorag refresh
|
|
178
|
-
autorag search "summarize the collection" --top-k 3 --json
|
|
207
|
+
autorag status --json
|
|
208
|
+
autorag health --json
|
|
209
|
+
autorag refresh --json
|
|
210
|
+
autorag search "summarize the collection" --top-k 3 --json --debug
|
|
179
211
|
```
|
|
180
212
|
|
|
181
213
|
- `status` is model-free and path-opaque.
|
|
@@ -183,22 +215,27 @@ autorag search "summarize the collection" --top-k 3 --json
|
|
|
183
215
|
performs one live completion probe.
|
|
184
216
|
- `health --skip-probes` is only for intentionally offline validation and does
|
|
185
217
|
not prove live provider access.
|
|
186
|
-
- `refresh` syncs parsed mirrors,
|
|
187
|
-
datasources. `--method <csv>` may deliberately narrow it
|
|
218
|
+
- `refresh` syncs parsed mirrors, MinSync, Jikji, and authorized
|
|
219
|
+
datasources. `--method <csv>` may deliberately narrow it
|
|
220
|
+
(`parsed,minsync,datasources,jikji,all`).
|
|
188
221
|
- Use `refresh --force` for a full resync only when incremental refresh is not
|
|
189
222
|
enough. Keep destructive reset/rebuild operations scoped to workspace
|
|
190
223
|
`.autorag` indexes, never source documents.
|
|
224
|
+
- After a search, use `autorag evidence <sessionId> --json` to inspect the
|
|
225
|
+
exact source chunks behind numbered results, including source, method,
|
|
226
|
+
stable evidence ID, excerpt/content, chunk index, and line number.
|
|
191
227
|
|
|
192
228
|
## Keep indexes fresh
|
|
193
229
|
|
|
194
230
|
For continuous freshness, create or verify an OS-appropriate scheduled
|
|
195
|
-
`autorag watch --once` job, typically every 30 minutes. Prefer cron or
|
|
196
|
-
on macOS, cron or a user systemd timer on Linux, and Task Scheduler on
|
|
197
|
-
Use the same config as search, avoid overlapping runs, and keep logs
|
|
198
|
-
source trees.
|
|
231
|
+
`autorag watch --once` job, typically every 15–30 minutes. Prefer cron or
|
|
232
|
+
launchd on macOS, cron or a user systemd timer on Linux, and Task Scheduler on
|
|
233
|
+
Windows. Use the same config as search, avoid overlapping runs, and keep logs
|
|
234
|
+
outside source trees.
|
|
199
235
|
|
|
200
236
|
## Environment overrides
|
|
201
237
|
|
|
238
|
+
- `AUTORAG_HOME`
|
|
202
239
|
- `AUTORAG_CONFIG`
|
|
203
240
|
- `AUTORAG_SEARCH_PATHS`
|
|
204
241
|
- `AUTORAG_WORKSPACE`
|
|
@@ -208,7 +245,7 @@ source trees.
|
|
|
208
245
|
|
|
209
246
|
## Completion condition
|
|
210
247
|
|
|
211
|
-
Setup is complete only when roots are approved, a
|
|
212
|
-
config is written, `status` is acceptable, live `health`
|
|
213
|
-
builds the requested indexes, one real structured search
|
|
214
|
-
requested ongoing schedule is installed or verified.
|
|
248
|
+
Setup is complete only when the CLI is installed, roots are approved, a
|
|
249
|
+
non-secret single-model config is written, `status` is acceptable, live `health`
|
|
250
|
+
passes, `refresh` builds the requested indexes, one real structured search
|
|
251
|
+
succeeds, and any requested ongoing schedule is installed or verified.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
-
import { Type } from "typebox";
|
|
3
|
-
import type { BM25Method, BM25Status } from "../retrieval/methods/bm25.js";
|
|
4
|
-
export declare const SEARCH_BM25_DOCUMENTS_TOOL_NAME = "search_bm25_documents";
|
|
5
|
-
declare const searchBM25Schema: Type.TObject<{
|
|
6
|
-
query: Type.TString;
|
|
7
|
-
topK: Type.TOptional<Type.TInteger>;
|
|
8
|
-
scope: Type.TOptional<Type.TString>;
|
|
9
|
-
}>;
|
|
10
|
-
export interface SearchBM25DocumentsDetails {
|
|
11
|
-
readonly method: "bm25";
|
|
12
|
-
readonly resultCount: number;
|
|
13
|
-
readonly sources: readonly string[];
|
|
14
|
-
readonly readiness: BM25Status["readiness"];
|
|
15
|
-
readonly engine: BM25Status["engine"];
|
|
16
|
-
}
|
|
17
|
-
export declare function createSearchBM25DocumentsTool(getMethod: () => BM25Method | undefined, resolveScope?: (scope: string | undefined) => string | undefined): AgentTool<typeof searchBM25Schema, SearchBM25DocumentsDetails>;
|
|
18
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { DiscrawlOptions } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* Creates or updates AutoRAG's workspace-local discrawl config.
|
|
4
|
-
*
|
|
5
|
-
* Only the fields AutoRAG owns are changed: the workspace database path and
|
|
6
|
-
* embedding enablement/provider/model. Existing operator settings such as
|
|
7
|
-
* guilds, source filters, sync policy, and search mode are preserved.
|
|
8
|
-
*/
|
|
9
|
-
export declare function ensureManagedDiscrawlConfig(configPath: string, databasePath: string, options: DiscrawlOptions): void;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Drive connector (issue #1301).
|
|
3
|
-
*
|
|
4
|
-
* Lists files through the Drive v3 API with a trusted, server-configured
|
|
5
|
-
* OAuth access token, exporting Google Docs/Sheets as plain text/CSV and
|
|
6
|
-
* downloading plain-text files. Binary formats are skipped. Per-file export
|
|
7
|
-
* failures degrade to warnings. Never throws; messages stay path/PII-opaque.
|
|
8
|
-
*/
|
|
9
|
-
import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
|
|
10
|
-
export interface GDriveConnectorOptions {
|
|
11
|
-
/** Drive v3 REST base; override to point at a mock server in tests. */
|
|
12
|
-
readonly baseUrl?: string;
|
|
13
|
-
/** OAuth access token; explicit value wins over {@link tokenEnv}. */
|
|
14
|
-
readonly token?: string;
|
|
15
|
-
/** Env var name holding the access token. Default `GDRIVE_ACCESS_TOKEN`. */
|
|
16
|
-
readonly tokenEnv?: string;
|
|
17
|
-
/** Restrict to files whose parent is this folder id. */
|
|
18
|
-
readonly folderId?: string;
|
|
19
|
-
/** Include shared-drive items in listings. */
|
|
20
|
-
readonly includeSharedDrives?: boolean;
|
|
21
|
-
readonly timeoutMs?: number;
|
|
22
|
-
readonly fetchImpl?: typeof fetch;
|
|
23
|
-
readonly maxPages?: number;
|
|
24
|
-
readonly maxDocuments?: number;
|
|
25
|
-
}
|
|
26
|
-
export declare class GDriveConnector implements DatasourceConnector {
|
|
27
|
-
private readonly options;
|
|
28
|
-
constructor(options?: GDriveConnectorOptions);
|
|
29
|
-
fetch(signal?: AbortSignal): Promise<ConnectorFetchResult>;
|
|
30
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { GDriveConnector, type GDriveConnectorOptions } from "./connector.js";
|
|
2
|
-
export { RcloneConnector, type RcloneConnectorOptions, type RcloneRunner, type RcloneRunResult, } from "./rclone-connector.js";
|
|
3
|
-
export { GDRIVE_SKILL_DEFINITION, GDriveSkill, type GDriveSkillOptions } from "./skill.js";
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Google Drive datasource skill (issue #1301).
|
|
3
|
-
*
|
|
4
|
-
* Thin composition of GDriveConnector with the shared
|
|
5
|
-
* {@link ConnectorDatasourceSkill} base: descriptor, polling metadata,
|
|
6
|
-
* ok/fail indexing with path/PII-opaque diagnostics, lexical retrieval via
|
|
7
|
-
* the shared pipeline, opaque `/gdrive/<instance>/…` sources, and a
|
|
8
|
-
* progressive-disclosure agent-skill manifest.
|
|
9
|
-
*/
|
|
10
|
-
import type { DatasourceConnector } from "../../connector.js";
|
|
11
|
-
import { ConnectorDatasourceSkill, type ConnectorSkillDefinition, type ConnectorSkillOptions } from "../../connector-skill.js";
|
|
12
|
-
import { type GDriveConnectorOptions } from "./connector.js";
|
|
13
|
-
export declare const GDRIVE_SKILL_DEFINITION: ConnectorSkillDefinition;
|
|
14
|
-
export interface GDriveSkillOptions extends Omit<ConnectorSkillOptions, "connector"> {
|
|
15
|
-
/**
|
|
16
|
-
* Trusted pre-built connector; wins over {@link connectorOptions}. Accepts
|
|
17
|
-
* any drive-backed connector (Drive REST or the rclone CLI bridge).
|
|
18
|
-
*/
|
|
19
|
-
readonly connector?: DatasourceConnector;
|
|
20
|
-
readonly connectorOptions?: GDriveConnectorOptions;
|
|
21
|
-
}
|
|
22
|
-
export declare class GDriveSkill extends ConnectorDatasourceSkill {
|
|
23
|
-
constructor(options?: GDriveSkillOptions);
|
|
24
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Himalaya-backed mail connector (issue #1304, IMAP path).
|
|
3
|
-
*
|
|
4
|
-
* Uses the external `himalaya` CLI (https://pimalaya.org) as the trusted
|
|
5
|
-
* bridge to any IMAP/Maildir account it has configured — Gmail included —
|
|
6
|
-
* so no OAuth token plumbing is needed here. Mirrors the katok pattern:
|
|
7
|
-
* AutoRAG never opens the mailbox itself; it spawns the CLI, parses JSON
|
|
8
|
-
* envelopes, and reads message bodies. Never throws; failures map onto the
|
|
9
|
-
* coarse connector failure union with path/PII-opaque messages.
|
|
10
|
-
*/
|
|
11
|
-
import type { ConnectorFetchResult, DatasourceConnector } from "../../connector.js";
|
|
12
|
-
export interface HimalayaRunResult {
|
|
13
|
-
readonly ok: boolean;
|
|
14
|
-
readonly stdout: string;
|
|
15
|
-
readonly stderr: string;
|
|
16
|
-
readonly code: number | null;
|
|
17
|
-
}
|
|
18
|
-
export type HimalayaRunner = (args: readonly string[], timeoutMs: number) => Promise<HimalayaRunResult>;
|
|
19
|
-
export interface HimalayaConnectorOptions {
|
|
20
|
-
/** Path to the himalaya binary. Default bare `himalaya` PATH lookup. */
|
|
21
|
-
readonly binaryPath?: string;
|
|
22
|
-
/** Himalaya account name (`himalaya account list`). Default account when omitted. */
|
|
23
|
-
readonly account?: string;
|
|
24
|
-
/** Mail folder, e.g. `INBOX`. Himalaya's default folder when omitted. */
|
|
25
|
-
readonly folder?: string;
|
|
26
|
-
/** Envelopes per listing page. Default 100. */
|
|
27
|
-
readonly pageSize?: number;
|
|
28
|
-
/** Max messages whose bodies are fetched per run. Default 50. */
|
|
29
|
-
readonly maxDocuments?: number;
|
|
30
|
-
/** Per-spawn timeout. Default 30s (IMAP fetches can be slow). */
|
|
31
|
-
readonly timeoutMs?: number;
|
|
32
|
-
/** Injectable process runner for tests. */
|
|
33
|
-
readonly runner?: HimalayaRunner;
|
|
34
|
-
}
|
|
35
|
-
export declare class HimalayaConnector implements DatasourceConnector {
|
|
36
|
-
private readonly options;
|
|
37
|
-
private readonly runner;
|
|
38
|
-
constructor(options?: HimalayaConnectorOptions);
|
|
39
|
-
fetch(): Promise<ConnectorFetchResult>;
|
|
40
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "../types.js";
|
|
2
|
-
export type BM25ReadinessState = "disabled" | "dependency_unavailable" | "index_missing" | "indexing" | "ready" | "degraded_fallback" | "error";
|
|
3
|
-
export type BM25Engine = "tantivy" | "typescript-fallback" | "none";
|
|
4
|
-
export type BM25FallbackMode = "typescript" | "disabled";
|
|
5
|
-
export interface BM25MethodOptions {
|
|
6
|
-
readonly root: string;
|
|
7
|
-
readonly indexPath?: string;
|
|
8
|
-
readonly enabled?: boolean;
|
|
9
|
-
readonly fallback?: BM25FallbackMode;
|
|
10
|
-
readonly forceEngine?: Exclude<BM25Engine, "none">;
|
|
11
|
-
readonly importBinding?: () => Promise<TantivyBinding>;
|
|
12
|
-
}
|
|
13
|
-
export interface BM25SyncResult {
|
|
14
|
-
readonly indexPath: string;
|
|
15
|
-
readonly indexedChunks: number;
|
|
16
|
-
readonly readiness: BM25ReadinessState;
|
|
17
|
-
readonly engine: BM25Engine;
|
|
18
|
-
}
|
|
19
|
-
export interface BM25Status {
|
|
20
|
-
readonly readiness: BM25ReadinessState;
|
|
21
|
-
readonly engine: BM25Engine;
|
|
22
|
-
readonly message?: string;
|
|
23
|
-
}
|
|
24
|
-
type TantivyBinding = typeof import("@pngwasi/node-tantivy-binding");
|
|
25
|
-
export declare const BM25_SUBDIR: string;
|
|
26
|
-
export declare class BM25UnavailableError extends Error {
|
|
27
|
-
readonly readiness: BM25ReadinessState;
|
|
28
|
-
constructor(readiness: BM25ReadinessState, message: string);
|
|
29
|
-
}
|
|
30
|
-
export declare class BM25Method implements RetrievalMethod {
|
|
31
|
-
private readonly root;
|
|
32
|
-
private readonly indexPath;
|
|
33
|
-
private readonly fallback;
|
|
34
|
-
private readonly forceEngine;
|
|
35
|
-
private readonly importBinding;
|
|
36
|
-
private status;
|
|
37
|
-
constructor(options: BM25MethodOptions);
|
|
38
|
-
describe(): RetrievalMethodDescriptor;
|
|
39
|
-
getStatus(): BM25Status;
|
|
40
|
-
sync(): Promise<BM25SyncResult>;
|
|
41
|
-
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
42
|
-
private writeTantivyIndex;
|
|
43
|
-
private retrieveTantivy;
|
|
44
|
-
private writeFallbackIndex;
|
|
45
|
-
private retrieveFallback;
|
|
46
|
-
private readFallbackIndex;
|
|
47
|
-
private hasFallbackIndex;
|
|
48
|
-
private tantivyIndexPath;
|
|
49
|
-
private fallbackIndexPath;
|
|
50
|
-
private syncResult;
|
|
51
|
-
}
|
|
52
|
-
export {};
|