@autorag/librarian 2.5.1 → 2.5.3
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 +3 -0
- package/README.md +230 -490
- package/dist/agent/agent.d.ts +40 -3
- package/dist/agent/index.d.ts +1 -1
- package/dist/agent/search-single-datasource-tool.d.ts +63 -0
- package/dist/agent/web-fetch-tool.d.ts +32 -0
- package/dist/agent/web-search-tool.d.ts +48 -0
- package/dist/cli/commands/lite-retrieve.d.ts +15 -0
- package/dist/cli/commands/search.d.ts +6 -0
- package/dist/cli/config.d.ts +20 -0
- package/dist/cli/index.js +17643 -10464
- package/dist/core.d.ts +3 -1
- package/dist/core.js +11081 -3945
- package/dist/datasource/connector-skill.d.ts +6 -0
- package/dist/datasource/crawler-skill.d.ts +2 -0
- package/dist/datasource/errors.d.ts +26 -0
- package/dist/datasource/index.d.ts +3 -2
- package/dist/datasource/skills/discrawl/skill.d.ts +1 -1
- package/dist/datasource/skills/discrawl/types.d.ts +2 -2
- package/dist/datasource/skills/github-gist/connector.d.ts +38 -0
- package/dist/datasource/skills/github-gist/index.d.ts +3 -0
- package/dist/datasource/skills/github-gist/semantic.d.ts +102 -0
- package/dist/datasource/skills/github-gist/skill.d.ts +39 -0
- package/dist/datasource/skills/lark/client.d.ts +23 -0
- package/dist/datasource/skills/lark/index.d.ts +2 -0
- package/dist/datasource/skills/lark/skill.d.ts +36 -0
- package/dist/datasource/skills/lazykatok/client.d.ts +28 -0
- package/dist/datasource/skills/lazykatok/index.d.ts +12 -0
- package/dist/datasource/skills/{katok → lazykatok}/methods.d.ts +12 -12
- package/dist/datasource/skills/lazykatok/paths.d.ts +40 -0
- package/dist/datasource/skills/{katok → lazykatok}/skill.d.ts +10 -10
- package/dist/datasource/skills/lazykatok/types.d.ts +134 -0
- package/dist/datasource/skills/mailcrawl/client.d.ts +2 -0
- package/dist/datasource/skills/mailcrawl/types.d.ts +12 -0
- package/dist/datasource/skills/slack/index.d.ts +8 -0
- package/dist/datasource/tool-naming.d.ts +11 -0
- package/dist/datasource/types.d.ts +4 -4
- package/dist/embedding-runtime/manifest.d.ts +8 -0
- package/dist/embedding-runtime/types.d.ts +4 -0
- package/dist/index.js +11598 -4461
- package/dist/minsync/types.d.ts +7 -0
- package/dist/process/terminate-tree.d.ts +2 -0
- package/dist/retrieval/engine.d.ts +14 -5
- package/dist/retrieval/index.d.ts +2 -1
- package/dist/retrieval/merger.d.ts +30 -5
- package/dist/retrieval/skip.d.ts +41 -0
- package/dist/retrieval/types.d.ts +24 -3
- package/dist/web/entities.d.ts +10 -0
- package/dist/web/fetch/convert.d.ts +35 -0
- package/dist/web/fetch/feeds.d.ts +37 -0
- package/dist/web/fetch/html-renderer.d.ts +54 -0
- package/dist/web/fetch/index.d.ts +12 -0
- package/dist/web/fetch/negotiate.d.ts +27 -0
- package/dist/web/fetch/page-loader.d.ts +60 -0
- package/dist/web/fetch/render.d.ts +23 -0
- package/dist/web/fetch/turndown/gfm.d.ts +11 -0
- package/dist/web/fetch/turndown/html.d.ts +5 -0
- package/dist/web/fetch/turndown/index.d.ts +10 -0
- package/dist/web/fetch/turndown/service.d.ts +21 -0
- package/dist/web/fetch/turndown/types.d.ts +73 -0
- package/dist/web/fetch/url-target.d.ts +29 -0
- package/dist/web/search/browser-headers.d.ts +17 -0
- package/dist/web/search/browser-loader.d.ts +56 -0
- package/dist/web/search/browser-page.d.ts +41 -0
- package/dist/web/search/credentials.d.ts +10 -0
- package/dist/web/search/format.d.ts +30 -0
- package/dist/web/search/index.d.ts +46 -0
- package/dist/web/search/model-auth.d.ts +36 -0
- package/dist/web/search/provider.d.ts +62 -0
- package/dist/web/search/providers/anthropic.d.ts +9 -0
- package/dist/web/search/providers/base.d.ts +106 -0
- package/dist/web/search/providers/codex.d.ts +9 -0
- package/dist/web/search/providers/duckduckgo.d.ts +22 -0
- package/dist/web/search/providers/ecosia.d.ts +29 -0
- package/dist/web/search/providers/gemini.d.ts +9 -0
- package/dist/web/search/providers/google.d.ts +22 -0
- package/dist/web/search/providers/mojeek.d.ts +24 -0
- package/dist/web/search/providers/parallel.d.ts +10 -0
- package/dist/web/search/providers/perplexity.d.ts +10 -0
- package/dist/web/search/providers/public.d.ts +15 -0
- package/dist/web/search/providers/responses-api.d.ts +26 -0
- package/dist/web/search/providers/searxng.d.ts +19 -0
- package/dist/web/search/providers/startpage.d.ts +25 -0
- package/dist/web/search/providers/utils.d.ts +39 -0
- package/dist/web/search/providers/xai.d.ts +9 -0
- package/dist/web/search/query.d.ts +193 -0
- package/dist/web/search/types.d.ts +198 -0
- package/dist/web/search/utils.d.ts +8 -0
- package/licenses/embedding-assets.json +20 -4
- package/package.json +2 -1
- package/skills/autorag/SKILL.md +2 -1
- package/skills/autorag-doctor/SKILL.md +238 -0
- package/skills/autorag-lite-search/SKILL.md +29 -7
- package/skills/autorag-lite-setup/SKILL.md +22 -15
- package/skills/autorag-setup/SKILL.md +40 -19
- package/dist/agent/search-datasource-tool.d.ts +0 -29
- package/dist/datasource/skills/katok/client.d.ts +0 -21
- package/dist/datasource/skills/katok/index.d.ts +0 -12
- package/dist/datasource/skills/katok/paths.d.ts +0 -40
- package/dist/datasource/skills/katok/types.d.ts +0 -123
package/README.md
CHANGED
|
@@ -1,591 +1,331 @@
|
|
|
1
|
-
# AutoRAG
|
|
1
|
+
# AutoRAG Agent
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**Now your agent can find anything in your computer.**
|
|
4
|
+
|
|
5
|
+
<p align="left">
|
|
6
|
+
<a href="https://www.npmjs.com/package/@autorag/librarian"><img src="https://img.shields.io/npm/v/@autorag/librarian.svg?style=flat-square&color=38bdf8" alt="npm version" /></a>
|
|
7
|
+
<a href="https://www.npmjs.com/package/@autorag/librarian"><img src="https://img.shields.io/npm/dm/@autorag/librarian.svg?style=flat-square&color=818cf8" alt="npm downloads" /></a>
|
|
8
|
+
<a href="https://github.com/Marker-Inc-Korea/AutoRAG/stargazers"><img src="https://img.shields.io/github/stars/Marker-Inc-Korea/AutoRAG?style=flat-square&logo=github&color=f59e0b" alt="GitHub stars" /></a>
|
|
9
|
+
<a href="https://github.com/Marker-Inc-Korea/AutoRAG/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/Marker-Inc-Korea/AutoRAG/ci.yml?branch=main&label=CI&style=flat-square" alt="CI Status" /></a>
|
|
10
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat-square" alt="License: MIT" /></a>
|
|
11
|
+
<img src="https://img.shields.io/badge/node-%3E%3D24.0.0-informational.svg?style=flat-square" alt="Node >= 24" />
|
|
12
|
+
<img src="https://img.shields.io/badge/bun-%3E%3D1.2-black.svg?style=flat-square&logo=bun" alt="Bun >= 1.2" />
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<img src="assets/autorag-agent-social-preview.png" alt="AutoRAG Agent" width="100%" />
|
|
17
|
+
</p>
|
|
4
18
|
|
|
5
19
|
> [!IMPORTANT]
|
|
6
20
|
> **Looking for the original AutoRAG (RAG AutoML / pipeline optimization tool)?**
|
|
7
21
|
> This repository now hosts **AutoRAG 2.0**, a complete reimagining of AutoRAG as a self-evolving librarian agent. The original Python-based AutoRAG — the RAG AutoML tool for automatically finding an optimal RAG pipeline for your data — now lives in the [`legacy/`](legacy/) directory of this repository.
|
|
8
22
|
>
|
|
9
|
-
> **The legacy AutoRAG is NOT abandoned.** It continues to be maintained (bug fixes, dependency updates, and PyPI releases via `pip install AutoRAG`) in maintenance mode. Existing users can keep using it exactly as before — see the [legacy README](legacy/README.md) for its documentation, and file issues in this repository as usual. New feature development is focused on AutoRAG 2.0.
|
|
23
|
+
> **The legacy AutoRAG is NOT abandoned.** It continues to be maintained (bug fixes, dependency updates, and PyPI releases via `pip install AutoRAG`) in maintenance mode. Existing users can keep using it exactly as before — see the [legacy README](legacy/README.md) for its documentation, and file issues in this repository as usual. New feature development is focused on AutoRAG Agent (2.0).
|
|
10
24
|
|
|
11
|
-
|
|
25
|
+
---
|
|
12
26
|
|
|
13
|
-
|
|
27
|
+
## What is AutoRAG Agent?
|
|
14
28
|
|
|
15
|
-
|
|
16
|
-
model roles. You configure one model, and that model owns the complete
|
|
17
|
-
retrieval, reading, judgment, and curation loop.
|
|
29
|
+
Search tools dump file paths and matching lines — forcing you to open files, read context, and synthesize answers yourself.
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
**AutoRAG Agent is a self-evolving librarian agent.** Built on the [Pi](https://github.com/earendil-works/pi-mono) agent framework, a single configured model searches across multiple retrieval methods, opens source documents directly via `bash` to verify ground truth, and curates answers into clean, numbered knowledge units:
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
1. **Never migrate your data to search it.** AutoRAG federates CLI-owned
|
|
24
|
-
stores (katok, discrawl, qmd, msgvault, rclone, …) in place. No forced
|
|
25
|
-
ingestion into a central index, no third-party server holding a copy of
|
|
26
|
-
your corpus. Results carry source-native identities
|
|
27
|
-
(`/kakao/<instance>/chunks/<chunk>`) with scope-checked access — see the
|
|
28
|
-
[competitive landscape study](docs/competitive-landscape-2026-09.md) for
|
|
29
|
-
why this is the durable differentiator.
|
|
30
|
-
2. **Just works — no RAG degree required.** Install it and it works: minimal
|
|
31
|
-
configuration, no pipeline tuning, no vector-DB operations, no API keys.
|
|
32
|
-
The local embedder (EmbeddingGemma via Ollama) and MinSync auto-install
|
|
33
|
-
handle the "RAG plumbing" invisibly.
|
|
34
|
-
3. **Fast by design.** One configured model owns the whole loop; retrieval
|
|
35
|
-
runs locally over MinSync CDC chunks (BM25 / vector / hybrid); interactive
|
|
36
|
-
search is optimized for low latency.
|
|
33
|
+
```text
|
|
34
|
+
You ask: "What changes were made to the cloud infrastructure contract in Q3?"
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
AutoRAG Agent:
|
|
37
|
+
[1] Enterprise Compute Discount — AWS annual discount tier increased to 28% based on commitment volume. (contracts/cloud-2026.pdf:p.4)
|
|
38
|
+
[2] Regional Data Residency — Explicit compliance clause pinning customer data storage to the Seoul AWS region. (/slack/legal-ops/chunks/318)
|
|
39
|
+
[3] SLA Guarantee — Guaranteed uptime threshold adjusted to 99.95% with penalty credits starting at 15 minutes downtime. (contracts/sla-addendum.md:lines 45-62)
|
|
40
|
+
```
|
|
39
41
|
|
|
40
|
-
|
|
42
|
+
---
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
- Open each file
|
|
44
|
-
- Read the surrounding context
|
|
45
|
-
- Decide what's relevant
|
|
46
|
-
- Synthesize an answer
|
|
47
|
-
- Remember what worked for next time
|
|
44
|
+
## Core Values
|
|
48
45
|
|
|
49
|
-
|
|
46
|
+
<p align="center">
|
|
47
|
+
<img src="assets/autorag-agent-principles.png" alt="AutoRAG Agent Core Principles" width="100%" />
|
|
48
|
+
</p>
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
Three principles drive every design decision in AutoRAG Agent:
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
1. **Never migrate your data to search it.** Traditional RAG systems force you to upload, ETL, and duplicate your files into a centralized vector database. AutoRAG Agent federates your data **in place**, querying CLI-native stores (`lazykatok`, `discrawl`, `slacrawl`, `mailcrawl`, `rclone`, `qmd`) where your data already lives. Results retain opaque, source-native identities (`/kakao/...`, `/slack/...`) that preserve local access control and privacy. *(See our [Competitive Landscape Study](docs/competitive-landscape-2026-09.md) on why in-place federation is the durable differentiator).*
|
|
54
53
|
|
|
55
|
-
|
|
56
|
-
You ask: "What were the key findings in the Q3 report?"
|
|
54
|
+
2. **Just works — no RAG degree required.** No pipeline tuning, no vector-DB maintenance, and no remote embedding API keys. AutoRAG Agent automatically manages [MinSync](docs/minsync-setup.md) for incremental Change Data Capture (CDC) chunking and provides a local [embedding gateway](docs/embedding-runtime.md) out of the box with zero external telemetry.
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
[1] Revenue grew 23% YoY to $4.2M, driven by enterprise contracts. (pages 3-5)
|
|
60
|
-
[2] Three new risk factors: supply chain, regulatory, talent retention. (pages 12-14)
|
|
61
|
-
[3] Headcount target missed by 12 — engineering hiring bottleneck. (page 8)
|
|
62
|
-
```
|
|
56
|
+
3. **Fast by design.** Rather than coordinating slow multi-agent hierarchies, a single configured model owns the entire retrieval, direct-read, and curation loop. Local CDC chunks (BM25, vector, and hybrid modes) deliver rapid, low-latency turnaround across multi-turn research queries.
|
|
63
57
|
|
|
64
|
-
|
|
58
|
+
---
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
## Architecture & How It Works
|
|
67
61
|
|
|
68
|
-
AutoRAG
|
|
62
|
+
AutoRAG Agent orchestrates five integrated subsystems:
|
|
69
63
|
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
-
|
|
64
|
+
1. **Self-Evolving Memory System (`check_memory`):** Before querying, the agent consults historical outcomes stored in `~/.autorag/memory.json` to prioritize retrieval methods that have proven successful for similar queries.
|
|
65
|
+
2. **Pluggable Multi-Method Retrieval:**
|
|
66
|
+
- **BM25 Lexical Search:** Fast keyword ranking via MinSync over parsed markdown mirrors.
|
|
67
|
+
- **Semantic Vector Search:** Dense vector retrieval over CDC chunks via the built-in embedding gateway.
|
|
68
|
+
- **Hybrid Search:** Combines BM25 and vector ranking via Reciprocal Rank Fusion (RRF).
|
|
69
|
+
- **Jikji Find-First Discovery:** Local CLI-backed fast discovery answer packs.
|
|
70
|
+
- **Datasource Skills:** Server-authorized federated retrieval across external applications.
|
|
71
|
+
3. **Result Merger & Scoped Access Gate:** Cross-method deduplication, score normalization, and default-deny permission checks.
|
|
72
|
+
4. **Direct Evidence Reading (`bash`):** The agent directly opens and inspects promising files with `cat`, `grep`, or `find` to verify facts against ground truth.
|
|
73
|
+
5. **Curation & Active Feedback:** Structured findings are returned via `emit_autorag_results`. When callers provide feedback on which items were useful, AutoRAG records this to optimize future queries.
|
|
73
74
|
|
|
74
|
-
|
|
75
|
+
---
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
## 🤖 For AI Agents & LLMs: Setup & Skills
|
|
77
78
|
|
|
78
|
-
|
|
79
|
+
If you are an AI coding agent or LLM (Claude Code, Cursor, Windsurf, Codex, Senpi, Pi, etc.) tasked with installing, configuring, or querying AutoRAG Agent, use our built-in skills located in the [`skills/`](skills/) directory:
|
|
79
80
|
|
|
80
|
-
|
|
|
81
|
+
| Skill | Directory | When to Use |
|
|
81
82
|
|---|---|---|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
83
|
+
| **`autorag`** | [`skills/autorag/`](skills/autorag/SKILL.md) | Querying, searching, comparing, and summarizing documents with an already configured AutoRAG librarian. |
|
|
84
|
+
| **`autorag-setup`** | [`skills/autorag-setup/`](skills/autorag-setup/SKILL.md) | Installing AutoRAG, configuring models, adding document roots/datasources, running health checks, and repairing indexes. |
|
|
85
|
+
| **`autorag-lite-setup`** | [`skills/autorag-lite-setup/`](skills/autorag-lite-setup/SKILL.md) | Initializing and maintaining the model-free AutoRAG Lite lifecycle without an LLM. |
|
|
86
|
+
| **`autorag-lite-search`** | [`skills/autorag-lite-search/`](skills/autorag-lite-search/SKILL.md) | Performing model-free retrieval, reporting evidence, and recording feedback without an LLM. |
|
|
87
|
+
|
|
88
|
+
### Quick Agent Workflow
|
|
89
|
+
|
|
90
|
+
1. **Install CLI:**
|
|
91
|
+
```bash
|
|
92
|
+
command -v autorag >/dev/null || bun install -g @autorag/librarian
|
|
93
|
+
```
|
|
94
|
+
2. **Inspect & Preflight:**
|
|
95
|
+
```bash
|
|
96
|
+
autorag status --json # check corpus freshness and index readiness
|
|
97
|
+
autorag duplicates --json # scan for exact or near-duplicate document families
|
|
98
|
+
```
|
|
99
|
+
3. **Perform Curated Search:**
|
|
100
|
+
```bash
|
|
101
|
+
autorag search "your question" --json
|
|
102
|
+
```
|
|
103
|
+
4. **Safety Guidelines for Agents:**
|
|
104
|
+
- **Never delete, move, or modify original user documents.**
|
|
105
|
+
- AutoRAG writes index artifacts strictly into `<workspace>/.autorag/` and `.jikji/` caches.
|
|
106
|
+
- Never print or leak API keys, tokens, or credential values into stdout or logs.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## ⚡ AutoRAG Lite: Model-Free Retrieval Engine
|
|
111
|
+
|
|
112
|
+
Need blazing fast local search without configuring an LLM or paying for API tokens? Use **AutoRAG Lite**.
|
|
113
|
+
|
|
114
|
+
AutoRAG Lite provides the exact same high-performance indexing, BM25 ranking, and local MinSync vector/hybrid retrieval engine as the full librarian, but **runs 100% model-free**:
|
|
115
|
+
|
|
116
|
+
- **Zero LLM Token Usage:** Run purely local BM25 and vector search offline.
|
|
117
|
+
- **Agent Integration Ready:** Use `autorag lite retrieve` inside your own agentic workflows to supply raw context chunks to an external model.
|
|
118
|
+
- **Fast Local CLI:** Instant responses directly from your terminal.
|
|
86
119
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
See [docs/minsync-setup.md](docs/minsync-setup.md) for automatic installation,
|
|
92
|
-
managed binary paths, and the local EmbeddingGemma QA flow.
|
|
93
|
-
|
|
94
|
-
### Real directory access
|
|
95
|
-
|
|
96
|
-
AutoRAG reads configured source directories directly through its built-in `bash` tool. Retrieval tools can supply candidate paths, but the same agent opens the source material before curating. Answers are returned as a structured `SearchDocumentsResponse`; results carry their real source (file path or datasource id) in the internal mapping for feedback and curation. MinSync indexes parsed markdown mirrors under `.autorag` for BM25, vector, and hybrid retrieval.
|
|
97
|
-
|
|
98
|
-
### Thin PDF extraction retry
|
|
120
|
+
```bash
|
|
121
|
+
# Initialize a model-free workspace
|
|
122
|
+
autorag lite init --search-paths ./documents
|
|
99
123
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
than 40 characters per detected page, for at least three pages), it retries
|
|
103
|
-
through OpenDataLoader's `docling-fast` hybrid backend with `hybridMode:
|
|
104
|
-
"auto"` and a 30-second timeout. Dense PDFs are not retried, and hybrid is
|
|
105
|
-
never used for single-page PDFs or as the first path for images.
|
|
124
|
+
# Index local files and datasources
|
|
125
|
+
autorag lite refresh
|
|
106
126
|
|
|
107
|
-
|
|
108
|
-
|
|
127
|
+
# Retrieve ranked document chunks (returns JSON candidates with scores)
|
|
128
|
+
autorag lite retrieve "compliance policy exception process" --top-k 5 --json
|
|
109
129
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
searchPaths: ["/path/to/documents"],
|
|
113
|
-
parserOptions: {
|
|
114
|
-
thinExtract: {
|
|
115
|
-
minPages: 3,
|
|
116
|
-
minChars: 800,
|
|
117
|
-
minCharsPerPage: 40,
|
|
118
|
-
timeoutMs: 30_000,
|
|
119
|
-
hybrid: "docling-fast",
|
|
120
|
-
hybridMode: "auto",
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
});
|
|
130
|
+
# Check index status and freshness
|
|
131
|
+
autorag lite status
|
|
124
132
|
```
|
|
125
133
|
|
|
126
|
-
|
|
127
|
-
markdown and emits `pdf-extract-thin` plus `pdf-hybrid-unavailable`
|
|
128
|
-
diagnostics; refresh remains successful.
|
|
134
|
+
---
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
## 🔌 Supported Datasources
|
|
131
137
|
|
|
132
|
-
AutoRAG
|
|
138
|
+
AutoRAG Agent connects to external tools and communication platforms using dedicated datasource skills. Data remains in each tool's native store — AutoRAG does not copy or ingest foreign databases into a centralized store:
|
|
133
139
|
|
|
134
|
-
|
|
140
|
+
| Datasource | Skill Alias | Backend / Driver | Storage & Privacy Model | Search Capabilities |
|
|
141
|
+
|---|---|---|---|---|
|
|
142
|
+
| **Local Documents** | `local` | Native filesystem & MinSync | Workspace-local parsed mirrors (`.autorag/`) | BM25, Semantic, Hybrid |
|
|
143
|
+
| **KakaoTalk** | `kakao` | [`lazykatok`](https://github.com/changeroa/lazykatok) CLI | Native KakaoTalk archive; zero direct DB access | BM25, Semantic, Hybrid |
|
|
144
|
+
| **Discord** | `discord` | [`discrawl`](https://github.com/openclaw/discrawl) CLI | Native SQLite archive; token-free wiretap mode | BM25, Semantic, Hybrid |
|
|
145
|
+
| **WhatsApp** | `whatsapp` | [`wacrawl`](https://github.com/openclaw/wacrawl) CLI | Local-first incremental archive + FTS5 | Lexical FTS5 |
|
|
146
|
+
| **Telegram** | `telegram` | [`telecrawl`](https://github.com/openclaw/telecrawl) CLI | Local-first desktop archive + FTS5 | Lexical FTS5 |
|
|
147
|
+
| **Slack** | `slack` | [`slacrawl`](https://github.com/openclaw/slacrawl) CLI | Local workspace/channel/thread archive + FTS5 | Lexical FTS5 |
|
|
148
|
+
| **Notion** | `notion` | [`notcrawl`](https://github.com/openclaw/notcrawl) CLI | Local page/database/block archive + FTS5 | Lexical FTS5 |
|
|
149
|
+
| **Email Archives** | `mailcrawl` | [`mailcrawl`](https://github.com/NomaDamas/mailcrawl) CLI | Local Gmail, IMAP, and Maildir storage | BM25, Semantic, Hybrid |
|
|
150
|
+
| **Local Mail Export**| `mail-export` | Built-in `.mbox` / `.eml` parser | Local filesystem mailboxes | Lexical |
|
|
151
|
+
| **Obsidian Vaults** | `obsidian` | [`qmd`](https://github.com/tobi/qmd) CLI | Direct markdown vault indexing | BM25, Semantic |
|
|
152
|
+
| **GitHub** | `github` | GitHub REST API | In-memory fetched Issues and Pull Requests | Lexical, Scoped |
|
|
153
|
+
| **Cloud Drives** | `cloud-drive` | [`rclone`](https://rclone.org) CLI | Google Drive (Tier-1), OneDrive, Dropbox, etc. | Incremental Mirror + BM25 |
|
|
154
|
+
| **Photos & Shots** | `clawgallery` | `clawgallery` CLI | Local screenshot and photo store | Hybrid OCR/Visual Search |
|
|
155
|
+
| **RSS / News** | `rss` | Native HTTP Poller | RSS 2.0 & Atom feeds (24h deduplication) | Lexical |
|
|
156
|
+
| **macOS Spotlight** | `spotlight` | Native `mdfind` CLI | macOS system metadata and content index | System Native |
|
|
135
157
|
|
|
136
|
-
|
|
158
|
+
For configuration syntax and connector details, see [docs/datasource-skills.md](docs/datasource-skills.md).
|
|
137
159
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
const agent = new AutoRAGAgent({
|
|
142
|
-
searchPaths: ["/path/to/documents"],
|
|
143
|
-
});
|
|
144
|
-
await agent.prepareJikji();
|
|
145
|
-
```
|
|
160
|
+
---
|
|
146
161
|
|
|
147
|
-
|
|
162
|
+
## Installation & Setup
|
|
148
163
|
|
|
149
|
-
AutoRAG
|
|
150
|
-
to detect exact, near, and containment document families.
|
|
164
|
+
AutoRAG Agent is published as `@autorag/librarian` (requires Node.js ≥ 24 or Bun):
|
|
151
165
|
|
|
152
166
|
```bash
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
The command is read-only: it reports exact duplicate groups and review
|
|
158
|
-
guidance, but never moves or deletes source files. The `scan_duplicate_documents`
|
|
159
|
-
Agent tool exposes the same read-only scan to the orchestrator.
|
|
160
|
-
|
|
161
|
-
Exact duplicate exclusion is enabled by default during parsed-mirror refresh.
|
|
162
|
-
For each exact canonical-text hash, the newest filesystem copy is indexed and
|
|
163
|
-
older copies are omitted. Disable it in `config.json` when both copies must be
|
|
164
|
-
searchable:
|
|
167
|
+
# Install CLI globally
|
|
168
|
+
bun install -g @autorag/librarian
|
|
169
|
+
# or with npm:
|
|
170
|
+
npm install -g @autorag/librarian
|
|
165
171
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
"dupey": { "enabled": true },
|
|
169
|
-
"excludeExactDuplicates": false
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
If `dupey` is not installed or fails, refresh continues without exclusion and
|
|
174
|
-
reports no destructive action; install it with `cargo install dupey`.
|
|
175
|
-
|
|
176
|
-
The same configuration shape customizes Jikji when needed:
|
|
177
|
-
|
|
178
|
-
```json
|
|
179
|
-
{
|
|
180
|
-
"enabled": true,
|
|
181
|
-
"binaryPath": "jikji",
|
|
182
|
-
"timeoutMs": 10000,
|
|
183
|
-
"maxBufferBytes": 1048576,
|
|
184
|
-
"includeHidden": false,
|
|
185
|
-
"includeSensitive": false,
|
|
186
|
-
"maxFiles": 0,
|
|
187
|
-
"writeAgentRules": false,
|
|
188
|
-
"enableMediaIndex": false,
|
|
189
|
-
"exclude": []
|
|
190
|
-
}
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
Call `agent.prepareJikji()` (or `agent.refresh()`) to prepare configured source roots. Hidden files, sensitive files, and media indexing are disabled by default; AutoRAG does not pass `--include-hidden`, `--include-sensitive`, or `--enable-media-index` unless the corresponding option is `true`. AutoRAG-managed prepare runs with `--no-agent-rules` by default, so it never rewrites the consumer repo's `AGENTS.md`/`CLAUDE.md`/`.cursorrules`; an explicit `writeAgentRules: true` opt-in re-enables upstream routing-block injection. AutoRAG passes `--enable-media-index` only when `enableMediaIndex: true`.
|
|
194
|
-
|
|
195
|
-
The upstream Rust `PrepareArgs` defines reference defaults that AutoRAG does not override unless explicitly configured: parse timeout `5.0`, max hash bytes `512 MiB`, doc text max chars `2,000,000`, doc text chunk chars `1,000,000`, and media index max MB `25.0`. AutoRAG emits `--parse-timeout`, `--max-hash-bytes`, `--doc-text-max-chars`, `--doc-text-chunk-chars`, and `--media-index-max-mb` only when the matching option is set, so the upstream defaults apply otherwise. AutoRAG answers queries through `jikji find` (find-first) plus the Pi agent loop and its registered retrieval methods; `prepare`/`refresh` are indexing-only.
|
|
196
|
-
|
|
197
|
-
### Datasource skills
|
|
198
|
-
|
|
199
|
-
Datasource skills let AutoRAG search external, server-configured data sources through the same retrieval pipeline as local documents. A skill describes what it indexes, how it should be refreshed, what source instances exist, and which permission tags/scopes bound access. Retrieval still flows through `RetrievalMethodRegistry` → `ParallelRetriever` → datasource result filtering → `ResultMerger`; datasource skills do not create a parallel search path.
|
|
200
|
-
|
|
201
|
-
Every datasource can be registered multiple times through a connection alias:
|
|
202
|
-
use the config key as the unique name and set `type` to the reusable backend
|
|
203
|
-
(`mailcrawl`, `github`, `slack`, `discord`, `kakao`, `cloud-drive`, and so on).
|
|
204
|
-
Each alias becomes an independently loadable agent skill with its own source
|
|
205
|
-
scope and workspace namespace. Chat aliases search all channels by default;
|
|
206
|
-
trusted `channels.ids` / `channels.names` allowlists can expose a particular
|
|
207
|
-
channel or group chat as its own datasource.
|
|
208
|
-
|
|
209
|
-
Security defaults are intentionally strict:
|
|
210
|
-
|
|
211
|
-
- datasource access is default-deny unless trusted server/API configuration supplies `datasourceAccess.allowedTags`; `allowedScopes` applies only to datasource methods that advertise the `scoped` capability;
|
|
212
|
-
- model/tool arguments never grant datasource tags or scopes;
|
|
213
|
-
- `search_datasource_documents` accepts only `{ query, topK?, scope? }`, and `scope` can only narrow trusted access.
|
|
214
|
-
|
|
215
|
-
#### Supported datasources
|
|
216
|
-
|
|
217
|
-
| Datasource | Skill | Connects via | Notes |
|
|
218
|
-
|---|---|---|---|
|
|
219
|
-
| KakaoTalk | `katok` | external [`katok`](https://github.com/NomaDamas/katok) CLI | first datasource skill; AutoRAG never reads KakaoTalk databases directly |
|
|
220
|
-
| WhatsApp | `whatsapp` | external [`wacrawl`](https://github.com/openclaw/wacrawl) CLI | local-first incremental archive + FTS5 search; live desktop ingestion is macOS-only |
|
|
221
|
-
| Telegram | `telegram` | external [`telecrawl`](https://github.com/openclaw/telecrawl) CLI | local-first archive + FTS5 search; live desktop ingestion is macOS-only |
|
|
222
|
-
| Slack | `slack` | external [`slacrawl`](https://github.com/openclaw/slacrawl) CLI | local-first workspace/channel/thread archive + FTS5 search |
|
|
223
|
-
| Discord | `discord` | external [`discrawl`](https://github.com/openclaw/discrawl) CLI | guild/channel/thread/DM archive; FTS5 + semantic + hybrid retrieval, incremental sync |
|
|
224
|
-
| Notion | `notion` | external [`notcrawl`](https://github.com/openclaw/notcrawl) CLI | local-first page/database/block archive + FTS5 search |
|
|
225
|
-
| GitHub Issues/PRs | `github` | GitHub REST (token optional) | issues + PR bodies per `owner/repo`; public repos work unauthenticated |
|
|
226
|
-
| Cloud drives | `cloud-drive` | **[`rclone`](https://rclone.org) CLI** | Incremental Google Drive Tier-1; OneDrive/network remotes; iCloud experimental |
|
|
227
|
-
| Local mail exports | `mail-export` | filesystem (`.mbox` / `.eml`) | classic `From_` splitting, mailparser-based; count-only warnings |
|
|
228
|
-
| Mail archives | `mailcrawl` | external [`mailcrawl`](https://github.com/NomaDamas/mailcrawl) CLI | local email sync plus BM25, semantic, and hybrid retrieval |
|
|
229
|
-
| Obsidian vault | `obsidian` | external [`qmd`](https://github.com/tobi/qmd) CLI | incremental `qmd update`, BM25 `qmd search`, semantic `qmd vsearch`; vault path via `connector.vaultPath` |
|
|
230
|
-
| RSS / news | `rss` | HTTP feed polling | RSS 2.0 + Atom, feed/category hierarchy, 24h dedupe window |
|
|
231
|
-
| ClawGallery | `clawgallery` | external `clawgallery` CLI (`cargo install clawgallery`) | local screenshots and photos; incremental bootstrap + hybrid search |
|
|
232
|
-
| macOS Spotlight | `spotlight` | built-in `mdfind` | macOS only; no extra install; Full Disk Access for protected files |
|
|
233
|
-
|
|
234
|
-
Connector-backed skills fetch documents into AutoRAG's local chunk store. External-crawler skills such as KakaoTalk, WhatsApp, Telegram, Slack, and Notion leave incremental archive and FTS ownership with their CLI and map query results into the same retrieval pipeline. Obsidian uses the external `qmd` CLI (incremental update + BM25 + semantic). Tokens are referenced by environment variable name only, never stored in config. Process/API failures surface as path/PII-opaque diagnostics. See [docs/manual-qa-datasources.md](docs/manual-qa-datasources.md) for the QA harnesses.
|
|
235
|
-
|
|
236
|
-
Configure them in `config.json` (CLI) or pass `datasourceSkills` programmatically:
|
|
237
|
-
|
|
238
|
-
```jsonc
|
|
239
|
-
{
|
|
240
|
-
"datasources": {
|
|
241
|
-
"whatsapp": { "instanceId": "personal", "connector": { "binaryPath": "wacrawl" } },
|
|
242
|
-
"telegram": { "instanceId": "personal", "connector": { "binaryPath": "telecrawl" } },
|
|
243
|
-
"slack": { "connector": { "binaryPath": "slacrawl", "configPath": "/path/to/slacrawl.yaml", "syncSource": "primary" } },
|
|
244
|
-
"notion": { "connector": { "binaryPath": "notcrawl", "configPath": "/path/to/notcrawl.yaml" } },
|
|
245
|
-
"github": { "connector": { "repos": ["owner/repo"] } },
|
|
246
|
-
"mailcrawl": { "instanceId": "personal", "connector": { "account": "personal", "mailbox": "INBOX", "binaryPath": "mailcrawl" } },
|
|
247
|
-
"personal-google-drive": { "type": "cloud-drive", "instanceId": "personal", "connector": { "provider": "google-drive", "remote": "personal-gdrive:", "include": ["**/*.md"] } },
|
|
248
|
-
"company-onedrive": { "type": "cloud-drive", "instanceId": "work", "connector": { "provider": "onedrive", "remote": "company-onedrive:Documents" } },
|
|
249
|
-
"obsidian": { "connector": { "vaultPath": "/path/to/vault" } },
|
|
250
|
-
"rss": { "connector": { "feeds": [{ "url": "https://example.com/feed.xml" }] } }
|
|
251
|
-
},
|
|
252
|
-
"datasourceAccess": {
|
|
253
|
-
"allowedTags": ["whatsapp", "telegram", "slack", "notion", "github", "mailcrawl", "cloud-drive", "obsidian", "rss"],
|
|
254
|
-
"allowedScopes": ["/whatsapp/**", "/telegram/**", "/slack/**", "/notion/**", "/github/**", "/mailcrawl/**", "/personal-google-drive/**", "/company-onedrive/**", "/obsidian/**", "/rss/**"]
|
|
255
|
-
}
|
|
256
|
-
}
|
|
172
|
+
# Add as a TypeScript/JavaScript library
|
|
173
|
+
bun add @autorag/librarian
|
|
257
174
|
```
|
|
258
175
|
|
|
259
|
-
|
|
176
|
+
### System Prerequisites
|
|
260
177
|
|
|
261
|
-
|
|
178
|
+
- **Java 11 or newer:** Required for PDF parsing via `@opendataloader/pdf`. Check with `java -version`.
|
|
179
|
+
- **Rust Toolchain (Optional):** Automatically compiles Jikji (`jikji-cli`) if installed.
|
|
180
|
+
- **MinSync:** Automatically downloaded and installed into `<workspace>/.autorag/bin` on first run.
|
|
262
181
|
|
|
263
|
-
|
|
182
|
+
---
|
|
264
183
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
Install and configure [`mailcrawl`](https://github.com/NomaDamas/mailcrawl)
|
|
268
|
-
`@nomadamas/mailcrawl@0.1.6` or newer separately (0.1.4 is the minimum). AutoRAG invokes
|
|
269
|
-
`mailcrawl sync` followed by `mailcrawl index` during datasource refresh, then
|
|
270
|
-
calls `mailcrawl search` in BM25, semantic, or hybrid mode. The archive remains
|
|
271
|
-
in mailcrawl's native store unless the operator explicitly sets
|
|
272
|
-
`connector.dataDir`; Himalaya credentials and provider configuration remain
|
|
273
|
-
owned by mailcrawl. 0.1.3 and earlier fail a repeated
|
|
274
|
-
`index` after a no-op sync.
|
|
275
|
-
Use `mailcrawl` for Gmail, IMAP, and Maildir retrieval. The former Gmail REST
|
|
276
|
-
datasource and `gmail` + `backend: "himalaya"` connector are removed.
|
|
277
|
-
|
|
278
|
-
Install and authenticate rclone separately (`brew install rclone && rclone
|
|
279
|
-
config` on macOS), then configure the provider-neutral `cloud-drive` skill.
|
|
280
|
-
`cloud-drive` is a reusable `type`: each datasource config key is a connection
|
|
281
|
-
alias and becomes a separate agent skill and scope. Multiple Google accounts,
|
|
282
|
-
or Google Drive plus OneDrive/iCloud, can therefore be loaded and searched
|
|
283
|
-
independently.
|
|
284
|
-
AutoRAG inventories with `rclone lsjson`, keeps a workspace-local manifest and
|
|
285
|
-
managed mirror, and downloads only added or changed indexable files. Google
|
|
286
|
-
Drive is Tier-1. OneDrive, Dropbox, SMB/SFTP/WebDAV, and mounted drives share
|
|
287
|
-
the same manifest contract. iCloud Drive is experimental because rclone marks
|
|
288
|
-
that backend Tier 4 and Apple ID/2FA sessions periodically require
|
|
289
|
-
reauthentication. See [docs/datasource-skills.md](docs/datasource-skills.md)
|
|
290
|
-
for filtering, size, concurrency, bandwidth, dry-run, and agent tool-calling
|
|
291
|
-
details.
|
|
292
|
-
|
|
293
|
-
#### KakaoTalk (katok)
|
|
294
|
-
|
|
295
|
-
KakaoTalk was the first datasource skill. It uses the external [`katok`](https://github.com/NomaDamas/katok) CLI only — AutoRAG never reads KakaoTalk databases directly. `katok` failures return diagnostics instead of throwing, and remote embedding egress configuration is rejected before the CLI is spawned.
|
|
184
|
+
## Quick Start
|
|
296
185
|
|
|
297
|
-
|
|
298
|
-
import { AutoRAGAgent, KatokSkill } from "@autorag/librarian";
|
|
186
|
+
### 1. Initialize and Index
|
|
299
187
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
// Optional: client: new KatokClient({ binaryPath: "katok" })
|
|
304
|
-
});
|
|
188
|
+
```bash
|
|
189
|
+
# Initialize configuration for your documents folder
|
|
190
|
+
autorag init --search-paths ~/Documents/research
|
|
305
191
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
datasourceSkills: [kakao],
|
|
309
|
-
datasourceAccess: {
|
|
310
|
-
allowedTags: ["kakaotalk"],
|
|
311
|
-
},
|
|
312
|
-
});
|
|
192
|
+
# Index documents (parses PDFs/Markdown, builds BM25 and MinSync vectors)
|
|
193
|
+
autorag refresh
|
|
313
194
|
|
|
314
|
-
|
|
315
|
-
|
|
195
|
+
# Check indexing health
|
|
196
|
+
autorag status
|
|
316
197
|
```
|
|
317
198
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
Discord uses the external [`discrawl`](https://github.com/openclaw/discrawl) CLI, which owns the SQLite archive, the FTS5 index, and the message vectors. AutoRAG never calls the Discord API itself.
|
|
199
|
+
### 2. Search from CLI
|
|
321
200
|
|
|
322
201
|
```bash
|
|
323
|
-
|
|
202
|
+
# Perform a curated search (uses your configured reasoning model)
|
|
203
|
+
autorag search "What are our primary Q3 deliverables?"
|
|
204
|
+
|
|
205
|
+
# Launch the interactive Terminal UI (beta)
|
|
206
|
+
autorag tui
|
|
207
|
+
|
|
208
|
+
# Open the loopback web management dashboard (127.0.0.1)
|
|
209
|
+
autorag ui
|
|
324
210
|
```
|
|
325
211
|
|
|
326
|
-
|
|
212
|
+
### 3. Programmatic Usage (TypeScript API)
|
|
327
213
|
|
|
328
214
|
```typescript
|
|
329
|
-
import { AutoRAGAgent
|
|
330
|
-
|
|
331
|
-
const discord = new DiscrawlSkill({
|
|
332
|
-
client: new DiscrawlClient({ root: process.cwd() }),
|
|
333
|
-
instanceId: "community",
|
|
334
|
-
});
|
|
215
|
+
import { AutoRAGAgent } from "@autorag/librarian";
|
|
335
216
|
|
|
217
|
+
// Initialize librarian agent
|
|
336
218
|
const agent = new AutoRAGAgent({
|
|
337
219
|
searchPaths: ["/path/to/documents"],
|
|
338
|
-
datasourceSkills: [discord],
|
|
339
|
-
datasourceAccess: {
|
|
340
|
-
allowedTags: ["discord"],
|
|
341
|
-
},
|
|
342
220
|
});
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
Or through the trusted config factory:
|
|
346
|
-
|
|
347
|
-
```json
|
|
348
|
-
{
|
|
349
|
-
"datasources": {
|
|
350
|
-
"discord": {
|
|
351
|
-
"instanceId": "community",
|
|
352
|
-
"connector": {
|
|
353
|
-
"embeddingProvider": "ollama",
|
|
354
|
-
"embeddingModel": "embeddinggemma",
|
|
355
|
-
"defaultMode": "hybrid"
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
```
|
|
361
|
-
|
|
362
|
-
Two defaults are deliberate and worth keeping:
|
|
363
|
-
|
|
364
|
-
- **`defaultMode: "hybrid"`** — discrawl's FTS index strips newlines without substituting a space, welding words across line breaks into a single unsearchable token (measured at ~47% of post-newline words on a real archive). Semantic recall covers that gap. See [#1413](https://github.com/Marker-Inc-Korea/AutoRAG/issues/1413).
|
|
365
|
-
- **`embeddingProvider: "ollama"` + `embeddingModel: "embeddinggemma"`** — semantic search requires an embedding provider (`ollama serve && ollama pull embeddinggemma`). Configure these values in discrawl's own config; AutoRAG uses discrawl's native store unless an explicit `connector.configPath` is supplied. EmbeddingGemma (Gemma 3 300M, 768-dim, 100+ languages) is the same model family katok uses for KakaoTalk, so all CLI-backed datasources can share one local embedder. Do **not** use `nomic-embed-text`: it is English-only and collapses non-English text into one narrow similarity band, silently degrading semantic search to noise. AutoRAG emits a diagnostic when an English-only model is configured. See [#1414](https://github.com/Marker-Inc-Korea/AutoRAG/issues/1414).
|
|
366
|
-
|
|
367
|
-
A datasource skill should provide polling/cron metadata for routine indexing, source descriptions for the agent prompt, slash-hierarchical opaque source paths such as `/kakao/personal/chunks/<chunk-id>`, and permission tags that match your server-side access policy.
|
|
368
221
|
|
|
369
|
-
|
|
222
|
+
// Run curated search loop
|
|
223
|
+
const response = await agent.searchDocuments("Summarize recent compliance updates");
|
|
370
224
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
## Configuration and state
|
|
376
|
-
|
|
377
|
-
The default home state is kept outside the workspace:
|
|
378
|
-
|
|
379
|
-
```text
|
|
380
|
-
~/.autorag/
|
|
381
|
-
├── config.json
|
|
382
|
-
├── memory.json
|
|
383
|
-
└── logs/
|
|
384
|
-
└── runs.jsonl
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
`config.json` selects sources, the workspace, memory path, retrieval settings, and the agent model. Provider and model IDs must refer to a model available in the user's authenticated runtime:
|
|
388
|
-
|
|
389
|
-
```json
|
|
390
|
-
{
|
|
391
|
-
"searchPaths": ["/path/to/documents"],
|
|
392
|
-
"workspacePath": "/path/to/workspace",
|
|
393
|
-
"memoryPath": "/Users/you/.autorag/memory.json",
|
|
394
|
-
"model": { "provider": "provider-name", "id": "reasoning-model" }
|
|
225
|
+
console.log("Answer:", response.answer);
|
|
226
|
+
for (const result of response.results) {
|
|
227
|
+
console.log(`[${result.number}] ${result.title} (${result.source})`);
|
|
228
|
+
console.log(` ${result.summary}`);
|
|
395
229
|
}
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
`autorag init` leaves `model` unset when no model flags are supplied. At search time AutoRAG resolves an authenticated local provider when possible; otherwise configure the model explicitly.
|
|
399
|
-
|
|
400
|
-
For fast interactive search, prefer a model with reliable tool calling, high
|
|
401
|
-
output TPS, and low first-token latency. A query can require several short
|
|
402
|
-
model turns while AutoRAG alternates between retrieval tools and direct source
|
|
403
|
-
reading, so model throughput has a visible effect on end-to-end response time.
|
|
404
|
-
It does not accelerate BM25, MinSync, Jikji, filesystem access, or indexing
|
|
405
|
-
itself. Larger reasoning models remain useful for difficult synthesis,
|
|
406
|
-
conflicting evidence, and specialized domain judgment, but they are not a
|
|
407
|
-
requirement for ordinary retrieval.
|
|
408
230
|
|
|
409
|
-
|
|
231
|
+
// Record feedback: Result [1] was useful, [2] was not
|
|
232
|
+
agent.recordFeedbackByNumbers(response.sessionId, [1], [2]);
|
|
233
|
+
```
|
|
410
234
|
|
|
411
|
-
|
|
235
|
+
---
|
|
412
236
|
|
|
413
|
-
|
|
237
|
+
## CLI Command Reference
|
|
414
238
|
|
|
415
|
-
|
|
239
|
+
| Command | Description |
|
|
240
|
+
|---|---|
|
|
241
|
+
| `autorag init` | Initialize `~/.autorag/config.json` with search roots and model settings |
|
|
242
|
+
| `autorag refresh` | Refresh parsed mirrors, MinSync CDC chunks, datasources, and Jikji |
|
|
243
|
+
| `autorag search "<query>"` | Run the librarian agent to curate structured answers |
|
|
244
|
+
| `autorag status` | Inspect corpus freshness, indexing status, and vector readiness |
|
|
245
|
+
| `autorag health` | Check model provider authentication, token validity, and API reachability |
|
|
246
|
+
| `autorag tui` | Open the interactive librarian terminal UI |
|
|
247
|
+
| `autorag ui` | Open the local loopback web dashboard to configure datasources visually |
|
|
248
|
+
| `autorag duplicates [DIR]` | Read-only scan for exact and near-duplicate document families with `dupey` |
|
|
249
|
+
| `autorag lite ...` | Model-free indexing, retrieval, report generation, and status |
|
|
250
|
+
| `autorag feedback <session>` | Record useful / not-useful feedback by item number |
|
|
251
|
+
| `autorag evidence <session>` | Inspect exact underlying document chunks and sources for a past query |
|
|
252
|
+
| `autorag serve` | Start the P2P query server over SimpleX (opt-in) |
|
|
253
|
+
| `autorag p2p ...` | Manage peer trust, query approvals, and sharing policies |
|
|
416
254
|
|
|
417
|
-
|
|
255
|
+
---
|
|
418
256
|
|
|
419
|
-
|
|
257
|
+
## Documentation Links
|
|
420
258
|
|
|
421
|
-
|
|
422
|
-
session token in the environment, set the public URL used by the browser, and
|
|
423
|
-
allow only the frontend origins that should make credentialed API requests:
|
|
259
|
+
Deep dive into AutoRAG Agent's architecture, security, and integration guides:
|
|
424
260
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
"tokenEnv": "AUTORAG_UI_TOKEN"
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
```
|
|
261
|
+
- **[MinSync Setup & Embedding QA](docs/minsync-setup.md):** Automatic binary installation, CDC chunking, and EmbeddingGemma verification.
|
|
262
|
+
- **[Local Embedding Runtime & Gateway](docs/embedding-runtime.md):** AutoRAG-owned local gateway, model prefetching, and zero-egress semantic search. Model cards: [`qwen3-embedding-0.6b`](docs/model-cards/qwen3-embedding-0.6b.md), [`embeddinggemma-300m`](docs/model-cards/embeddinggemma-300m.md).
|
|
263
|
+
- **[Datasource Skills Reference](docs/datasource-skills.md):** Full configuration contracts, connection aliases, and connector options.
|
|
264
|
+
- **[Manual QA & Datasource Test Harnesses](docs/manual-qa-datasources.md):** Real-world testing guides for Discord, KakaoTalk, Slack, Notion, and email.
|
|
265
|
+
- **[P2P SimpleX Sharing & Path Standard](docs/p2p-path-standard.md):** Decentralized peer query sharing with SimpleX, PII redaction, and approval queues.
|
|
266
|
+
- **[Supply Chain Security & License Audits](docs/supply-chain.md):** Software bill of materials (SBOM) and dependency gate policies.
|
|
267
|
+
- **[Competitive Landscape Study](docs/competitive-landscape-2026-09.md):** In-depth analysis of why in-place federation outperforms centralized RAG.
|
|
268
|
+
- **[Legacy AutoRAG (AutoML)](legacy/README.md):** Documentation for the legacy Python AutoML pipeline optimizer (`pip install AutoRAG`).
|
|
437
269
|
|
|
438
|
-
|
|
439
|
-
characters. Local use remains the safe default: omit `ui` (or leave
|
|
440
|
-
`allowRemote` false) and AutoRAG binds to loopback, including a working
|
|
441
|
-
`localhost` URL on systems that resolve it to IPv6.
|
|
270
|
+
---
|
|
442
271
|
|
|
443
|
-
|
|
272
|
+
## Contributors & Community
|
|
444
273
|
|
|
445
|
-
|
|
446
|
-
autorag init # write ~/.autorag/config.json
|
|
447
|
-
autorag refresh # parsed + MinSync + datasources + Jikji
|
|
448
|
-
autorag watch [--once] # filesystem watch, or one cron/poll tick
|
|
449
|
-
autorag status # corpus freshness (model-free)
|
|
450
|
-
autorag search "your question" # curated answer (requires a configured model)
|
|
451
|
-
autorag feedback <session> # numbered useful / not-useful feedback
|
|
452
|
-
autorag evidence <session> # persisted source/chunk evidence
|
|
453
|
-
autorag memory inspect # retrieval memory snapshot
|
|
454
|
-
autorag index reset|rebuild # remove or rebuild workspace indexes
|
|
455
|
-
autorag health # model/provider auth (no index check)
|
|
456
|
-
autorag duplicates [DIR] # read-only duplicate families; never deletes
|
|
457
|
-
autorag tui # interactive librarian terminal UI (beta)
|
|
458
|
-
autorag ui # loopback page to connect datasources
|
|
459
|
-
autorag lite … # model-free setup, retrieve, report, status
|
|
460
|
-
autorag setup # install and configure local runtime assets
|
|
461
|
-
autorag models prefetch|import|verify
|
|
462
|
-
# manage local embedding model profiles
|
|
463
|
-
autorag gateway status|stop # inspect or stop the local embedding gateway
|
|
464
|
-
autorag serve # P2P peer query server over SimpleX (opt-in)
|
|
465
|
-
autorag p2p # peer trust, approvals, and sharing policy
|
|
466
|
-
```
|
|
274
|
+
AutoRAG Agent is an open-source project built by the community. We welcome contributions, bug reports, datasource connectors, and ideas!
|
|
467
275
|
|
|
468
|
-
`
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
[docs/embedding-runtime.md](docs/embedding-runtime.md) for the local embedding
|
|
472
|
-
runtime and gateway setup.
|
|
276
|
+
- **Contributing:** Feel free to open an issue or pull request. Start with [CONTRIBUTING.md](CONTRIBUTING.md) — development setup, the `make ci` check we ask for, the `Signed-off-by` trailer every commit needs, and when to run the live end-to-end lanes. [MAINTAINERS](MAINTAINERS) lists who reviews which area. AI tools are allowed; unverified dumps are not — see [AI_POLICY.md](AI_POLICY.md).
|
|
277
|
+
- **Security:** Private vulnerability reports and the response SLA live in [SECURITY.md](SECURITY.md).
|
|
278
|
+
- **GitHub Contributors:** [View all contributors](https://github.com/Marker-Inc-Korea/AutoRAG/graphs/contributors) on GitHub.
|
|
473
279
|
|
|
474
|
-
|
|
280
|
+
---
|
|
475
281
|
|
|
476
|
-
|
|
477
|
-
`config.json`, or pass `--force` to start the server once. Peers reach this
|
|
478
|
-
installation through SimpleX; the local control socket binds to loopback
|
|
479
|
-
(default port 5225).
|
|
282
|
+
## Acknowledgements
|
|
480
283
|
|
|
481
|
-
|
|
482
|
-
autorag serve # start the peer query server
|
|
483
|
-
autorag p2p peers # list trusted peers
|
|
484
|
-
autorag p2p peers --add alice --contact-id 1
|
|
485
|
-
autorag p2p requests # pending responses held for approval
|
|
486
|
-
autorag p2p requests approve <id>
|
|
487
|
-
autorag p2p policy list # merged sharing rules (virtual-path keys)
|
|
488
|
-
autorag p2p policy set '/docs/**' peers
|
|
489
|
-
autorag p2p policy unset '/docs/**'
|
|
490
|
-
```
|
|
284
|
+
AutoRAG Agent stands on the shoulders of fantastic open-source projects:
|
|
491
285
|
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
286
|
+
- **[Pi Framework](https://github.com/earendil-works/pi-mono)** by [@earendil-works](https://github.com/earendil-works) — The foundational agent framework powering AutoRAG's reasoning loop.
|
|
287
|
+
- **[MinSync](https://github.com/Marker-Inc-Korea/minsync)** — Ultra-fast incremental Change Data Capture (CDC) chunking and local BM25/vector indexing.
|
|
288
|
+
- **[Jikji](https://github.com/NomaDamas/jikji)** by [NomaDamas](https://github.com/NomaDamas) — High-performance find-first local document discovery.
|
|
289
|
+
- **[dupey](https://github.com/NomaDamas/dupey)** by [NomaDamas](https://github.com/NomaDamas) — Fast duplicate and near-duplicate document family detection.
|
|
290
|
+
- **Federated CLI Authors:** External datasource tools [`lazykatok`](https://github.com/changeroa/lazykatok), [`discrawl`](https://github.com/openclaw/discrawl), [`mailcrawl`](https://github.com/NomaDamas/mailcrawl), [`wacrawl`](https://github.com/openclaw/wacrawl), [`telecrawl`](https://github.com/openclaw/telecrawl), [`slacrawl`](https://github.com/openclaw/slacrawl), [`notcrawl`](https://github.com/openclaw/notcrawl), [`qmd`](https://github.com/tobi/qmd), and [`rclone`](https://rclone.org).
|
|
291
|
+
- **[OpenDataLoader](https://github.com/opendataloader/opendataloader-pdf)** / **Docling** — Robust PDF and document parsing runtimes.
|
|
497
292
|
|
|
498
|
-
|
|
293
|
+
---
|
|
499
294
|
|
|
500
|
-
|
|
295
|
+
## Troubleshooting
|
|
501
296
|
|
|
502
|
-
|
|
503
|
-
bun add @autorag/librarian # library
|
|
504
|
-
bun install -g @autorag/librarian # autorag CLI
|
|
505
|
-
# or run directly from the repo:
|
|
506
|
-
bun add github:Marker-Inc-Korea/AutoRAG
|
|
507
|
-
```
|
|
297
|
+
When search returns nothing, a datasource disappears from results, refresh hangs, or the gateway will not start, run the **`autorag-doctor`** agent skill (`skills/autorag-doctor/SKILL.md`). Point your coding agent at it and say *"check AutoRAG"* — it walks the full diagnose-and-repair procedure and ends with a per-datasource status table showing what is indexed and what actually returns hits.
|
|
508
298
|
|
|
509
|
-
|
|
510
|
-
`@opendataloader/pdf` runtime is compiled for Java 11. This applies to
|
|
511
|
-
Windows, macOS, and Linux. Verify the runtime that will be selected from
|
|
512
|
-
`PATH` before indexing PDFs:
|
|
299
|
+
The first three commands cover most of it:
|
|
513
300
|
|
|
514
301
|
```bash
|
|
515
|
-
|
|
302
|
+
autorag status --json # freshness, per-component state, diagnostics
|
|
303
|
+
autorag health --json # model resolution + one live completion probe
|
|
304
|
+
autorag gateway status --format json # on-demand embedding runtime
|
|
516
305
|
```
|
|
517
306
|
|
|
518
|
-
|
|
519
|
-
installations in `PATH` (or set `JAVA_HOME` to the Java 11+ installation and
|
|
520
|
-
start a new shell). Java 8 is not supported by the PDF parser.
|
|
521
|
-
|
|
522
|
-
Git-based installs build `dist/` via the `prepare` script and require Bun on the installing machine.
|
|
523
|
-
External tool binaries auto-install on first use into `<workspace>/.autorag/bin`: **MinSync** installs from crates.io via `cargo install minsync` first (on by default; verified GitHub release assets are the fallback when cargo is unavailable; `minSync.autoInstall: false` to opt out), and **Jikji** compiles the [`jikji-cli`](https://crates.io/crates/jikji-cli) crate via cargo (requires the [Rust toolchain](https://rustup.rs); `jikji.autoInstall: false` to opt out). New `autorag init` configs enable Jikji find-first discovery by default. KakaoTalk (`katok`) and Discord (`discrawl`) stay manual, optional installs. All of them degrade gracefully when missing — core BM25 search works without any of them.
|
|
524
|
-
|
|
525
|
-
### TUI (beta)
|
|
526
|
-
|
|
527
|
-
`autorag tui` opens an interactive Pi-powered librarian terminal UI using the
|
|
528
|
-
same config as `autorag search`:
|
|
307
|
+
Indexing is not the same thing as searchability, so always confirm retrieval itself — this needs no model:
|
|
529
308
|
|
|
530
309
|
```bash
|
|
531
|
-
autorag
|
|
310
|
+
autorag lite retrieve 'a word that certainly appears' --top-k 3 --json
|
|
311
|
+
autorag lite retrieve 'recent topic' --tags discord --top-k 3 --json
|
|
532
312
|
```
|
|
533
313
|
|
|
534
|
-
|
|
535
|
-
replaces the current view with that session instead of mixing the two
|
|
536
|
-
conversation histories. The TUI is beta and may still change.
|
|
314
|
+
Common failures and their fix:
|
|
537
315
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
const response = await agent.searchDocuments("summarize the compliance requirements");
|
|
548
|
-
console.log(response.answer);
|
|
549
|
-
for (const result of response.results) {
|
|
550
|
-
console.log(`[${result.number}] ${result.title} — ${result.summary}`);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
// Mark which results were useful — AutoRAG remembers for next time
|
|
554
|
-
agent.recordFeedbackByNumbers(response.sessionId, [1, 3], [2]);
|
|
555
|
-
```
|
|
556
|
-
|
|
557
|
-
`searchDocuments()` runs the Pi agent loop — it searches, reads, consults memory, curates, and finalizes through the `emit_autorag_results` structured tool — then returns a typed `SearchDocumentsResponse`. The caller consumes the structured payload directly; no assistant text parsing.
|
|
558
|
-
|
|
559
|
-
## How It Works
|
|
316
|
+
| Symptom | Diagnostic code | Fix |
|
|
317
|
+
|---|---|---|
|
|
318
|
+
| Results are missing recent files | `stale-index` | `autorag refresh --method parsed,minsync --json` |
|
|
319
|
+
| Semantic search returns nothing after changing the embedder | `embedding-identity-mismatch` | `autorag index rebuild --method minsync` |
|
|
320
|
+
| Gateway will not start, a previous run was killed | `lock-conflict` | `autorag gateway stop`, then retry |
|
|
321
|
+
| A datasource is healthy in its own CLI but absent from results | — | add its tag/scope to `datasourceAccess` |
|
|
322
|
+
| A datasource errors during refresh | `datasource-index-failed` | run that CLI's own `doctor` |
|
|
323
|
+
| MinSync or Jikji missing | `minsync-unavailable`, `jikji-unavailable` | check the Rust toolchain, re-run refresh |
|
|
560
324
|
|
|
561
|
-
|
|
562
|
-
You ask a question
|
|
563
|
-
│
|
|
564
|
-
▼
|
|
565
|
-
┌──────────────┐
|
|
566
|
-
│ Plan + search│ ← check_memory, Jikji, and retrieval tools
|
|
567
|
-
└──────┬───────┘
|
|
568
|
-
▼
|
|
569
|
-
┌──────────────┐
|
|
570
|
-
│ Direct read │ ← bash find/grep/cat
|
|
571
|
-
└──────┬──────┘
|
|
572
|
-
▼
|
|
573
|
-
┌─────────────┐
|
|
574
|
-
│ Curate │ ← Extract key insights, not raw lines
|
|
575
|
-
└──────┬──────┘
|
|
576
|
-
▼
|
|
577
|
-
[1] Finding A — summary (location)
|
|
578
|
-
[2] Finding B — summary (location)
|
|
579
|
-
|
|
580
|
-
│
|
|
581
|
-
Caller says "1 was useful, 2 wasn't"
|
|
582
|
-
│
|
|
583
|
-
▼
|
|
584
|
-
┌─────────────┐
|
|
585
|
-
│ Memory │ ← Remembers what worked, adapts next time
|
|
586
|
-
└─────────────┘
|
|
587
|
-
```
|
|
325
|
+
Native datasource stores stay owned by their CLIs — AutoRAG never rebuilds them. Fix a broken archive with `lazykatok doctor`, `discrawl --json metadata`, `slacrawl --json doctor`, `wacrawl --json doctor`, `telecrawl --json doctor`, `notcrawl doctor`, `qmd status`, or `mailcrawl doctor`, then re-run `autorag refresh --method datasources --json`.
|
|
588
326
|
|
|
589
327
|
## License
|
|
590
328
|
|
|
591
|
-
|
|
329
|
+
- **AutoRAG 2.0 (AutoRAG Agent):** Released under the [MIT License](LICENSE).
|
|
330
|
+
- **Legacy Python AutoRAG (`legacy/`):** Released under the [Apache License 2.0](legacy/LICENSE).
|
|
331
|
+
- Production third-party notices and licenses are documented in [`NOTICE`](NOTICE).
|