@autorag/librarian 2.11.0 → 2.13.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 +14 -6
- package/dist/agent/agent.d.ts +136 -33
- package/dist/agent/answer-citations.d.ts +34 -2
- package/dist/agent/answer-guidelines.d.ts +20 -3
- package/dist/agent/ask-user.d.ts +8 -0
- package/dist/agent/automation-tool.d.ts +45 -0
- package/dist/agent/citation-links.d.ts +23 -0
- package/dist/agent/citation-numbers.d.ts +68 -0
- package/dist/agent/citation-relevance.d.ts +37 -0
- package/dist/agent/conversation-queries.d.ts +31 -0
- package/dist/agent/convert-tool.d.ts +28 -0
- package/dist/agent/current-date.d.ts +10 -0
- package/dist/agent/datasource-skill.d.ts +2 -2
- package/dist/agent/environment-prompt.d.ts +20 -0
- package/dist/agent/evidence-ledger.d.ts +4 -2
- package/dist/agent/evidence-persistence.d.ts +17 -11
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/intent-tracing.d.ts +33 -0
- package/dist/agent/location-claims.d.ts +14 -0
- package/dist/agent/packaged-skill.d.ts +19 -0
- package/dist/agent/permission-gate.d.ts +78 -0
- package/dist/agent/permission-judgment.d.ts +72 -0
- package/dist/agent/permission-paths.d.ts +23 -0
- package/dist/agent/query-routing.d.ts +78 -27
- package/dist/agent/results.d.ts +10 -2
- package/dist/agent/search-documents.d.ts +6 -1
- package/dist/agent/self-config.d.ts +6 -4
- package/dist/agent/skill-invocation.d.ts +17 -0
- package/dist/agent/user-requests.d.ts +52 -0
- package/dist/automation/config.d.ts +48 -0
- package/dist/automation/daemon.d.ts +31 -0
- package/dist/automation/dispatch.d.ts +13 -0
- package/dist/automation/run-agent.d.ts +22 -0
- package/dist/automation/run.d.ts +32 -0
- package/dist/automation/service.d.ts +61 -0
- package/dist/cli/commands/automate.d.ts +2 -0
- package/dist/cli/commands/evidence.d.ts +2 -0
- package/dist/cli/config.d.ts +21 -0
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +19531 -14871
- package/dist/cli/open-target.d.ts +9 -0
- package/dist/cli/setup.d.ts +14 -0
- package/dist/convert/cli.d.ts +77 -0
- package/dist/convert/index.d.ts +4 -0
- package/dist/convert/installer.d.ts +84 -0
- package/dist/convert/matrix.d.ts +27 -0
- package/dist/convert/relate.d.ts +30 -0
- package/dist/core.js +32479 -28141
- package/dist/datasource/connector-timeouts.d.ts +6 -2
- package/dist/datasource/crawler-skill.d.ts +1 -0
- package/dist/datasource/crawler-types.d.ts +1 -1
- package/dist/datasource/index.d.ts +1 -1
- package/dist/datasource/sidecar/methods.d.ts +8 -1
- package/dist/datasource/skills/clawgallery/skill.d.ts +4 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +5 -0
- package/dist/datasource/skills/factory.d.ts +5 -1
- package/dist/datasource/skills/lazykatok/index.d.ts +1 -1
- package/dist/datasource/skills/lazykatok/methods.d.ts +5 -5
- package/dist/datasource/skills/lazykatok/skill.d.ts +1 -0
- package/dist/datasource/skills/lazykatok/types.d.ts +2 -2
- package/dist/datasource/skills/mailcrawl/skill.d.ts +1 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +1 -1
- package/dist/dupey/cli.d.ts +18 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +32558 -28145
- package/dist/mcp/index.js +32651 -28263
- package/dist/memory/memory.d.ts +4 -1
- package/dist/minsync/installer.d.ts +1 -1
- package/dist/mirror/atomic-write.d.ts +16 -1
- package/dist/mirror/sync.d.ts +2 -0
- package/dist/profiles/agent-factory.d.ts +60 -0
- package/dist/profiles/automation-profiles.d.ts +25 -0
- package/dist/profiles/loop-guard.d.ts +23 -0
- package/dist/profiles/retrieval-tools.d.ts +24 -0
- package/dist/profiles/session-model.d.ts +69 -0
- package/dist/profiles.d.ts +13 -0
- package/dist/profiles.js +35246 -0
- package/dist/retrieval/chunk-location.d.ts +28 -0
- package/dist/retrieval/fallback.d.ts +24 -0
- package/dist/retrieval/index.d.ts +1 -0
- package/dist/retrieval/rerank.d.ts +6 -0
- package/dist/retrieval/types.d.ts +16 -0
- package/internal-skills/organize/SKILL.md +43 -0
- package/package.json +9 -2
- package/skills/autorag/SKILL.md +89 -7
- package/skills/autorag-setup/SKILL.md +10 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Where a retrieved chunk sits inside its parsed document. Every field is measured, never model-written. */
|
|
2
|
+
export interface ChunkLocation {
|
|
3
|
+
/** 1-based first line of the chunk in the parsed document. */
|
|
4
|
+
readonly lineStart: number;
|
|
5
|
+
/** 1-based last line of the chunk in the parsed document. */
|
|
6
|
+
readonly lineEnd: number;
|
|
7
|
+
/** Nearest article or heading line at or before the chunk's first line. */
|
|
8
|
+
readonly section?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Find `chunk` in `document` by its non-blank lines (compared trimmed, so
|
|
12
|
+
* indentation and blank-line differences between the chunker's output and the
|
|
13
|
+
* file do not matter) and report the 1-based line range plus the section it
|
|
14
|
+
* sits in.
|
|
15
|
+
*
|
|
16
|
+
* Returns undefined unless the chunk matches exactly one place: a chunk the
|
|
17
|
+
* chunker rewrote (table flattening) or one that occurs twice has no single
|
|
18
|
+
* correct line, and reporting a guess would be worse than reporting nothing.
|
|
19
|
+
*/
|
|
20
|
+
export declare function locateChunk(document: string, chunk: string): ChunkLocation | undefined;
|
|
21
|
+
/** One stable text form of a location, for tool output the model reads. Undefined when nothing is known. */
|
|
22
|
+
export declare function describeLocation(location: {
|
|
23
|
+
readonly lineStart?: number;
|
|
24
|
+
readonly lineEnd?: number;
|
|
25
|
+
readonly section?: string;
|
|
26
|
+
}): string | undefined;
|
|
27
|
+
/** ` (lines 7-8, section "…")` for a retrieval result whose backend measured a location; empty otherwise. */
|
|
28
|
+
export declare function locationSuffix(metadata: Readonly<Record<string, unknown>>): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { RetrievalMethod, RetrievalMethodDescriptor, RetrievalOptions, RetrievalResult } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* One logical retrieval method that prefers its primary and degrades to a
|
|
4
|
+
* fallback only when the primary cannot run.
|
|
5
|
+
*
|
|
6
|
+
* Datasources used to register a hybrid method next to its lexical and semantic
|
|
7
|
+
* components and let the merger reconcile them. That ran the same backend
|
|
8
|
+
* several times and let the merger count a hybrid and its own component as
|
|
9
|
+
* independent corroboration. Registering one chain instead means the pipeline
|
|
10
|
+
* sees a single method per datasource: the hybrid when it works, a component
|
|
11
|
+
* only when it does not.
|
|
12
|
+
*
|
|
13
|
+
* The chain reports the primary's descriptor, so selection, diagnostics and
|
|
14
|
+
* surface grouping behave as if the primary were registered alone. A primary
|
|
15
|
+
* that answers with no hits is an answer, not a failure: the fallback is not
|
|
16
|
+
* consulted, because a lexical-only retry cannot find what a hybrid missed.
|
|
17
|
+
*/
|
|
18
|
+
export declare class FallbackRetrievalMethod implements RetrievalMethod {
|
|
19
|
+
private readonly primary;
|
|
20
|
+
private readonly fallbacks;
|
|
21
|
+
constructor(primary: RetrievalMethod, fallbacks: readonly RetrievalMethod[]);
|
|
22
|
+
describe(): RetrievalMethodDescriptor;
|
|
23
|
+
retrieve(query: string, options: RetrievalOptions): Promise<RetrievalResult[]>;
|
|
24
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { bm25Scores, tokenize } from "./bm25.js";
|
|
2
2
|
export { RetrievalEngine, type RetrievalEngineOptions } from "./engine.js";
|
|
3
|
+
export { FallbackRetrievalMethod } from "./fallback.js";
|
|
3
4
|
export type { MergeOptions } from "./merger.js";
|
|
4
5
|
export { ParallelRetriever, ResultMerger } from "./merger.js";
|
|
5
6
|
export { RetrievalMethodRegistry } from "./registry.js";
|
|
@@ -33,6 +33,12 @@ export declare const DEFAULT_DAZZI_RERANK_MODEL = "qwen/qwen3-reranker-8b";
|
|
|
33
33
|
export declare const DEFAULT_RERANK_TIMEOUT_MS = 60000;
|
|
34
34
|
/** Default number of merged chunks kept after reranking. */
|
|
35
35
|
export declare const DEFAULT_RERANK_TOP_N = 25;
|
|
36
|
+
/**
|
|
37
|
+
* Longest document, in UTF-16 units, sent to a reranker. The hosted Dazzi
|
|
38
|
+
* reranker rejects a document of 131,072 characters or more with HTTP 400 and
|
|
39
|
+
* fails the whole request; 131,000 stays under that with a small margin.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RERANK_MAX_DOCUMENT_CHARS = 131000;
|
|
36
42
|
/** Rerank providers {@link createReranker} can build. */
|
|
37
43
|
export declare const SUPPORTED_RERANK_PROVIDERS: readonly string[];
|
|
38
44
|
/** Default wire model for a rerank provider. */
|
|
@@ -14,11 +14,27 @@ export interface RetrievalMethodDescriptor {
|
|
|
14
14
|
datasourceId?: string;
|
|
15
15
|
tags?: readonly string[];
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* A fallback chain answered with a fallback because its primary method failed. `reason` is the primary's
|
|
19
|
+
* error verbatim, so the degraded surface can be reported like any other skipped method.
|
|
20
|
+
*/
|
|
21
|
+
export interface RetrievalFallbackEvent {
|
|
22
|
+
/** Name of the primary method that failed. */
|
|
23
|
+
method: string;
|
|
24
|
+
/** Name of the fallback that answered instead. */
|
|
25
|
+
fallback: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
}
|
|
17
28
|
export interface RetrievalOptions {
|
|
18
29
|
topK?: number;
|
|
19
30
|
scope?: string;
|
|
20
31
|
filters?: Record<string, unknown>;
|
|
21
32
|
signal?: AbortSignal;
|
|
33
|
+
/**
|
|
34
|
+
* Owned by the retrieval pipeline, not by callers: invoked when a method answered through a fallback.
|
|
35
|
+
* Methods that wrap another method must not forward it.
|
|
36
|
+
*/
|
|
37
|
+
onFallback?: (event: RetrievalFallbackEvent) => void;
|
|
22
38
|
}
|
|
23
39
|
export interface RetrievalMethod {
|
|
24
40
|
describe(): RetrievalMethodDescriptor;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: organize
|
|
3
|
+
description: Rules for acting on files and folders on disk — sort, move, copy, bulk-rename, rename by content, convert formats, create folder structures, or move to the trash. Plan every target path before changing anything, never overwrite or permanently delete, confirm with a listing, and report every change as old path → new path.
|
|
4
|
+
license: Apache-2.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Organizing files and folders
|
|
8
|
+
|
|
9
|
+
Use this skill when the user asks you to act on files or folders — tidy or sort
|
|
10
|
+
a folder, move or copy files into folders, bulk or pattern rename, rename files
|
|
11
|
+
according to what their content says, convert formats, create folder
|
|
12
|
+
structures, archive, or move files to the trash. This is a file-organization
|
|
13
|
+
task, not a document search: the answer is the change on disk, not information
|
|
14
|
+
found in the files.
|
|
15
|
+
|
|
16
|
+
## How to do it
|
|
17
|
+
|
|
18
|
+
- Work with `bash` (`ls`, `mkdir`, `mv`, `cp`, and a bounded `find`). Read a
|
|
19
|
+
file (with `read` or `bash`) only when its content decides the new name or
|
|
20
|
+
folder, then carry the change out with `bash` or the file tools.
|
|
21
|
+
- Use the converter tools for format conversions, the duplicate scan when the
|
|
22
|
+
request is about duplicates, and the file-name discovery tools to locate
|
|
23
|
+
files by name.
|
|
24
|
+
- Do **not** search document contents, the user's datasources, or the web in
|
|
25
|
+
this turn: content retrieval and the web tools are not part of this task. The
|
|
26
|
+
turn prompt lists the exact tools to use and the ones to leave alone.
|
|
27
|
+
|
|
28
|
+
## Rules
|
|
29
|
+
|
|
30
|
+
- **Plan first.** List what you found, decide every target path, and check that
|
|
31
|
+
no two targets share a name and that no target already exists before you move
|
|
32
|
+
anything. Never overwrite an existing file.
|
|
33
|
+
- **Touch only what the request names.** When the request does not name a
|
|
34
|
+
folder, ask which one instead of guessing, unless the conversation already
|
|
35
|
+
says.
|
|
36
|
+
- **Never delete permanently** — no `rm`, `rmdir`, `unlink`, `find -delete`,
|
|
37
|
+
`shred`, or PowerShell `Remove-Item`. Move what must go to the OS trash
|
|
38
|
+
instead (macOS `/usr/bin/trash`, Linux `gio trash`, Windows Recycle Bin).
|
|
39
|
+
- **Confirm afterwards.** List the destination folder to check the changes
|
|
40
|
+
really happened.
|
|
41
|
+
- **Finish with a report**, as your final message and with no tool call: every
|
|
42
|
+
change as old path → new path (one per line), what you skipped and why, and
|
|
43
|
+
anything that still needs the user. Write in the language of the request.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorag/librarian",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"description": "Personal librarian agent for office work on the Pi framework, with pluggable retrieval methods",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
"./core": {
|
|
19
19
|
"types": "./dist/core.d.ts",
|
|
20
20
|
"default": "./dist/core.js"
|
|
21
|
+
},
|
|
22
|
+
"./profiles": {
|
|
23
|
+
"types": "./dist/profiles.d.ts",
|
|
24
|
+
"default": "./dist/profiles.js"
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
27
|
"bin": {
|
|
@@ -27,6 +31,7 @@
|
|
|
27
31
|
"files": [
|
|
28
32
|
"dist",
|
|
29
33
|
"skills",
|
|
34
|
+
"internal-skills",
|
|
30
35
|
"README.md",
|
|
31
36
|
"NOTICE",
|
|
32
37
|
"licenses",
|
|
@@ -36,7 +41,7 @@
|
|
|
36
41
|
"access": "public"
|
|
37
42
|
},
|
|
38
43
|
"scripts": {
|
|
39
|
-
"build": "bun build src/index.ts src/core.ts src/cli/index.ts src/mcp/index.ts src/parser/parse-worker.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
|
|
44
|
+
"build": "bun build src/index.ts src/core.ts src/profiles.ts src/cli/index.ts src/mcp/index.ts src/parser/parse-worker.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
|
|
40
45
|
"prepublishOnly": "bun run typecheck && bun run build",
|
|
41
46
|
"prepare": "bun run build",
|
|
42
47
|
"test": "node scripts/run-test-files.mjs",
|
|
@@ -56,6 +61,7 @@
|
|
|
56
61
|
"@earendil-works/pi-tui": "1.2.0",
|
|
57
62
|
"@llblab/pi-telegram": "0.57.2",
|
|
58
63
|
"@modelcontextprotocol/server": "^2.3.1",
|
|
64
|
+
"@parcel/watcher": "2.6.0",
|
|
59
65
|
"chardet": "^2.2.0",
|
|
60
66
|
"discord.js": "14.27.0",
|
|
61
67
|
"fast-xml-parser": "^5.11.2",
|
|
@@ -65,6 +71,7 @@
|
|
|
65
71
|
"kordoc": "^4.21.30",
|
|
66
72
|
"mailparser": "^3.9.38",
|
|
67
73
|
"pdfjs-dist": "^6.4.299",
|
|
74
|
+
"pi-ask-user": "0.17.0",
|
|
68
75
|
"pi-discord-remote": "0.2.4",
|
|
69
76
|
"puppeteer-core": "^25.13.0",
|
|
70
77
|
"slides-grab": "^1.5.2",
|
package/skills/autorag/SKILL.md
CHANGED
|
@@ -45,6 +45,34 @@ near/contains families require human review. Exact duplicate exclusion during
|
|
|
45
45
|
refresh is enabled by default and can be disabled with
|
|
46
46
|
`"excludeExactDuplicates": false` in `config.json`.
|
|
47
47
|
|
|
48
|
+
### Converting files
|
|
49
|
+
|
|
50
|
+
The `convert_files` and `list_file_conversions` Agent tools run the
|
|
51
|
+
[Filee](https://github.com/KnifeLemon/Filee) command line to convert local
|
|
52
|
+
files offline: documents, spreadsheets, slides, HWP/HWPX, images, e-books,
|
|
53
|
+
archives, audio, video, data, and subtitles. They work on any path the user
|
|
54
|
+
names, not only the configured roots. This is the one exception to the
|
|
55
|
+
"never write source files" rule above: a conversion writes a new file and
|
|
56
|
+
never touches its source. An existing output name gets a number added unless
|
|
57
|
+
the user asks to replace it, in which case pass `overwrite: true`. Never
|
|
58
|
+
delete the source unless the user asked.
|
|
59
|
+
|
|
60
|
+
Each converted file is checked with `dupey compare` against its source, using
|
|
61
|
+
dupey's own thresholds, so the report says whether a later scan will group
|
|
62
|
+
them: `exact` (same canonical text, for example DOCX to HWPX), `near` (same
|
|
63
|
+
document in another format, for example Markdown to TXT), `different` (text
|
|
64
|
+
differs, typically layout formats such as PDF), `unsupported` (dupey cannot
|
|
65
|
+
read the format, for example HTML or images), or `unavailable` (dupey not
|
|
66
|
+
installed). The command line is `filee.binaryPath` if set, else a `filee`/`filee-cli`
|
|
67
|
+
on `PATH`, else the pinned [filee-cli](https://github.com/NomaDamas/filee-cli)
|
|
68
|
+
release that `autorag setup` (or the first conversion) downloads into
|
|
69
|
+
`<AUTORAG_HOME>/tools/filee-cli/`; `"filee": { "autoInstall": false }` forbids that
|
|
70
|
+
download. The system prompt carries the conversion map (which format family
|
|
71
|
+
converts to which, and the two-step chain when no direct route exists), so plan
|
|
72
|
+
from it instead of probing. `"filee": { "enabled": false }` in `config.json` removes both
|
|
73
|
+
tools; `filee.timeoutMs` (default 30 minutes) and `filee.dataDir` (Filee's
|
|
74
|
+
own settings and engines, `FILEE_DATA_DIR`) tune them.
|
|
75
|
+
|
|
48
76
|
### Excluding local files from the index
|
|
49
77
|
|
|
50
78
|
`"excludePaths"` in `config.json` lists files or folders (absolute, or relative
|
|
@@ -83,7 +111,10 @@ autorag search "what were the key findings in the Q3 report" --top-k 5 --json --
|
|
|
83
111
|
only `answer` plus `results`. Every
|
|
84
112
|
bracketed `[n]` citation in `answer` resolves to a `results[].number` of the
|
|
85
113
|
same response; an unmatched citation is removed and reported as a
|
|
86
|
-
`citation-without-result` diagnostic.
|
|
114
|
+
`citation-without-result` diagnostic. Within one conversation (an interactive
|
|
115
|
+
session, including a resumed one), a source keeps the `number` it was first
|
|
116
|
+
shown with and a new source gets the next unused number, so `results[].number`
|
|
117
|
+
can skip numbers and need not start at 1 on a later turn.
|
|
87
118
|
|
|
88
119
|
To inspect the exact persisted evidence behind numbered results, use:
|
|
89
120
|
|
|
@@ -92,14 +123,21 @@ autorag evidence <sessionId> --result 1 --json
|
|
|
92
123
|
```
|
|
93
124
|
|
|
94
125
|
The response includes the original source, retrieval method, stable evidence
|
|
95
|
-
ID, raw excerpt/content, and any available `chunkIndex`, `lineNumber
|
|
96
|
-
`
|
|
126
|
+
ID, raw excerpt/content, and any available `chunkIndex`, `lineNumber` and
|
|
127
|
+
`lineEnd` (the chunk's line range in the parsed document), `section` (the
|
|
128
|
+
article or heading it sits in), `retrievalResultId`, and metadata. Omit `--result` to inspect every result in
|
|
97
129
|
the session. Prefer this command whenever the caller wants detailed chunk text
|
|
98
130
|
rather than only the curated summary.
|
|
99
131
|
|
|
100
132
|
- `--scope` narrows datasource retrieval to a requested sub-path (ordinary
|
|
101
133
|
per-query filtering).
|
|
102
134
|
- `--json` is required for programmatic consumption.
|
|
135
|
+
- Each search result carries `locations` (`lineStart`, `lineEnd`, `section`)
|
|
136
|
+
when the harness measured where its evidence sits in the parsed document. Quote
|
|
137
|
+
those, not line numbers or counts written in the answer prose; a
|
|
138
|
+
`line-reference-unverified` diagnostic (with `--debug`) flags prose line
|
|
139
|
+
numbers no cited evidence covers. Locations are absent for chunks the chunker
|
|
140
|
+
rewrote (such as flattened tables).
|
|
103
141
|
- `--debug` is required for `sessionId` and diagnostics in search output.
|
|
104
142
|
- `autorag evidence` is the detailed source/chunk inspection path.
|
|
105
143
|
|
|
@@ -116,12 +154,22 @@ default, OpenRouter), Jev first routes the question:
|
|
|
116
154
|
datasources) is handled by the agent itself: it loads the setup skill, edits
|
|
117
155
|
the active config, verifies it, and reports what changed. The running agent
|
|
118
156
|
keeps its startup model; changes apply to the next `autorag` launch.
|
|
119
|
-
-
|
|
157
|
+
- A request to act on files or folders (move, bulk rename, rename by content,
|
|
158
|
+
convert, sort) is carried out in one tool turn with no retrieval and no
|
|
159
|
+
verification, and reports every change as old path → new path.
|
|
160
|
+
- Anything else that needs no retrieval (commit, push, open a PR, run a build)
|
|
161
|
+
is carried out in one tool turn the same way.
|
|
162
|
+
- Private-data questions use local search. Questions about public facts that may
|
|
163
|
+
be recent or have changed can use the public web: Jev picks the web in the
|
|
164
|
+
same check as the registered connections, one web search runs per search
|
|
165
|
+
query before the fast answer, and the fast phase may also call `web_search`
|
|
166
|
+
itself when the baseline lacks the answer.
|
|
120
167
|
- A multi-part question is split into up to five parallel search queries.
|
|
121
168
|
- On local search, Jev also picks which registered datasources (Slack,
|
|
122
|
-
Discord, KakaoTalk, email, ...) to search before the fast answer
|
|
123
|
-
|
|
124
|
-
their
|
|
169
|
+
Discord, KakaoTalk, email, ...) to search before the fast answer — and
|
|
170
|
+
whether to search the public web — from each description and where similar
|
|
171
|
+
past questions were answered; their hits are reranked together with local
|
|
172
|
+
file evidence.
|
|
125
173
|
|
|
126
174
|
After the fast answer, Jev ends the run if the answer is complete and
|
|
127
175
|
evidence-backed. So `results` may come straight from the fast answer, with no
|
|
@@ -145,8 +193,42 @@ autorag index rebuild --yes --json
|
|
|
145
193
|
autorag index reset --method parsed --yes --json
|
|
146
194
|
autorag memory inspect --json
|
|
147
195
|
autorag tui
|
|
196
|
+
autorag automate status --json
|
|
197
|
+
autorag automate install --json
|
|
198
|
+
autorag automate uninstall --json
|
|
199
|
+
autorag automate run invoice --event create:/path/to/file.pdf --json
|
|
200
|
+
autorag automate daemon
|
|
148
201
|
```
|
|
149
202
|
|
|
203
|
+
File-triggered automations live in `~/.autorag/automations.json` (`automations`
|
|
204
|
+
array of `{ id, paths, events, include, exclude, run | agent, appendFiles, debounceMs, timeoutMs }`).
|
|
205
|
+
Edit `automations.json` directly to add or change rules; matched `[{ type, path }]`
|
|
206
|
+
events are piped on stdin to `run`. Use `autorag automate install` to register
|
|
207
|
+
the background daemon with launchd, `systemd --user`, or Windows Task Scheduler.
|
|
208
|
+
|
|
209
|
+
A rule runs exactly one of `run` (a command) or `agent` (an AI agent started in
|
|
210
|
+
the daemon on each batch of changes):
|
|
211
|
+
|
|
212
|
+
```json
|
|
213
|
+
{ "id": "inbox-triage", "paths": ["~/Downloads"], "include": ["**/*.pdf"],
|
|
214
|
+
"agent": { "profile": "file-triage", "task": "Summarize each new PDF.",
|
|
215
|
+
"retrieval": { "searchAll": true, "datasources": ["kakao"] } } }
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
`agent.profile` names a profile defined in code: `file-triage` (reads, lists and
|
|
219
|
+
searches files; changes nothing) or `file-organizer` (also `bash`, `edit`,
|
|
220
|
+
`write`). A rule never carries a prompt or a tool list, so the rules file cannot
|
|
221
|
+
grant an agent more than its profile has. `retrieval` optionally adds
|
|
222
|
+
`search_all_documents` and one `search_datasource_<id>` per listed datasource.
|
|
223
|
+
Retrieval memory is never connected to an automation agent.
|
|
224
|
+
|
|
225
|
+
Every agent run gets a loop guard appended to its system prompt, naming the
|
|
226
|
+
rule's folders, file types and events, and forbidding any change that would
|
|
227
|
+
fire the rule again, editing the rules file, and running `autorag automate`. At
|
|
228
|
+
most one agent run is in flight across all rules, and an agent rule is
|
|
229
|
+
disabled after 6 runs within 60 seconds (command rules: 20). The run's final
|
|
230
|
+
reply is the `stdout` of its log entry.
|
|
231
|
+
|
|
150
232
|
Prefer a full refresh so parsed mirrors, MinSync, Jikji, configured
|
|
151
233
|
datasources, and (on Windows) the bundled Everything file-name index stay
|
|
152
234
|
aligned. `--method` accepts
|
|
@@ -201,7 +201,7 @@ resolves in order:
|
|
|
201
201
|
|
|
202
202
|
1. A configured remote endpoint (`minSync.embedder`), used for everything; no
|
|
203
203
|
daemon is started and no local model is loaded.
|
|
204
|
-
2. A running `minsync serve` daemon (loopback only; MinSync 0.4.
|
|
204
|
+
2. A running `minsync serve` daemon (loopback only; MinSync 0.4.12+).
|
|
205
205
|
AutoRAG never starts it: run `minsync serve --idle-timeout 0` yourself, as
|
|
206
206
|
a launchd/systemd service (see `docs/minsync-setup.md`), or press
|
|
207
207
|
Ctrl+Shift+E in `autorag tui`. `autorag setup` only reports whether it is
|
|
@@ -239,9 +239,13 @@ fast and multi-part questions thorough.
|
|
|
239
239
|
- **Jev** (`jev`, default `{ "backend": "dazzi" }` when signed in to Dazzi
|
|
240
240
|
Models, else `{ "backend": "openrouter" }`; model `jev-1.13` on Dazzi,
|
|
241
241
|
`typesafe/jev-1.13` on OpenRouter) runs before the fast answer. It routes each question to
|
|
242
|
-
local search
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
local search (everything needing more information),
|
|
243
|
+
`organize` (moving, renaming, converting, or
|
|
244
|
+
sorting files and folders), `extra` (a knowledge answer, or any other action that needs no
|
|
245
|
+
retrieval, such as committing code: one turn with every tool), or the `config`
|
|
246
|
+
branch, and decides
|
|
247
|
+
whether to decompose it. A non-local branch only wins above a 0.75 confidence
|
|
248
|
+
floor; anything weaker stays on local search. On
|
|
245
249
|
local search it also decides, per registered datasource, whether to search
|
|
246
250
|
it before the fast answer, using each datasource's `description` and where
|
|
247
251
|
similar past questions were answered (retrieval memory). When setting up a
|
|
@@ -540,6 +544,8 @@ is set up.
|
|
|
540
544
|
- `AUTORAG_MEMORY_PATH`
|
|
541
545
|
- `AUTORAG_MODEL_PROVIDER`
|
|
542
546
|
- `AUTORAG_MODEL_ID`
|
|
547
|
+
- `AUTORAG_PERMISSION_MODE` (`auto` default for the TUI, `full` for `autorag search` and a TUI with a chat bridge, `ask`, `full`; config key `permissionMode`; with `auto` Jev checks the agent's
|
|
548
|
+
file-changing calls and asks the user only when it will not approve, `ask` asks about every one, `full` never asks)
|
|
543
549
|
|
|
544
550
|
## Completion condition
|
|
545
551
|
|