@autorag/librarian 2.6.3 → 2.8.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/NOTICE +6 -0
- package/README.md +76 -25
- package/dist/agent/agent.d.ts +135 -27
- package/dist/agent/answer-guidelines.d.ts +19 -0
- package/dist/agent/citations.d.ts +20 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/jev-extension.d.ts +68 -0
- package/dist/agent/pi-session.d.ts +55 -0
- package/dist/agent/query-decomposition.d.ts +25 -0
- package/dist/agent/query-routing.d.ts +54 -0
- package/dist/agent/search-documents.d.ts +2 -2
- package/dist/agent/system-prompt.d.ts +1 -0
- package/dist/cli/commands/evidence.d.ts +22 -0
- package/dist/cli/commands/health.d.ts +2 -3
- package/dist/cli/commands/init.d.ts +2 -1
- package/dist/cli/commands/models.d.ts +20 -0
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/commands/serve.d.ts +2 -2
- package/dist/cli/commands/tui.d.ts +12 -35
- package/dist/cli/commands/update-check.d.ts +8 -0
- package/dist/cli/config.d.ts +82 -5
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +9802 -9324
- package/dist/cli/update-check.d.ts +34 -0
- package/dist/cli/version.d.ts +5 -0
- package/dist/core.d.ts +34 -2
- package/dist/core.js +9848 -8977
- package/dist/everything/bundle.d.ts +15 -3
- package/dist/everything/client.d.ts +22 -5
- package/dist/everything/index.d.ts +1 -1
- package/dist/filesystem/name-search.d.ts +57 -0
- package/dist/fsearch/client.d.ts +7 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +11181 -9015
- package/dist/jikji/client.d.ts +6 -1
- package/dist/mcp/index.d.ts +2 -0
- package/dist/mcp/index.js +29949 -0
- package/dist/mcp/server.d.ts +9 -0
- package/dist/minsync/method.d.ts +6 -3
- package/dist/mirror/index.d.ts +1 -1
- package/dist/mirror/paths.d.ts +6 -0
- package/dist/retrieval/engine.d.ts +32 -1
- package/dist/retrieval/index.d.ts +2 -1
- package/dist/retrieval/rerank.d.ts +8 -3
- package/dist/retrieval/selection.d.ts +97 -0
- package/package.json +10 -3
- package/skills/autorag/SKILL.md +25 -4
- package/skills/autorag-doctor/SKILL.md +27 -18
- package/skills/autorag-lite-setup/SKILL.md +115 -59
- package/skills/autorag-setup/SKILL.md +99 -16
- package/dist/agent/bash-tool.d.ts +0 -32
- package/dist/cli/tui-commands.d.ts +0 -16
- package/dist/cli/tui-session-store.d.ts +0 -16
- package/skills/autorag-lite-search/SKILL.md +0 -245
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag-lite-setup
|
|
3
|
-
description:
|
|
3
|
+
description: Install and register the model-free AutoRAG Lite MCP server, configure approved roots and datasources, build indexes, and verify MCP discovery and search. Use when autorag-mcp is missing, MCP connection fails, indexes are stale, or the user wants document search without configuring a search model.
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# AutoRAG Lite setup
|
|
8
8
|
|
|
9
|
-
Use this skill
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
retrieval, reports, evidence, and feedback.
|
|
9
|
+
Use this skill only to bootstrap, register, or repair AutoRAG Lite MCP:
|
|
10
|
+
initialize trusted config, connect the host, build indexes, and verify search.
|
|
11
|
+
Normal Lite use is MCP tool calling, not a search skill or shell command.
|
|
12
|
+
Use `autorag-setup` instead when the model-backed librarian must be configured.
|
|
14
13
|
|
|
15
14
|
## Safety
|
|
16
15
|
|
|
@@ -25,16 +24,22 @@ retrieval, reports, evidence, and feedback.
|
|
|
25
24
|
`node_modules`, `.git`, `dist`, `build`, `target`, `.cache`, `.autorag`, or
|
|
26
25
|
`.jikji`.
|
|
27
26
|
|
|
28
|
-
## Install the
|
|
27
|
+
## Install the package if needed
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
`@autorag/librarian` ships both `autorag` (bootstrap/maintenance) and
|
|
30
|
+
`autorag-mcp` (stdio server). The executable requires Node.js >= 24 on PATH.
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
command -v autorag >/dev/null || bun install -g @autorag/librarian
|
|
33
|
+
command -v autorag-mcp >/dev/null || bun install -g @autorag/librarian
|
|
34
|
+
command -v autorag
|
|
35
|
+
command -v autorag-mcp
|
|
34
36
|
autorag lite --help
|
|
35
37
|
```
|
|
36
38
|
|
|
37
39
|
If Bun is unavailable, `npm install -g @autorag/librarian` is acceptable.
|
|
40
|
+
If only `autorag` exists, upgrade the package rather than substituting CLI
|
|
41
|
+
retrieval for MCP. For a source checkout, run `bun run build` and register the
|
|
42
|
+
absolute `dist/mcp/index.js` path instead of the installed executable.
|
|
38
43
|
|
|
39
44
|
## Initialize a model-free config
|
|
40
45
|
|
|
@@ -46,7 +51,9 @@ autorag lite init \
|
|
|
46
51
|
```
|
|
47
52
|
|
|
48
53
|
`lite init` writes the configured model-free lifecycle config. Use `--force`
|
|
49
|
-
only when intentionally replacing an existing config
|
|
54
|
+
only when intentionally replacing an existing config, and target it with an
|
|
55
|
+
explicit path (`--config` or `AUTORAG_CONFIG`); `--force` refuses to replace the
|
|
56
|
+
implicit `~/.autorag/config.json`. Explicit user paths win;
|
|
50
57
|
otherwise propose one to three document-dense roots and get approval before
|
|
51
58
|
indexing. Supported parsed formats are `md`, `markdown`, `txt`, `text`, `pdf`,
|
|
52
59
|
`docx`, `pptx`, `xlsx`, `xls`, `hwp`, `hwpx`, and `eml`. Legacy `.doc` is not
|
|
@@ -57,6 +64,48 @@ Config resolution follows the usual order: `--config`, `AUTORAG_CONFIG`,
|
|
|
57
64
|
include `AUTORAG_HOME`, `AUTORAG_CONFIG`, `AUTORAG_SEARCH_PATHS`,
|
|
58
65
|
`AUTORAG_WORKSPACE`, and `AUTORAG_MEMORY_PATH`.
|
|
59
66
|
|
|
67
|
+
## Register and verify the MCP connection
|
|
68
|
+
|
|
69
|
+
After config and datasource setup, register the server with the host. Use
|
|
70
|
+
absolute config, search root, workspace, and executable paths: hosts may start
|
|
71
|
+
the server from a different working directory or with a restricted PATH.
|
|
72
|
+
Resolve `command -v autorag-mcp` and substitute its absolute path below.
|
|
73
|
+
Inspect an existing `autorag` registration first; keep a working registration
|
|
74
|
+
and update only an outdated command or config path.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# Claude Code: project-local registration
|
|
78
|
+
claude mcp add --transport stdio --scope local autorag \
|
|
79
|
+
--env AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json \
|
|
80
|
+
-- /absolute/path/to/autorag-mcp
|
|
81
|
+
|
|
82
|
+
# Codex: user registration
|
|
83
|
+
codex mcp add autorag \
|
|
84
|
+
--env AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json \
|
|
85
|
+
-- /absolute/path/to/autorag-mcp
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
For other hosts, use their stdio MCP configuration with the same command,
|
|
89
|
+
empty arguments, and `AUTORAG_CONFIG` environment variable. The host starts
|
|
90
|
+
the subprocess; do not run it as a background HTTP service. Pass any required
|
|
91
|
+
credential environment-variable names through the host's secret mechanism;
|
|
92
|
+
never put credential values in registration examples or logs.
|
|
93
|
+
|
|
94
|
+
Reload/reconnect the host, then use MCP `tools/list` to discover the actual
|
|
95
|
+
tools and schemas. Verify `autorag.status`, `autorag.refresh`, `autorag.search`,
|
|
96
|
+
`autorag.search.files`, and `autorag.datasources.list` are available. Configured
|
|
97
|
+
integrated datasources add their own search tools; do not assume a fixed count.
|
|
98
|
+
Run `autorag.status` and `autorag.datasources.list` through MCP, then refresh
|
|
99
|
+
and search a known phrase from an approved document. Registration alone is
|
|
100
|
+
not proof of a connected or searchable server. After config changes, restart
|
|
101
|
+
the server so datasource tools and authorization are rebuilt.
|
|
102
|
+
|
|
103
|
+
`AUTORAG_MCP_READ_ONLY=1` omits refresh; build indexes with the CLI before
|
|
104
|
+
connecting that mode. `AUTORAG_MCP_TOOLS` is an optional comma-separated exact
|
|
105
|
+
tool allowlist; omitted tools cannot be called. Use unrestricted tools for
|
|
106
|
+
initial setup unless the user intentionally requests a restricted connection.
|
|
107
|
+
|
|
108
|
+
|
|
60
109
|
## Probe and configure datasources (setup wizard)
|
|
61
110
|
|
|
62
111
|
A datasource setup UI is not shipped in this build — do not recommend it for datasource
|
|
@@ -97,25 +146,26 @@ can never grant it. Store only env-var names such as `tokenEnv` or
|
|
|
97
146
|
|
|
98
147
|
## Build and refresh indexes
|
|
99
148
|
|
|
149
|
+
After connecting, call MCP `autorag.refresh` with `{}` for an incremental run.
|
|
150
|
+
Use `{"methods":["parsed","minsync"]}` to narrow indexing, or
|
|
151
|
+
`{"force":true}` only when a full resync is needed. Omit `methods` to run all
|
|
152
|
+
configured methods; MCP does not accept `"all"` as a method value.
|
|
153
|
+
|
|
154
|
+
CLI refresh remains available for bootstrap, read-only deployments, and repair:
|
|
155
|
+
|
|
100
156
|
```bash
|
|
101
|
-
autorag lite refresh --json
|
|
102
|
-
autorag lite refresh --method parsed,minsync --json
|
|
103
|
-
autorag lite refresh --full --json
|
|
104
|
-
autorag lite refresh --force --json
|
|
157
|
+
AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json autorag lite refresh --json
|
|
105
158
|
```
|
|
106
159
|
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- MinSync and Jikji auto-install on first use by default. If they are missing
|
|
117
|
-
or broken, run a full refresh or return to setup rather than silently
|
|
118
|
-
degrading to lexical-only search.
|
|
160
|
+
- Refresh syncs parsed mirrors, MinSync, Jikji, and configured datasources.
|
|
161
|
+
- CLI `--full` and `--force` request a full resync; MCP uses `force: true`.
|
|
162
|
+
- CLI `--method <csv>` accepts `parsed`, `minsync`, `datasources`, `jikji`,
|
|
163
|
+
`everything` (Windows), `fsearch` (macOS/Linux), and `all`. MCP `methods`
|
|
164
|
+
accepts the same individual methods, not `all`. Unknown values are rejected.
|
|
165
|
+
- Indexing never runs while answering: retrieval only reads what refresh built.
|
|
166
|
+
MinSync and Jikji auto-install during refresh (never during a query). If they
|
|
167
|
+
are missing or broken, run a full refresh or return to setup rather than
|
|
168
|
+
silently degrading to lexical-only search.
|
|
119
169
|
- MinSync's default embedder is in-process native Qwen3 embeddings
|
|
120
170
|
(`native:Qwen/Qwen3-Embedding-0.6B`, 1024 dimensions, MinSync 0.4.5+): no
|
|
121
171
|
embedder flags, no API key, and no external daemon (such as Ollama) are
|
|
@@ -131,18 +181,12 @@ autorag lite refresh --force --json
|
|
|
131
181
|
and the user is told duplicate exclusion is off. Set
|
|
132
182
|
`"excludeExactDuplicates": false` to index every copy.
|
|
133
183
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
refresh
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
diagnostics (and `autorag lite status` reports `stale: true`) while retrieval
|
|
141
|
-
still answers from the index. Sources the refresh deliberately skipped — exact
|
|
142
|
-
duplicates, oversized or unparseable files, and AutoRAG/Jikji product artifacts
|
|
143
|
-
such as `.jikji_agent_map.md` — do not count as stale. Use `autorag lite
|
|
144
|
-
retrieve --refresh` to rebuild incrementally before one query, or `--strict`
|
|
145
|
-
when a stale index must fail instead of answering.
|
|
184
|
+
Content search requires a completed refresh. MCP `autorag.search` returns
|
|
185
|
+
`isError: true` with `errorCode: "index-not-ready"` until refresh completes.
|
|
186
|
+
Always refresh first, and refresh again when roots change. Stale indexes can
|
|
187
|
+
still return results with `stale: true` and diagnostics; use `strict: true`
|
|
188
|
+
to reject stale answers, or call `autorag.refresh` before searching. Sources
|
|
189
|
+
deliberately skipped during refresh do not count as stale.
|
|
146
190
|
Jikji is a discovery/indexing preparer, not a lite retrieval method.
|
|
147
191
|
|
|
148
192
|
## Watch and scheduled freshness
|
|
@@ -162,16 +206,13 @@ hourly freshness is set up.
|
|
|
162
206
|
|
|
163
207
|
## Status and index maintenance
|
|
164
208
|
|
|
209
|
+
Use MCP `autorag.status` for health and `autorag.duplicates` for read-only
|
|
210
|
+
duplicate-family inspection. No search model is required. CLI-only repair:
|
|
211
|
+
|
|
165
212
|
```bash
|
|
166
|
-
autorag lite
|
|
167
|
-
autorag lite
|
|
168
|
-
autorag lite index rebuild --yes --json
|
|
169
|
-
autorag lite index reset --method parsed --yes --json
|
|
170
|
-
autorag lite duplicates --json
|
|
213
|
+
AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json autorag lite index rebuild --yes --json
|
|
214
|
+
AUTORAG_CONFIG=/absolute/path/to/.autorag/config.json autorag lite index reset --method parsed --yes --json
|
|
171
215
|
```
|
|
172
|
-
|
|
173
|
-
- `status` shows path-opaque corpus freshness and index health. `health` is an
|
|
174
|
-
alias of `status`; neither resolves a model.
|
|
175
216
|
- `index reset` and `index rebuild` remove or rebuild only workspace
|
|
176
217
|
`.autorag` indexes selected by `--method`. They never target source
|
|
177
218
|
documents.
|
|
@@ -180,19 +221,34 @@ autorag lite duplicates --json
|
|
|
180
221
|
|
|
181
222
|
## Unavailable components and failure handling
|
|
182
223
|
|
|
183
|
-
|
|
184
|
-
with
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
224
|
+
Inspect MCP `isError`, `errorCode`, `diagnostics`, and `unsearched` before
|
|
225
|
+
trusting results. `ok: true` with skipped surfaces is partial coverage, not
|
|
226
|
+
proof that the whole corpus was searched. Preserve the underlying error text
|
|
227
|
+
when reporting unavailable components such as `minsync-unavailable` or
|
|
228
|
+
`retrieval-method-failed`. Repair the component rather than silently accepting
|
|
229
|
+
degraded search.
|
|
230
|
+
|
|
231
|
+
## Normal MCP workflow and curation lifecycle
|
|
232
|
+
|
|
233
|
+
MCP results carry source, method, and content directly. After a search, the
|
|
234
|
+
optional curation lifecycle is also exposed through MCP: `autorag.report`
|
|
235
|
+
records a curated answer, `autorag.evidence` returns the exact chunks behind
|
|
236
|
+
numbered results, and `autorag.feedback` records which numbers were useful or
|
|
237
|
+
not. These accept and return JSON matching the CLI's report/evidence/feedback
|
|
238
|
+
contracts; discover the exact schemas with MCP `tools/list` rather than
|
|
239
|
+
restating them here. Every bracketed `[n]` citation in a report `answer` must
|
|
240
|
+
be a `results[].number`; an unmatched citation is removed from the persisted
|
|
241
|
+
answer and returned as a `citation-without-result` diagnostic. The CLI
|
|
242
|
+
`autorag report`, `autorag evidence`, and `autorag feedback` commands remain
|
|
243
|
+
available for terminal maintenance.
|
|
190
244
|
|
|
191
245
|
## Completion condition
|
|
192
246
|
|
|
193
|
-
Setup is complete only when the
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
247
|
+
Setup is complete only when the package and stdio executable are installed,
|
|
248
|
+
roots are approved, trusted model-free config is written, every datasource has
|
|
249
|
+
been probed and configured/skipped lists reported, and dupey is installed or
|
|
250
|
+
its absence reported. The host must connect, discover tools, refresh requested
|
|
251
|
+
indexes, return acceptable MCP status, and retrieve known source content via
|
|
252
|
+
MCP. Any requested watch schedule must use the same config and be verified.
|
|
253
|
+
Remove any previously copied Lite search skill from the host's skill directory
|
|
254
|
+
so it no longer routes routine search through shell commands.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag-setup
|
|
3
|
-
description: Install and configure AutoRAG, or repair its single search model, approved
|
|
3
|
+
description: Install and configure AutoRAG, register its Lite MCP server for external agents, or repair its single search model, approved roots, indexes, datasources, and health checks without exposing credentials. Use when AutoRAG or MCP is missing, init/refresh/health fails, indexes are stale, or the user wants to add folders or datasources.
|
|
4
4
|
license: MIT
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -10,6 +10,11 @@ Use this skill when AutoRAG is unconfigured, the `autorag` CLI is missing, model
|
|
|
10
10
|
resolution fails, indexes are missing or stale, or the user wants to change the
|
|
11
11
|
document collection or datasources.
|
|
12
12
|
|
|
13
|
+
For model-free external-agent search, use `autorag-lite-setup` to configure
|
|
14
|
+
and register `autorag-mcp`; do not configure a search model or install a search
|
|
15
|
+
skill for Lite. This skill's model setup and CLI search apply to the full
|
|
16
|
+
librarian, not the Lite MCP server.
|
|
17
|
+
|
|
13
18
|
## Safety
|
|
14
19
|
|
|
15
20
|
- Inspect only non-secret provider/model metadata and credential availability.
|
|
@@ -106,9 +111,20 @@ autorag init \
|
|
|
106
111
|
--model-id MODEL
|
|
107
112
|
```
|
|
108
113
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
114
|
+
Model resolution runs through the pi runtime. A configured `provider`/`id` is
|
|
115
|
+
resolved against the pi runtime catalog — the built-in providers plus any
|
|
116
|
+
`~/.pi/agent/models.json`, custom, or extension providers — and credentials come
|
|
117
|
+
from stored pi auth (`~/.pi/agent/auth.json`, API key or OAuth established with
|
|
118
|
+
`pi /login`), then provider environment variables. When no `model` is
|
|
119
|
+
configured, AutoRAG uses pi's `defaultProvider`/`defaultModel` when that
|
|
120
|
+
provider has configured credentials; otherwise it falls back to the
|
|
121
|
+
authenticated local codex runtime. So model flags may be omitted when either pi
|
|
122
|
+
or the local runtime already supplies the intended model. Inspect what pi can
|
|
123
|
+
resolve with `autorag models list` (`--available` shows only providers with
|
|
124
|
+
configured credentials); it never prints credential values.
|
|
125
|
+
|
|
126
|
+
For a custom endpoint, add `api`, `baseUrl`, and `apiKeyEnv` to the single
|
|
127
|
+
`model` object in the trusted config:
|
|
112
128
|
|
|
113
129
|
```json
|
|
114
130
|
{
|
|
@@ -123,24 +139,33 @@ flags may be omitted. For a custom endpoint, add `api`, `baseUrl`, and
|
|
|
123
139
|
}
|
|
124
140
|
```
|
|
125
141
|
|
|
126
|
-
When `provider`/`id` names a pi
|
|
127
|
-
base: `baseUrl`, `api`, and any declared `reasoning`, `input`,
|
|
128
|
-
or `maxTokens` override only those fields, and the catalog's
|
|
129
|
-
thinking, and compat settings are kept. Only an id outside the
|
|
130
|
-
proxy, Ollama, LiteLLM) gets a generic text model with a 128k
|
|
131
|
-
unless those fields are declared.
|
|
142
|
+
When `provider`/`id` names a pi runtime catalog model, the catalog entry stays
|
|
143
|
+
the base: `baseUrl`, `api`, and any declared `reasoning`, `input`,
|
|
144
|
+
`contextWindow`, or `maxTokens` override only those fields, and the catalog's
|
|
145
|
+
reasoning, thinking, and compat settings are kept. Only an id outside the
|
|
146
|
+
catalog (private proxy, Ollama, LiteLLM) gets a generic text model with a 128k
|
|
147
|
+
context window unless those fields are declared.
|
|
132
148
|
|
|
133
|
-
Use `--force` only when intentionally replacing an existing config
|
|
149
|
+
Use `--force` only when intentionally replacing an existing config, and target it
|
|
150
|
+
with an explicit path (`--config` or `AUTORAG_CONFIG`); `--force` refuses to
|
|
151
|
+
replace the implicit `~/.autorag/config.json`. Legacy cwd
|
|
134
152
|
`autorag.config.json` is a migration source only and is never deleted by init.
|
|
135
153
|
|
|
136
154
|
### Retrieval defaults
|
|
137
155
|
|
|
138
156
|
MinSync and Jikji are enabled by default. Leave them enabled unless the
|
|
139
|
-
user explicitly asks otherwise.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
157
|
+
user explicitly asks otherwise. Indexing never happens while answering: a
|
|
158
|
+
question only reads indexes that `autorag refresh` (or `autorag watch`) built,
|
|
159
|
+
so run a refresh after setup and whenever documents change. A never-refreshed
|
|
160
|
+
workspace still answers, but without MinSync/Jikji evidence.
|
|
161
|
+
|
|
162
|
+
Refresh (never a query) auto-installs the binaries: MinSync installs a verified
|
|
163
|
+
GitHub release into `<workspace>/.autorag/bin` (`minSync.autoInstall` defaults
|
|
164
|
+
to true), and Jikji installs `jikji-cli` through cargo (`jikji.autoInstall`
|
|
165
|
+
defaults to true; requires the Rust toolchain). Set `"autoInstall": false` only
|
|
166
|
+
when managing the binary yourself. Refresh is incremental: MinSync syncs only
|
|
167
|
+
changed parsed mirrors, and `jikji prepare` reuses unchanged documents. Roots
|
|
168
|
+
prepare in parallel.
|
|
144
169
|
|
|
145
170
|
Jikji stores its prepared corpus metadata in a hidden `.jikji` directory
|
|
146
171
|
inside each indexed source root — that is Jikji's native index layout and
|
|
@@ -186,6 +211,45 @@ Only store the environment-variable name, never its value. Dimension and batch
|
|
|
186
211
|
size must be positive integers, and the dimension must match the embedder
|
|
187
212
|
(default Qwen3 is 1024; legacy EmbeddingGemma is 768; text-embedding-3-small is 1536).
|
|
188
213
|
|
|
214
|
+
### Jev routing and question decomposition (on by default)
|
|
215
|
+
|
|
216
|
+
Leave both enabled. They are the recommended setup: they make simple questions
|
|
217
|
+
fast and multi-part questions thorough.
|
|
218
|
+
|
|
219
|
+
- **Jev** (`jev`, default `{ "backend": "openrouter" }`, model
|
|
220
|
+
`typesafe/jev-1.13`) runs before the fast answer. It routes each question to
|
|
221
|
+
local search, web search, or a direct answer (general knowledge or small
|
|
222
|
+
talk skips retrieval entirely), and decides whether to decompose it. After
|
|
223
|
+
the fast answer it decides whether verification is needed, so a complete,
|
|
224
|
+
evidence-backed fast answer ends the run.
|
|
225
|
+
- **Question decomposition** (`queryDecomposition`, default model
|
|
226
|
+
`openrouter/qwen/qwen3.7-flash`) splits a multi-part question into at most
|
|
227
|
+
five search queries that run in parallel.
|
|
228
|
+
|
|
229
|
+
Both use the user's `OPENROUTER_API_KEY`; confirm it is set (`test -n
|
|
230
|
+
"$OPENROUTER_API_KEY"`, never print it) and tell the user Jev routing is on.
|
|
231
|
+
Without the key, routing falls back to a single local search and the run
|
|
232
|
+
always verifies, so searches still work. A `query-route-fallback` diagnostic
|
|
233
|
+
(`autorag search --debug`) shows that state.
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"jev": { "backend": "openrouter" },
|
|
238
|
+
"queryDecomposition": { "model": { "provider": "openrouter", "id": "qwen/qwen3.7-flash" } }
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
`autorag init` writes these defaults into new configs. To change them:
|
|
243
|
+
|
|
244
|
+
- Jev backend: `"backend": "typesafe"` (`TYPESAFE_API_KEY`) or `"vercel"`
|
|
245
|
+
(`AI_GATEWAY_API_KEY`).
|
|
246
|
+
- Decomposition model: any catalog `provider`/`id`, with the same fields as
|
|
247
|
+
the top-level `model`.
|
|
248
|
+
- `"queryDecomposition": false` decomposes with the search model itself.
|
|
249
|
+
- `"jev": false` turns routing off entirely. Do this only when the user
|
|
250
|
+
explicitly opts out, for example because questions must never leave the
|
|
251
|
+
machine (Jev and decomposition send the question text to OpenRouter).
|
|
252
|
+
|
|
189
253
|
### Retrieval and ingest caps
|
|
190
254
|
|
|
191
255
|
`limits` bounds retrieval, baseline prefetch, and the candidate lists handed to
|
|
@@ -329,6 +393,23 @@ autorag search "summarize the collection" --top-k 3 --json --debug
|
|
|
329
393
|
exact source chunks behind numbered results, including source, method,
|
|
330
394
|
stable evidence ID, excerpt/content, chunk index, and line number.
|
|
331
395
|
|
|
396
|
+
## Connect external agents through MCP
|
|
397
|
+
|
|
398
|
+
When setting up AutoRAG for a coding agent, register the package's
|
|
399
|
+
`autorag-mcp` stdio executable with the same absolute `AUTORAG_CONFIG` path.
|
|
400
|
+
Follow `autorag-lite-setup`'s MCP registration and verification procedure:
|
|
401
|
+
inspect existing host registration, use an absolute executable path,
|
|
402
|
+
reload/reconnect, discover schemas with `tools/list`, and exercise
|
|
403
|
+
`autorag.status`, `autorag.datasources.list`, and a known-phrase
|
|
404
|
+
`autorag.search` through MCP. Restart the MCP server after config changes.
|
|
405
|
+
The MCP server returns model-free source chunks; the calling agent curates
|
|
406
|
+
them. It does not invoke the configured librarian model. The same server also
|
|
407
|
+
exposes `autorag.report`, `autorag.evidence`, and `autorag.feedback` for the
|
|
408
|
+
curation lifecycle; the matching CLI commands remain a maintenance path.
|
|
409
|
+
Discover the exact schemas with MCP `tools/list`. Keep the full `autorag` skill
|
|
410
|
+
only when model-backed curated search is also wanted. For MCP-only setup, use
|
|
411
|
+
`autorag-lite-setup` instead of requiring live model health.
|
|
412
|
+
|
|
332
413
|
## Keep indexes fresh
|
|
333
414
|
|
|
334
415
|
For continuous freshness, create or verify an OS-appropriate scheduled
|
|
@@ -358,3 +439,5 @@ installed or its absence reported, `status` is acceptable, live `health`
|
|
|
358
439
|
passes, `refresh` builds the requested indexes, one real structured search
|
|
359
440
|
succeeds, and any requested ongoing schedule is installed or verified with the
|
|
360
441
|
user told it is active.
|
|
442
|
+
For external-agent integration, also require successful MCP discovery and a
|
|
443
|
+
known-source MCP search; CLI success alone does not prove the host connection.
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AgentTool } from "@earendil-works/pi-agent-core";
|
|
2
|
-
import { Type } from "typebox";
|
|
3
|
-
export declare const BASH_TOOL_NAME = "bash";
|
|
4
|
-
declare const bashSchema: Type.TObject<{
|
|
5
|
-
command: Type.TString;
|
|
6
|
-
cwd: Type.TOptional<Type.TString>;
|
|
7
|
-
timeoutMs: Type.TOptional<Type.TInteger>;
|
|
8
|
-
}>;
|
|
9
|
-
export interface BashToolOptions {
|
|
10
|
-
/** Default working directory for spawned commands. */
|
|
11
|
-
readonly cwd: string;
|
|
12
|
-
/** Maximum wall-clock time per command before it is killed. */
|
|
13
|
-
readonly timeoutMs?: number;
|
|
14
|
-
/** Maximum captured output bytes before truncation. */
|
|
15
|
-
readonly maxOutputBytes?: number;
|
|
16
|
-
}
|
|
17
|
-
export interface BashToolDetails {
|
|
18
|
-
readonly method: "bash";
|
|
19
|
-
readonly command: string;
|
|
20
|
-
readonly aborted: boolean;
|
|
21
|
-
readonly exitCode: number | undefined;
|
|
22
|
-
readonly terminationFailed: boolean;
|
|
23
|
-
readonly timedOut: boolean;
|
|
24
|
-
readonly truncated: boolean;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Real shell access for the librarian agent. AutoRAG navigates and reads the
|
|
28
|
-
* configured collection directly through this tool (ls, find, grep, cat, …).
|
|
29
|
-
* Output — including real filesystem paths — is returned to the model verbatim.
|
|
30
|
-
*/
|
|
31
|
-
export declare function createBashTool(options: BashToolOptions): AgentTool<typeof bashSchema, BashToolDetails>;
|
|
32
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SlashCommand } from "@earendil-works/pi-tui";
|
|
2
|
-
import type { TuiSessionStore } from "./tui-session-store.js";
|
|
3
|
-
export type ParsedSlashCommand = {
|
|
4
|
-
kind: "incomplete";
|
|
5
|
-
} | {
|
|
6
|
-
kind: "quit";
|
|
7
|
-
} | {
|
|
8
|
-
kind: "resume";
|
|
9
|
-
sessionId: string | undefined;
|
|
10
|
-
} | {
|
|
11
|
-
kind: "unknown";
|
|
12
|
-
name: string;
|
|
13
|
-
};
|
|
14
|
-
export declare function parseSlashCommand(input: string): ParsedSlashCommand | undefined;
|
|
15
|
-
export declare function createTuiSlashCommands(store: TuiSessionStore): SlashCommand[];
|
|
16
|
-
export declare function renderSlashHelp(): string;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface TuiSessionRecord {
|
|
2
|
-
readonly id: string;
|
|
3
|
-
readonly query: string;
|
|
4
|
-
readonly answer: string;
|
|
5
|
-
readonly trace: string;
|
|
6
|
-
readonly updatedAt: number;
|
|
7
|
-
}
|
|
8
|
-
export interface TuiSessionStore {
|
|
9
|
-
list(): readonly TuiSessionRecord[];
|
|
10
|
-
get(id: string): TuiSessionRecord | undefined;
|
|
11
|
-
save(session: TuiSessionRecord): void;
|
|
12
|
-
}
|
|
13
|
-
export declare function createFileTuiSessionStore(path: string): TuiSessionStore;
|
|
14
|
-
export declare function createMergedTuiSessionStore(...stores: readonly TuiSessionStore[]): TuiSessionStore;
|
|
15
|
-
export declare function renderTuiSessionList(sessions: readonly TuiSessionRecord[]): string;
|
|
16
|
-
export declare function renderRestoredTuiSession(session: TuiSessionRecord): string;
|