@autorag/librarian 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +155 -55
- package/dist/agent/agent.d.ts +27 -41
- package/dist/agent/bash-tool.d.ts +0 -11
- package/dist/agent/dupey-tool.d.ts +15 -0
- package/dist/agent/emit-results-tool.d.ts +14 -0
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/local-model.d.ts +12 -0
- package/dist/agent/search-bm25-tool.d.ts +1 -1
- package/dist/agent/search-documents.d.ts +1 -1
- package/dist/agent/search-minsync-tool.d.ts +1 -1
- package/dist/agent/system-prompt.d.ts +1 -2
- package/dist/cli/commands/duplicates.d.ts +4 -0
- package/dist/cli/commands/health.d.ts +9 -65
- package/dist/cli/commands/init.d.ts +1 -1
- package/dist/cli/commands/search.d.ts +2 -2
- package/dist/cli/config.d.ts +10 -14
- package/dist/cli/index.js +10652 -9947
- 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 +4 -1
- package/dist/datasource/connector.d.ts +5 -1
- package/dist/datasource/crawler-client.d.ts +9 -0
- package/dist/datasource/crawler-skill.d.ts +47 -0
- package/dist/datasource/crawler-types.d.ts +53 -0
- package/dist/datasource/index.d.ts +8 -4
- package/dist/datasource/skills/cloud-drive/index.d.ts +1 -0
- package/dist/datasource/skills/cloud-drive/skill.d.ts +14 -0
- package/dist/datasource/skills/discrawl/client.d.ts +23 -0
- package/dist/datasource/skills/discrawl/config.d.ts +9 -0
- package/dist/datasource/skills/discrawl/index.d.ts +5 -0
- package/dist/datasource/skills/discrawl/methods.d.ts +55 -0
- package/dist/datasource/skills/discrawl/paths.d.ts +30 -0
- package/dist/datasource/skills/discrawl/skill.d.ts +61 -0
- package/dist/datasource/skills/discrawl/types.d.ts +198 -0
- package/dist/datasource/skills/factory.d.ts +7 -0
- package/dist/datasource/skills/gdrive/rclone-connector.d.ts +16 -24
- package/dist/datasource/skills/notion/index.d.ts +15 -2
- package/dist/datasource/skills/obsidian/client.d.ts +15 -0
- package/dist/datasource/skills/obsidian/index.d.ts +6 -2
- package/dist/datasource/skills/obsidian/methods.d.ts +26 -0
- package/dist/datasource/skills/obsidian/paths.d.ts +27 -0
- package/dist/datasource/skills/obsidian/skill.d.ts +41 -17
- package/dist/datasource/skills/obsidian/types.d.ts +90 -0
- package/dist/datasource/skills/slack/index.d.ts +15 -2
- package/dist/datasource/skills/telecrawl/index.d.ts +15 -0
- package/dist/datasource/skills/wacrawl/index.d.ts +15 -0
- package/dist/dupey/cli.d.ts +40 -0
- package/dist/dupey/filter.d.ts +8 -0
- package/dist/dupey/index.d.ts +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +7774 -7409
- package/dist/memory/check-memory-tool.d.ts +1 -0
- package/dist/memory/index.d.ts +2 -2
- package/dist/memory/memory.d.ts +33 -3
- package/dist/memory/renderer.d.ts +2 -1
- package/dist/mirror/sync.d.ts +3 -1
- package/dist/observability/run-log.d.ts +1 -26
- package/dist/process/portable-spawn.d.ts +10 -0
- package/dist/retrieval/merger.d.ts +1 -0
- package/dist/retrieval/scope.d.ts +10 -0
- package/package.json +21 -20
- package/skills/autorag/SKILL.md +59 -96
- package/skills/autorag-setup/SKILL.md +144 -378
- package/dist/datasource/skills/discord/connector.d.ts +0 -30
- package/dist/datasource/skills/discord/index.d.ts +0 -2
- package/dist/datasource/skills/discord/skill.d.ts +0 -20
- package/dist/datasource/skills/notion/connector.d.ts +0 -26
- package/dist/datasource/skills/notion/skill.d.ts +0 -20
- package/dist/datasource/skills/obsidian/connector.d.ts +0 -22
- package/dist/datasource/skills/slack/connector.d.ts +0 -28
- package/dist/datasource/skills/slack/skill.d.ts +0 -20
- 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
|
@@ -8,6 +8,7 @@ export interface CheckMemoryDetails {
|
|
|
8
8
|
signalCount: number;
|
|
9
9
|
topMethod: string | null;
|
|
10
10
|
insightCount: number;
|
|
11
|
+
contextHintCount: number;
|
|
11
12
|
}
|
|
12
13
|
export declare function createCheckMemoryTool(memory: RetrievalMemory): AgentTool<typeof checkMemorySchema, CheckMemoryDetails>;
|
|
13
14
|
export {};
|
package/dist/memory/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { CheckMemoryDetails } from "./check-memory-tool.js";
|
|
2
2
|
export { createCheckMemoryTool } from "./check-memory-tool.js";
|
|
3
|
-
export type { MemoryEntry, ResultFeedback, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt } from "./memory.js";
|
|
4
|
-
export { RetrievalMemory } from "./memory.js";
|
|
3
|
+
export type { ContextValueHint, EvidenceContext, FeedbackIdInput, MemoryEntry, ResultFeedback, RetrievalContextHints, RetrievalInsight, RetrievalMemoryOptions, SearchAttempt, } from "./memory.js";
|
|
4
|
+
export { normalizeSessionEvidenceRef, RetrievalMemory } from "./memory.js";
|
|
5
5
|
export { renderMemoryContext } from "./renderer.js";
|
package/dist/memory/memory.d.ts
CHANGED
|
@@ -9,7 +9,16 @@ export interface SignalDefaults {
|
|
|
9
9
|
readonly implicitCap: number;
|
|
10
10
|
readonly decayHalfLifeMs?: number;
|
|
11
11
|
}
|
|
12
|
-
export interface
|
|
12
|
+
export interface EvidenceContext {
|
|
13
|
+
readonly retrieverMix?: readonly string[];
|
|
14
|
+
readonly parserType?: string;
|
|
15
|
+
readonly documentType?: string;
|
|
16
|
+
readonly documentArea?: string;
|
|
17
|
+
readonly evidenceType?: string;
|
|
18
|
+
readonly evidenceLocation?: string;
|
|
19
|
+
readonly confidence?: number;
|
|
20
|
+
}
|
|
21
|
+
export interface EvidenceChunkRecord extends NormalizedEvidenceRef, EvidenceContext {
|
|
13
22
|
readonly excerptHash: string;
|
|
14
23
|
readonly firstSeenAt: number;
|
|
15
24
|
readonly lastSeenAt: number;
|
|
@@ -24,6 +33,7 @@ export interface CuratedResultRecord {
|
|
|
24
33
|
readonly summary: string;
|
|
25
34
|
readonly resultHash: string;
|
|
26
35
|
readonly evidenceIds: readonly string[];
|
|
36
|
+
readonly confidence?: number;
|
|
27
37
|
readonly createdAt: number;
|
|
28
38
|
}
|
|
29
39
|
export interface FeedbackSignal {
|
|
@@ -53,6 +63,19 @@ export interface MethodHint {
|
|
|
53
63
|
readonly confidence: number;
|
|
54
64
|
readonly reason: string;
|
|
55
65
|
}
|
|
66
|
+
export interface ContextValueHint {
|
|
67
|
+
readonly value: string;
|
|
68
|
+
readonly score: number;
|
|
69
|
+
readonly confidence: number;
|
|
70
|
+
}
|
|
71
|
+
export interface RetrievalContextHints {
|
|
72
|
+
readonly documentAreas: readonly ContextValueHint[];
|
|
73
|
+
readonly documentTypes: readonly ContextValueHint[];
|
|
74
|
+
readonly evidenceTypes: readonly ContextValueHint[];
|
|
75
|
+
readonly evidenceLocations: readonly ContextValueHint[];
|
|
76
|
+
readonly parserTypes: readonly ContextValueHint[];
|
|
77
|
+
readonly retrieverMix: readonly ContextValueHint[];
|
|
78
|
+
}
|
|
56
79
|
export interface RetrievalInsight {
|
|
57
80
|
readonly id: string;
|
|
58
81
|
readonly clusterKey: string;
|
|
@@ -107,7 +130,7 @@ export interface ResultFeedback {
|
|
|
107
130
|
source: string;
|
|
108
131
|
useful: boolean;
|
|
109
132
|
}
|
|
110
|
-
export interface SessionEvidenceRef extends NormalizedEvidenceRef {
|
|
133
|
+
export interface SessionEvidenceRef extends NormalizedEvidenceRef, EvidenceContext {
|
|
111
134
|
readonly metadata?: Record<string, unknown>;
|
|
112
135
|
}
|
|
113
136
|
export interface SessionCuratedResultInput {
|
|
@@ -117,6 +140,7 @@ export interface SessionCuratedResultInput {
|
|
|
117
140
|
readonly content: string;
|
|
118
141
|
readonly method: string;
|
|
119
142
|
readonly source: string;
|
|
143
|
+
readonly confidence?: number;
|
|
120
144
|
readonly evidenceRefs: readonly SessionEvidenceRef[];
|
|
121
145
|
}
|
|
122
146
|
export interface SessionRecordInput {
|
|
@@ -132,6 +156,10 @@ export interface NumberedFeedbackInput {
|
|
|
132
156
|
readonly useful: boolean;
|
|
133
157
|
}[];
|
|
134
158
|
}
|
|
159
|
+
export interface FeedbackIdInput {
|
|
160
|
+
readonly feedbackId: string;
|
|
161
|
+
readonly useful: boolean;
|
|
162
|
+
}
|
|
135
163
|
export interface RetrievalMemoryOptions {
|
|
136
164
|
storagePath: string;
|
|
137
165
|
insightExtractor?: InsightExtractor;
|
|
@@ -150,8 +178,10 @@ export declare class RetrievalMemory {
|
|
|
150
178
|
getSignalCount(): number;
|
|
151
179
|
recordCuratedResultsSession(input: SessionRecordInput): void;
|
|
152
180
|
recordNumberedFeedback(input: NumberedFeedbackInput): boolean;
|
|
181
|
+
recordFeedbackByIds(feedback: readonly FeedbackIdInput[]): boolean;
|
|
153
182
|
recordWeakSignal(query: string, method: string, source: "followup" | "retry"): void;
|
|
154
|
-
getMethodHints(
|
|
183
|
+
getMethodHints(_query: string): MethodHint[];
|
|
184
|
+
getContextHints(_query: string): RetrievalContextHints;
|
|
155
185
|
getInsights(query: string): RetrievalInsight[];
|
|
156
186
|
getMethodPriority(query: string): Array<{
|
|
157
187
|
method: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { MethodHint, RetrievalInsight } from "./memory.js";
|
|
1
|
+
import type { MethodHint, RetrievalContextHints, RetrievalInsight } from "./memory.js";
|
|
2
2
|
export declare function renderMemoryContext(hints: readonly MethodHint[], opts?: {
|
|
3
3
|
maxHints?: number;
|
|
4
4
|
insights?: readonly RetrievalInsight[];
|
|
5
5
|
maxInsights?: number;
|
|
6
|
+
contextHints?: RetrievalContextHints;
|
|
6
7
|
}): string;
|
package/dist/mirror/sync.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ export interface ParsedMirrorSyncOptions {
|
|
|
10
10
|
readonly force?: boolean;
|
|
11
11
|
/** Override max source size for parse attempts (bytes). */
|
|
12
12
|
readonly maxSourceBytes?: number;
|
|
13
|
+
/** Absolute source paths omitted from parsed mirrors (for example exact duplicate copies). */
|
|
14
|
+
readonly excludeSourcePaths?: ReadonlySet<string>;
|
|
13
15
|
}
|
|
14
|
-
export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "deleted-mirror" | "stale-index";
|
|
16
|
+
export type ParsedMirrorDiagnosticCode = "unsupported-file" | "parser-skipped" | "parser-failed" | "duplicate-excluded" | "deleted-mirror" | "stale-index";
|
|
15
17
|
/** Path-opaque refresh diagnostic. `source` is an opaque virtual path, never a real fs path. */
|
|
16
18
|
export interface ParsedMirrorDiagnostic {
|
|
17
19
|
readonly code: ParsedMirrorDiagnosticCode;
|
|
@@ -3,8 +3,7 @@ export type AutoRAGRunEvent = {
|
|
|
3
3
|
timestamp: string;
|
|
4
4
|
sessionId: string;
|
|
5
5
|
queryLength: number;
|
|
6
|
-
|
|
7
|
-
explorerModel: string;
|
|
6
|
+
model: string;
|
|
8
7
|
} | {
|
|
9
8
|
event: "search_completed";
|
|
10
9
|
timestamp: string;
|
|
@@ -21,30 +20,6 @@ export type AutoRAGRunEvent = {
|
|
|
21
20
|
sessionId: string;
|
|
22
21
|
failureCount: number;
|
|
23
22
|
errorTypes: string[];
|
|
24
|
-
} | {
|
|
25
|
-
event: "dispatch_rejected";
|
|
26
|
-
schemaVersion: 1;
|
|
27
|
-
sessionId: string;
|
|
28
|
-
toolCallId: string | null;
|
|
29
|
-
sequence: number;
|
|
30
|
-
timestamp: string;
|
|
31
|
-
dispatchKind: "launch" | "admin" | "control" | "mutation" | "schedule" | "hybrid" | "unknown";
|
|
32
|
-
code: string;
|
|
33
|
-
field: string;
|
|
34
|
-
forceCorrectable: boolean;
|
|
35
|
-
} | {
|
|
36
|
-
event: "dispatch_autofilled";
|
|
37
|
-
schemaVersion: 1;
|
|
38
|
-
sessionId: string;
|
|
39
|
-
toolCallId: string | null;
|
|
40
|
-
sequence: number;
|
|
41
|
-
timestamp: string;
|
|
42
|
-
dispatchKind: "launch";
|
|
43
|
-
fields: {
|
|
44
|
-
artifacts: boolean;
|
|
45
|
-
agentScope: boolean;
|
|
46
|
-
leafModelFillCount: number;
|
|
47
|
-
};
|
|
48
23
|
};
|
|
49
24
|
export declare class AutoRAGRunLogger {
|
|
50
25
|
private readonly path;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface PortableSpawnCommand {
|
|
2
|
+
readonly command: string;
|
|
3
|
+
readonly args: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Windows does not execute Unix shebang files or extensionless scripts through
|
|
7
|
+
* child_process.spawn. Resolve test/dev script entrypoints through their
|
|
8
|
+
* interpreter while leaving native executables untouched.
|
|
9
|
+
*/
|
|
10
|
+
export declare function portableSpawnCommand(command: string, args: readonly string[], platform?: NodeJS.Platform): PortableSpawnCommand;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RetrievalMethod, RetrievalOptions, RetrievalResult, RetrievalWithDiagnostics } from "./types.js";
|
|
2
2
|
export interface MergeOptions {
|
|
3
3
|
topK: number;
|
|
4
|
+
/** Retained for API compatibility; exact-source aggregation is always enabled. */
|
|
4
5
|
dedup: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare class ResultMerger {
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
+
export interface RetrievalScopeBinding {
|
|
2
|
+
readonly virtualPrefix: string;
|
|
3
|
+
readonly physicalRoots: readonly string[];
|
|
4
|
+
}
|
|
5
|
+
export declare class RetrievalScopeError extends Error {
|
|
6
|
+
readonly code = "invalid-retrieval-scope";
|
|
7
|
+
constructor(virtualPrefixes: readonly string[]);
|
|
8
|
+
}
|
|
1
9
|
export declare function normalizeVirtualPath(value: string): string;
|
|
2
10
|
export declare function normalizeVirtualPathScope(scope: string | undefined): string | undefined;
|
|
11
|
+
export declare function resolveRetrievalScope(scope: string | undefined, bindings: readonly RetrievalScopeBinding[], platform?: NodeJS.Platform, passthroughVirtualPrefixes?: readonly string[]): string | undefined;
|
|
12
|
+
export declare function buildRetrievalScopeBindings(workspaceRoot: string, searchPaths: readonly string[], configuredSearchPaths?: readonly string[]): readonly RetrievalScopeBinding[];
|
|
3
13
|
export declare function matchesVirtualPathScope(virtualPath: string, scope: string | undefined): boolean;
|
|
4
14
|
export declare function virtualPathScopeToRegExp(scope: string): RegExp;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autorag/librarian",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "Self-evolving librarian agent on Pi framework with pluggable retrieval methods",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -28,40 +28,41 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"build": "bun build src/index.ts src/cli/index.ts
|
|
31
|
+
"build": "bun build src/index.ts src/cli/index.ts --outdir dist --target node --packages external && tsc -p tsconfig.build.json && node scripts/fixup-dts.mjs",
|
|
32
32
|
"prepublishOnly": "bun run typecheck && bun run build",
|
|
33
33
|
"prepare": "bun run build",
|
|
34
|
-
"test": "
|
|
34
|
+
"test": "node scripts/run-test-files.mjs",
|
|
35
|
+
"test:windows": "node scripts/run-test-files.mjs",
|
|
35
36
|
"check": "biome check --write .",
|
|
37
|
+
"lint": "biome check .",
|
|
36
38
|
"typecheck": "tsc --noEmit"
|
|
37
39
|
},
|
|
38
40
|
"engines": {
|
|
39
41
|
"node": ">=24.0.0"
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@earendil-works/pi-agent-core": "^0.
|
|
43
|
-
"@earendil-works/pi-ai": "^0.
|
|
44
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
45
|
-
"@opendataloader/pdf": "^2.
|
|
44
|
+
"@earendil-works/pi-agent-core": "^0.84.2",
|
|
45
|
+
"@earendil-works/pi-ai": "^0.84.2",
|
|
46
|
+
"@earendil-works/pi-coding-agent": "0.84.2",
|
|
47
|
+
"@opendataloader/pdf": "^2.5.2",
|
|
46
48
|
"@pngwasi/node-tantivy-binding": "^0.3.4",
|
|
47
|
-
"@rhwp/core": "0.
|
|
49
|
+
"@rhwp/core": "0.8.4",
|
|
48
50
|
"chardet": "^2.2.0",
|
|
49
|
-
"fast-xml-parser": "^5.
|
|
50
|
-
"iconv-lite": "^0.7.
|
|
51
|
+
"fast-xml-parser": "^5.11.0",
|
|
52
|
+
"iconv-lite": "^0.7.3",
|
|
51
53
|
"jszip": "^3.10.1",
|
|
52
|
-
"mailparser": "^3.9.
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"smol-toml": "1.7.0",
|
|
54
|
+
"mailparser": "^3.9.15",
|
|
55
|
+
"slides-grab": "^1.5.0",
|
|
56
|
+
"smol-toml": "1.8.0",
|
|
56
57
|
"tesseract.js": "^7.0.0",
|
|
57
|
-
"typebox": "^1.
|
|
58
|
-
"yaml": "^2.
|
|
58
|
+
"typebox": "^1.3.16",
|
|
59
|
+
"yaml": "^2.9.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
|
-
"@biomejs/biome": "2.
|
|
62
|
+
"@biomejs/biome": "2.5.9",
|
|
62
63
|
"@types/mailparser": "^3.4.6",
|
|
63
|
-
"@types/node": "^
|
|
64
|
-
"typescript": "^
|
|
65
|
-
"vitest": "^4.1.
|
|
64
|
+
"@types/node": "^26.2.0",
|
|
65
|
+
"typescript": "^7.0.2",
|
|
66
|
+
"vitest": "^4.1.11"
|
|
66
67
|
}
|
|
67
68
|
}
|
package/skills/autorag/SKILL.md
CHANGED
|
@@ -1,70 +1,82 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: autorag
|
|
3
|
-
description: Use an already configured AutoRAG librarian agent to search, summarize, compare, and answer questions from local document collections. Use autorag-setup
|
|
3
|
+
description: Use an already configured AutoRAG librarian agent to search, summarize, compare, and answer questions from local document collections. Use autorag-setup for configuration or indexing changes.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# AutoRAG Librarian Skill
|
|
7
7
|
|
|
8
8
|
Use this skill when AutoRAG is already configured and the user asks to search,
|
|
9
9
|
summarize, compare, or answer questions from local PDFs, wikis, notes, research
|
|
10
|
-
papers, or knowledge bases.
|
|
11
|
-
settings, subscription or API-provider detection, or changing indexed folders,
|
|
12
|
-
use the `autorag-setup` skill instead.
|
|
10
|
+
papers, or knowledge bases.
|
|
13
11
|
|
|
14
|
-
AutoRAG is
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
AutoRAG is the specialized librarian agent. One configured model plans the
|
|
13
|
+
search, calls BM25, MinSync, Jikji, datasource, and filesystem tools, reads
|
|
14
|
+
sources, judges evidence, and curates the final answer. There is no subagent or
|
|
15
|
+
separate model role.
|
|
16
|
+
|
|
17
|
+
AutoRAG reads source documents and writes indexes only under the configured
|
|
18
|
+
workspace `.autorag/` directory and Jikji's per-source `.jikji/` caches. Never
|
|
19
|
+
move, rename, edit, or delete source files.
|
|
18
20
|
|
|
19
21
|
## Preflight
|
|
20
22
|
|
|
21
|
-
Confirm
|
|
22
|
-
|
|
23
|
-
`searchPaths`/`agents` without printing credentials. Then run:
|
|
23
|
+
Confirm `~/.autorag/config.json`, an explicit `--config`, or `AUTORAG_CONFIG`
|
|
24
|
+
exists. Inspect only non-secret `searchPaths` and `model` metadata, then run:
|
|
24
25
|
|
|
25
26
|
```bash
|
|
27
|
+
autorag duplicates # read-only duplicate-family review
|
|
28
|
+
autorag duplicates --json # machine-readable cleanup planning input
|
|
26
29
|
autorag status
|
|
27
30
|
autorag health
|
|
28
31
|
```
|
|
29
32
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
### Duplicate-file review
|
|
34
|
+
|
|
35
|
+
Use `autorag duplicates` when the user asks to find duplicate files, choose
|
|
36
|
+
likely latest copies, or reduce corpus/index space. The command and the
|
|
37
|
+
`scan_duplicate_documents` Agent tool are read-only and never delete or move
|
|
38
|
+
source files. Exact means dupey's canonical extracted-text hash matches;
|
|
39
|
+
near/contains families require human review. Exact duplicate exclusion during
|
|
40
|
+
refresh is enabled by default and can be disabled with
|
|
41
|
+
`"excludeExactDuplicates": false` in `config.json`.
|
|
42
|
+
|
|
43
|
+
`status` is model-free and path-opaque. `health` resolves the single model,
|
|
44
|
+
checks credential presence, and normally probes one live completion. If the
|
|
45
|
+
model, authentication, configuration, or indexes are unhealthy, use
|
|
46
|
+
`autorag-setup` rather than guessing private provider details.
|
|
38
47
|
|
|
39
|
-
|
|
48
|
+
BM25, MinSync, and Jikji should normally be healthy. If they are missing or
|
|
49
|
+
stale, run a full `autorag refresh` or return to setup rather than silently
|
|
50
|
+
degrading to lexical-only search.
|
|
51
|
+
|
|
52
|
+
## Search
|
|
40
53
|
|
|
41
54
|
```bash
|
|
42
|
-
autorag search "what were the key findings in the Q3 report" --top-k 5
|
|
55
|
+
autorag search "what were the key findings in the Q3 report" --top-k 5 --json
|
|
43
56
|
```
|
|
44
57
|
|
|
45
|
-
|
|
46
|
-
|
|
58
|
+
The response contains a `sessionId`, numbered curated results, source mapping,
|
|
59
|
+
and an answer grounded in those results.
|
|
47
60
|
|
|
48
|
-
- `--scope`
|
|
49
|
-
- `--tags
|
|
50
|
-
|
|
51
|
-
- `--json`
|
|
52
|
-
- `--debug`
|
|
61
|
+
- `--scope` narrows to a configured virtual sub-path.
|
|
62
|
+
- `--tags` narrows already-authorized datasource results and never grants new
|
|
63
|
+
access.
|
|
64
|
+
- `--json` is preferred for programmatic consumption.
|
|
65
|
+
- `--debug` is for diagnostics only.
|
|
53
66
|
|
|
54
|
-
Do not bypass
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
error output includes a hint pointing to `autorag health` for diagnosis.
|
|
67
|
+
Do not bypass the librarian with ad hoc raw search when the user requested
|
|
68
|
+
AutoRAG. The search loop can use Jikji, BM25, MinSync, datasource retrieval, and
|
|
69
|
+
direct source reading as appropriate. If search fails because of model,
|
|
70
|
+
provider, auth, or timeout problems, diagnose with `autorag health`.
|
|
59
71
|
|
|
60
|
-
Record feedback so retrieval memory
|
|
72
|
+
Record feedback so retrieval memory can learn:
|
|
61
73
|
|
|
62
74
|
```bash
|
|
63
75
|
autorag feedback <sessionId> --useful 1,3 --not-useful 2
|
|
64
76
|
```
|
|
65
77
|
|
|
66
|
-
Supply at least one
|
|
67
|
-
|
|
78
|
+
Supply at least one feedback list. Numbers refer to the returned knowledge
|
|
79
|
+
units.
|
|
68
80
|
|
|
69
81
|
## Maintenance
|
|
70
82
|
|
|
@@ -72,7 +84,7 @@ numbered knowledge units from that session's search output.
|
|
|
72
84
|
autorag status
|
|
73
85
|
autorag health
|
|
74
86
|
autorag refresh
|
|
75
|
-
autorag refresh --method bm25,minsync
|
|
87
|
+
autorag refresh --method bm25,minsync,jikji
|
|
76
88
|
autorag watch --once
|
|
77
89
|
autorag watch
|
|
78
90
|
autorag refresh --force
|
|
@@ -81,69 +93,20 @@ autorag index reset --method bm25 --yes
|
|
|
81
93
|
autorag memory inspect
|
|
82
94
|
```
|
|
83
95
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
refresh/index run; when omitted all methods run. BM25 and MinSync are enabled
|
|
90
|
-
by default — no explicit configuration is needed for standard lexical + semantic
|
|
91
|
-
retrieval. MinSync uses a pre-installed binary (`autoInstall: false`); configure
|
|
92
|
-
`minSync.embedder` via `autorag init --embedder-*` flags for remote embedding.
|
|
93
|
-
|
|
94
|
-
### Keep indexes fresh on a schedule (agent responsibility)
|
|
95
|
-
|
|
96
|
-
There is **no always-on network service** in the CLI. Agents and operators must
|
|
97
|
-
install an OS-appropriate periodic job that runs a model-free index tick:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# Preferred scheduled command (single non-daemon refresh)
|
|
101
|
-
NODE_OPTIONS=--max-old-space-size=16384 autorag watch --once
|
|
102
|
-
# Equivalent one-shot refresh
|
|
103
|
-
NODE_OPTIONS=--max-old-space-size=16384 autorag refresh
|
|
104
|
-
```
|
|
96
|
+
Prefer a full refresh so parsed mirrors, BM25, MinSync, Jikji, and configured
|
|
97
|
+
datasources stay aligned. Use `--method` only for deliberate narrowing.
|
|
98
|
+
Scheduled maintenance should use non-daemon `autorag watch --once`, typically
|
|
99
|
+
every 15–30 minutes, with the same config used by search and no overlapping
|
|
100
|
+
runs.
|
|
105
101
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
| OS | Preferred scheduler | Pattern |
|
|
110
|
-
|---|---|---|
|
|
111
|
-
| macOS | `cron` or `launchd` (`~/Library/LaunchAgents`) | `*/30 * * * * ... autorag watch --once` or a KeepAlive=false StartInterval plist |
|
|
112
|
-
| Linux | `cron` / `systemd --user` timer | crontab `*/30 * * * *` or a oneshot service + timer |
|
|
113
|
-
| Windows | Task Scheduler | repeating task every 30 minutes running `autorag watch --once` under the user profile |
|
|
114
|
-
|
|
115
|
-
Rules for scheduled watch:
|
|
116
|
-
|
|
117
|
-
1. Prefer `autorag watch --once` (or `autorag refresh`) over a permanent
|
|
118
|
-
long-running `autorag watch` daemon in user agents — daemons die on reboot
|
|
119
|
-
and are harder to supervise from skill workflows.
|
|
120
|
-
2. Use the same config the search path uses (`~/.autorag/config.json` or an
|
|
121
|
-
explicit `--config` / `AUTORAG_CONFIG`).
|
|
122
|
-
3. Raise Node heap for large home trees: `NODE_OPTIONS=--max-old-space-size=16384`.
|
|
123
|
-
4. Redirect logs somewhere under the home/user temp tree, never into source
|
|
124
|
-
document folders.
|
|
125
|
-
5. After install/setup, **create or verify** the scheduled job before claiming
|
|
126
|
-
ongoing indexing is covered. Re-check with `crontab -l`, `systemctl --user list-timers`,
|
|
127
|
-
or Task Scheduler inspection when the user asks about freshness.
|
|
128
|
-
6. Do not schedule concurrent overlapping ticks; if a prior refresh is still
|
|
129
|
-
running, skip or wait (lock/log rather than stampeding MiniSync/BM25 writers).
|
|
130
|
-
|
|
131
|
-
Destructive index commands:
|
|
132
|
-
|
|
133
|
-
- `autorag index reset --yes` removes parsed, BM25, and MinSync directories under
|
|
134
|
-
workspace `.autorag` only. Add `--method bm25|minsync|parsed` to scope which
|
|
135
|
-
indexes are removed (e.g. `--method bm25` removes only the BM25 index).
|
|
136
|
-
- `autorag index rebuild --yes` resets those indexes then forced-refreshes.
|
|
137
|
-
`--method` scopes both the reset and the rebuild refresh.
|
|
138
|
-
|
|
139
|
-
Never run reset/rebuild against source documents. `memory inspect` is
|
|
140
|
-
read-only and path-opaque.
|
|
102
|
+
Reset and rebuild commands remove only selected workspace `.autorag` indexes.
|
|
103
|
+
Never target source documents. `memory inspect` is read-only and path-opaque.
|
|
141
104
|
|
|
142
105
|
## Rules
|
|
143
106
|
|
|
144
107
|
- Use only configured and approved search paths.
|
|
145
108
|
- Never expose provider credentials or authentication payloads.
|
|
146
|
-
- Never invent or reveal private provider names or model
|
|
147
|
-
-
|
|
109
|
+
- Never invent or reveal private provider names or model ids.
|
|
110
|
+
- A Pi-usable subscription is valid; a subscription Pi cannot invoke is not.
|
|
148
111
|
- Preserve real source mapping and numbered feedback identifiers.
|
|
149
|
-
- Prefer `--json` when another agent
|
|
112
|
+
- Prefer `--json` when another agent consumes the response.
|