@itradingai/aiwiki 0.2.21 → 0.2.23

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/docs/USAGE.md CHANGED
@@ -1,502 +1,314 @@
1
- # AIWiki 使用说明
1
+ # AIWiki Usage Guide
2
2
 
3
- 目标体验:
3
+ AIWiki is meant to be used through an AI assistant.
4
+
5
+ The target experience is simple:
4
6
 
5
7
  ```text
6
- 用户只做一次 setup -> 之后只把链接发给 Agent -> Agent 自动调用 AIWiki 入库
8
+ set up once
9
+ -> send links, files, or notes to your assistant
10
+ -> the assistant calls AIWiki
11
+ -> AIWiki writes reusable local Markdown knowledge
7
12
  ```
8
13
 
9
- AIWiki CLI 不负责网页抓取。Qclaw、Codex、Claude Code、Cursor、Gemini CLI 等都只是宿主 Agent 的例子;这份文档面向的是通用宿主 Agent 协作。
14
+ AIWiki does not fetch webpages and does not call an LLM. The host assistant reads and understands sources; AIWiki validates, writes, links, queries, and checks the local knowledge base.
10
15
 
11
- AIWiki CLI 也不调用 LLM。高质量 Wiki Entry 来自宿主 Agent 提供的 `analysis` 或 `wiki_entry`;如果没有这些字段,AIWiki 会生成可追溯的 deterministic fallback 条目,只包含来源、反链、正文预览和待补全区。
16
+ ## 1. Ask Your Assistant to Install AIWiki
12
17
 
13
- AIWiki 会把证据通道和疑似风险分开记录。`source_quote` 等宿主 Agent 提供的原文引用属于证据通道;`coverage_suspected_incomplete`、`unsupported_claims`、`needs_review` 等属于 AIWiki 生成的启发式复核信号,不等于已经证明内容遗漏。
18
+ Copy this prompt into your assistant:
14
19
 
15
- 成功入库的正文会写入稳定的 `content_fingerprint`。如果同一来源同一正文重复入库,AIWiki 会保留新的 run 记录、给出重复 fingerprint warning,并把长期文件改名保存,避免静默覆盖已有知识资产。
20
+ Before sending it, replace every `<replace-with-my-aiwiki-path>` with your own local folder path, such as `D:\AIWiki` or `~/AIWiki`. Do not leave the placeholder in the commands.
16
21
 
17
- ## 1. 一次性设置
22
+ ```text
23
+ Please install and configure AIWiki for me.
18
24
 
19
- 发布后直接运行交互式 setup:
25
+ First check that Node.js is installed and that node --version is >=20.
26
+ If Node.js is missing or older than 20, stop and tell me how to upgrade before running npm install.
20
27
 
21
- ```bash
22
- npx @itradingai/aiwiki@latest setup
23
- ```
28
+ Use this knowledge base path:
24
29
 
25
- CLI 会询问知识库路径。直接回车会使用默认目录;输入 `y` 后会创建或补齐目录,并设置为默认知识库。
30
+ <replace-with-my-aiwiki-path>
26
31
 
27
- 如果你想一行命令完成,也可以运行:
32
+ Replace every `<replace-with-my-aiwiki-path>` below with my own local folder path before running commands. If I left the placeholder unchanged, stop and ask me for the real path.
28
33
 
29
- ```bash
30
- npx @itradingai/aiwiki@latest setup --path "F:\knowledge_data\aiwiki" --yes
31
- ```
34
+ Run these commands:
32
35
 
33
- 本地仓库测试时:
36
+ npm install -g @itradingai/aiwiki@latest
37
+ aiwiki setup --path "<replace-with-my-aiwiki-path>" --yes
38
+ aiwiki agent sync --yes
39
+ aiwiki agent sync --path "<replace-with-my-aiwiki-path>" --yes
40
+ aiwiki agent check --json
41
+ aiwiki agent check --path "<replace-with-my-aiwiki-path>" --json
42
+ aiwiki doctor --path "<replace-with-my-aiwiki-path>"
43
+ aiwiki status --path "<replace-with-my-aiwiki-path>"
34
44
 
35
- ```bash
36
- cd "<AIWiki 仓库路径>"
37
- npm install
38
- npm run build
39
- npm link
40
- aiwiki setup --path "F:\knowledge_data\aiwiki-test" --yes
45
+ Then summarize what was installed, what was synced, whether workspace guidance exists, and whether I need to restart or reload the assistant.
41
46
  ```
42
47
 
43
- 验证:
48
+ Example knowledge base paths:
44
49
 
45
- ```bash
46
- aiwiki doctor
47
- aiwiki status
50
+ ```text
51
+ Windows: D:\AIWiki
52
+ macOS/Linux: ~/AIWiki
53
+ Project test: ./aiwiki-test
48
54
  ```
49
55
 
50
- `setup` 会做两件事:
56
+ This creates or repairs the knowledge base, syncs the packaged AIWiki skill into supported assistant environments, and writes workspace-level `AGENTS.md` guidance.
51
57
 
52
- - 创建或补齐知识库目录。
53
- - 写入默认知识库配置到用户目录,例如 `%USERPROFILE%\.aiwiki\config.json`。
58
+ Expected result:
54
59
 
55
- 之后大多数命令都可以省略 `--path`。
60
+ - `aiwiki --version` works
61
+ - `aiwiki doctor --path <workspace>` passes or reports actionable fixes
62
+ - `aiwiki agent check --json` reports supported targets as `installed`, `updated`, or `current`
63
+ - `aiwiki agent check --path <workspace> --json` reports workspace guidance as current
64
+ - `aiwiki status --path <workspace>` shows the workspace state and next action
56
65
 
57
- ## 2. 让宿主 Agent 学会 AIWiki
66
+ ## 2. Agent Sync Layers
58
67
 
59
- 初始化知识库之后,先让宿主 Agent 学会 AIWiki。主路径推荐使用幂等同步:
68
+ AIWiki has two sync layers:
60
69
 
61
70
  ```bash
62
71
  aiwiki agent sync --yes
63
- aiwiki agent check --json
64
- aiwiki agent sync --path <workspace> --yes
65
- aiwiki agent check --path <workspace> --json
66
72
  ```
67
73
 
68
- 前两条同步本机宿主 Agent skill/command,后两条在知识库根目录写入或刷新 marker-bounded `AGENTS.md` 指导。这样新的宿主 Agent 进入项目时,会先看到“必须调用 aiwiki CLI”的约束,而不是直接走默认文件搜索流程。
69
-
70
- 旧的安装向导仍然兼容,但不再作为首选路径:
74
+ Syncs AIWiki instructions into supported local assistant targets such as Codex, Claude Code, QClaw, and OpenClaw.
71
75
 
72
76
  ```bash
73
- aiwiki agent install
77
+ aiwiki agent sync --path <workspace> --yes
74
78
  ```
75
79
 
76
- 也可以跳过选择,直接指定目标:
80
+ Writes marker-bounded guidance into the knowledge base root so future assistants entering that workspace know to use AIWiki commands before generic file search.
81
+
82
+ Verify both layers:
77
83
 
78
84
  ```bash
79
- aiwiki agent install --agent codex --yes
80
- aiwiki agent install --agent qclaw --yes
81
- aiwiki agent install --agent openclaw --yes
82
- aiwiki agent install --agent claude --yes
85
+ aiwiki agent check --json
86
+ aiwiki agent check --path <workspace> --json
83
87
  ```
84
88
 
85
- 当前自动复制范围:
86
-
87
- - `codex`:复制到 Codex 用户 skills 目录。
88
- - `qclaw`:复制到 QClaw skills 目录。
89
- - `openclaw`:复制到 OpenClaw workspace skills 目录。
90
- - `claude`:复制为 Claude Code slash-command 提示文件。
91
-
92
- `opencode` 和 `hermes` 会被扫描出来,但 AIWiki 暂不自动写入它们的配置。确认官方用户提示/skill 目录后再开放自动安装。现在可先输出通用对接协议:
89
+ For unsupported hosts, print the generic assistant protocol:
93
90
 
94
91
  ```bash
95
92
  aiwiki prompt agent
96
93
  ```
97
94
 
98
- 把输出内容安装成宿主 Agent skill,或粘贴到宿主 Agent 的项目/会话说明里。不同 Agent 的安装入口不同,所以 AIWiki 提供自动安装向导和通用协议两条路径。
95
+ ## 3. Ingest a Source
99
96
 
100
- `aiwiki agent check --json` 用来确认本机检测到哪些宿主 Agent、哪些已经安装 AIWiki 对接文件、哪些还需要运行 `aiwiki agent sync --agent <id> --yes`。`aiwiki agent check --path <workspace> --json` 会同时检查知识库根目录的 `AGENTS.md` 是否包含当前 AIWiki 命令优先指导,缺失或过期时会提示运行 `aiwiki agent sync --path <workspace> --yes`。
97
+ ### 10-minute trial route
101
98
 
102
- 如果宿主 Agent 只用 `rg`、`find`、`grep` 或手工读文件来回答 AIWiki 问题,而没有先运行 `aiwiki lint --json`、`aiwiki status`、`aiwiki query` 或 `aiwiki context`,就说明它没有真正使用 AIWiki 的知识库闭环。
103
-
104
- ## 3. 日常使用
105
-
106
- 宿主 Agent 已经加载 AIWiki 协议后,把下面的话发给它,并替换链接:
99
+ For a first public trial, keep the loop deliberately small:
107
100
 
108
101
  ```text
109
- 入库 https://example.com/article
102
+ setup
103
+ -> first source ingest
104
+ -> inspect generated artifacts
105
+ -> query/context reuse
106
+ -> lint/doctor check
107
+ -> short feedback note
110
108
  ```
111
109
 
112
- 宿主 Agent 应该自动完成:
113
-
114
- 1. 读取网页正文。
115
- 2. 生成 `aiwiki.agent_payload.v1`。
116
- 3. 通过 stdin 调用 `aiwiki ingest-agent --stdin`。
117
- 4. 把 AIWiki CLI 输出的入库结果摘要回复给用户。
118
-
119
- 用户不需要保存 JSON,不需要手动运行 `ingest-agent`,也不需要每次输入知识库路径。
120
-
121
- ## 4. 宿主 Agent 端应回复什么
110
+ Concrete command surface:
122
111
 
123
- AIWiki CLI 会输出 key-value 信息。成功入库时类似:
124
-
125
- ```text
126
- ingested: yes
127
- recorded: yes
128
- fetch_status: ok
129
- fit_score: 90
130
- fit_level: high
131
- source_title: 文章标题
132
- source_url: https://example.com/article
133
- summary: 这里是文章前段摘要,方便 Agent 快速告诉用户文章大意。
134
- run_id: 20260507-153012-abc123
135
- run_dir: F:\knowledge_data\aiwiki\09-runs\20260507-153012-abc123
136
- files: 8
137
- processing_summary: 09-runs/20260507-153012-abc123/processing-summary.md
138
- wiki_entry: 05-wiki/source-knowledge/article-slug.md
139
- wiki_entry_generation_mode: agent_enriched
140
- wiki_entry_quality: enriched
141
- grounding_evidence_available: yes
142
- grounding_evidence_channel: host_supplied
143
- grounding_needs_review: no
144
- grounding_markers: none
145
- grounding_claims_with_quotes: 1/1
146
- source_card: 03-sources/article-cards/article-slug.md
147
- draft_outline: 09-runs/20260507-153012-abc123/draft-outline.md # 仅在生成大纲时出现
148
- dashboard: dashboards/AIWiki Home.md
149
- review_queue: dashboards/Review Queue.md
150
- warnings: 0
112
+ ```bash
113
+ aiwiki setup --path <workspace> --yes
114
+ aiwiki doctor --path <workspace>
115
+ aiwiki ingest-file --file <file> --path <workspace>
116
+ aiwiki query "<topic>" --path <workspace>
117
+ aiwiki context "<topic>" --path <workspace>
118
+ aiwiki lint --json --path <workspace>
151
119
  ```
152
120
 
153
- 宿主 Agent 回复用户时建议展示:
121
+ When the source is a URL, the assistant reads it first and then calls `aiwiki ingest-agent`; AIWiki itself does not crawl the page.
154
122
 
155
- ```text
156
- AIWiki 已完成入库,并生成 Wiki 条目。
157
- 契合度:90 / high
158
- 摘要:……
159
- Wiki 条目:……
160
- 质量模式:enriched / agent_enriched
161
- 资料卡:……
162
- 处理记录:……
163
- ```
164
-
165
- 网页读取失败但已记录原因时类似:
123
+ Tell your assistant:
166
124
 
167
125
  ```text
168
- ingested: no
169
- recorded: yes
170
- fetch_status: failed
171
- fit_score: 0
172
- fit_level: fetch_failed
173
- summary: 网页需要登录或宿主 Agent 无法访问正文。
174
- run_id: 20260507-153012-abc123-fetch-failed
175
- run_dir: F:\knowledge_data\aiwiki\09-runs\20260507-153012-abc123-fetch-failed
176
- files: 2
177
- processing_summary: 09-runs/20260507-153012-abc123-fetch-failed/processing-summary.md
178
- dashboard: dashboards/AIWiki Home.md
179
- review_queue: dashboards/Review Queue.md
180
- warnings: 0
126
+ Ingest this into AIWiki:
127
+ https://example.com/article
181
128
  ```
182
129
 
183
- 宿主 Agent 回复用户时建议展示:
184
-
185
- ```text
186
- 未成功入库正文,但已记录失败原因。
187
- 原因:……
188
- 记录目录:……
189
- 处理记录:……
190
- Obsidian 入口:dashboards/AIWiki Home.md
191
- ```
130
+ The assistant should:
192
131
 
193
- ## 5. 成功后会生成什么
132
+ 1. read the source
133
+ 2. build an `aiwiki.agent_payload.v1` payload
134
+ 3. provide `analysis` or `wiki_entry` when it understands the source
135
+ 4. call `aiwiki ingest-agent --stdin`
136
+ 5. report the generated Wiki Entry, Source Card, and Processing Summary
194
137
 
195
- 每次成功 run 先看核心产物:
138
+ For local files, the assistant may call:
196
139
 
197
- ```text
198
- 09-runs/<run-id>/payload.json
199
- 09-runs/<run-id>/raw.md
200
- 09-runs/<run-id>/source-card.md
201
- 09-runs/<run-id>/wiki-entry.md
202
- 09-runs/<run-id>/processing-summary.md
203
- 02-raw/articles/
204
- 03-sources/article-cards/
205
- 05-wiki/source-knowledge/
206
- ```
207
-
208
- 只有 payload 有对应内容或 `request.outputs` 明确请求时,才会出现可选增强产物:
209
-
210
- ```text
211
- 09-runs/<run-id>/creative-assets.md
212
- 09-runs/<run-id>/topics.md
213
- 09-runs/<run-id>/draft-outline.md
214
- 04-claims/_suggestions/
215
- 06-assets/_suggestions/
216
- 07-topics/ready/
217
- 08-outputs/outlines/
140
+ ```bash
141
+ aiwiki ingest-file --file <file>
218
142
  ```
219
143
 
220
- `05-wiki/source-knowledge` 是默认知识层;`09-runs` 用于追溯每次处理。
221
-
222
- 可以直接查看仓库里的 `examples/demo-run/` 和 `examples/obsidian-vault-sample/`,它们由当前 CLI 生成,展示普通本地文件只生成核心产物、enriched Agent payload 才生成可选增强产物。
223
-
224
- Wiki Entry 有两种质量模式:
225
-
226
- - `agent_enriched` / `enriched`:宿主 Agent 提供了 `analysis` 或 `wiki_entry`。
227
- - `deterministic_fallback` / `scaffold`:AIWiki 只生成来源、反链、正文预览和待补全区。
228
-
229
- `analysis` 可以继续只传旧字段,也可以补充 `entities`、`concepts`、`tensions`、`reusable_judgments`、`suggested_links`。这些字段会进入 Wiki Entry,帮助用户区分“实体/概念”“可复用判断”“证据边界”和“后续可链接条目”,但不会被 AIWiki 当作已经证实的事实。
230
-
231
- Artifact 角色保持固定:
232
-
233
- - `03-sources/article-cards` 是 trace-first 的资料卡:保留来源、反链、原文预览和 grounding 状态,不承担完整知识正文。
234
- - `05-wiki/source-knowledge` 是 enriched knowledge surface:宿主 Agent 的 `analysis` / `wiki_entry` 会进入这里。
235
- - `02-raw/articles` 是原始证据层,后续摘要、Claim 和复核都应能回查这里。
236
-
237
- Grounding 字段都是 additive,可被旧工具忽略:
144
+ If webpage reading fails, the assistant should still record the failure with `fetch_status: "failed"` so the run is traceable.
238
145
 
239
- - `grounding_evidence_available`:是否存在可回查的宿主证据。
240
- - `grounding_evidence_channel`:`host_supplied` 或 `none`。
241
- - `grounding_needs_review`:是否需要复核。
242
- - `grounding_markers`:例如 `unsupported_claims`、`source_quote_not_found`、`coverage_suspected_incomplete`。
243
- - `coverage_suspected_incomplete`:长文提取过少时的启发式疑似标记,不是确定遗漏结论。
146
+ ## 4. Ask the Knowledge Base
244
147
 
245
- Wiki Entry 还会记录来源角色:
246
-
247
- - `source_role: input`:默认值,外部文章、网页、书籍、视频等资料;`represents_user_view: false`。
248
- - `source_role: output`:用户已发布文章、演讲稿、公众号文章等个人输出;通常可配合 `represents_user_view: true`。
249
- - `source_role: processing`:用户自己的草稿、笔记、思考过程;默认不直接代表最终观点。
250
-
251
- ### Obsidian 链接规则
252
-
253
- AIWiki 生成的 Markdown 按 Obsidian vault 内路径组织,文件正文会使用 wikilink:
148
+ Tell your assistant:
254
149
 
255
150
  ```text
256
- [[03-sources/article-cards/article-slug|资料卡]]
257
- [[05-wiki/source-knowledge/article-slug|Wiki 条目]]
258
- [[02-raw/articles/article-slug|原文]]
259
- [[09-runs/20260507-153012-abc123/processing-summary|处理记录]]
151
+ What does AIWiki know about <topic>?
260
152
  ```
261
153
 
262
- 链接规则:
263
- - wikilink 使用 vault 相对路径,统一为 `/`,并去掉 `.md` 后缀。
264
- - `02-raw/articles`、`03-sources/article-cards`、`05-wiki/source-knowledge` 和 `09-runs/<run-id>` 是核心产物;`04-claims/_suggestions`、`06-assets/_suggestions`、`07-topics/ready`、`08-outputs/outlines` 只在 payload 有对应内容或 `request.outputs` 明确请求时生成。
265
- - `03-sources/article-cards` 只链接本次实际生成的可选增强产物,避免空目录和断链。
266
- - `09-runs/<run-id>/processing-summary.md` 会把本次生成的 Markdown 文件列成可点击 wikilink;`payload.json` 不是 Markdown,保留普通路径。
267
- - frontmatter 会写入 `aiwiki_id`、`type`、`status`、`slug`、`source_url`、`content_fingerprint`、`created_at`、`captured_at`、`run_id`、`source_card`、`raw_note`、`run_summary` 等核心字段;`claims_note`、`assets_note`、`topics_note`、`outline_note` 只在对应产物存在时出现。
268
-
269
- ### Obsidian 数据库入口
270
-
271
- `setup` 会创建或补齐 Obsidian 数据库资产:
154
+ The assistant should call:
272
155
 
273
- ```text
274
- dashboards/AIWiki Home.md
275
- dashboards/Wiki Entries.md
276
- dashboards/Source Cards.md
277
- dashboards/Review Queue.md
278
- dashboards/Recent Runs.md
279
- dashboards/Topic Pipeline.md
280
- _system/schemas/aiwiki-frontmatter.md
281
- _system/templates/source-card.md
282
- _system/templates/review-note.md
156
+ ```bash
157
+ aiwiki context "<topic>"
283
158
  ```
284
159
 
285
- 这些文件只在缺失时创建;如果你已经在 Obsidian 中改过 dashboard 或模板,重新运行 `aiwiki setup` 不会覆盖。
286
-
287
- 不安装 Dataview 也可以使用:
288
- - 用 `dashboards/AIWiki Home.md` 作为入口。
289
- - 用 Obsidian Properties 查看字段。
290
- - 用 Backlinks / Graph View 查看资料卡和原文、Claim、素材、选题、大纲之间的关系。
291
-
292
- 安装 Dataview 后,dashboard 中的 `dataview` 代码块会渲染成表格,用来查看最近入库、待审队列、选题管线和处理记录。
160
+ `context` returns JSON for assistants. It includes query scope, result quality, match reasons, quality signals, and related references.
293
161
 
294
- Dataview 是可选增强,不是 AIWiki 的必需依赖。AIWiki 不会自动修改 `.obsidian` 或安装社区插件;需要时请在 Obsidian 的 Community plugins 中自行安装并启用 Dataview。
162
+ For human-readable terminal output:
295
163
 
296
- ## 6. Agent 对接协议
297
-
298
- 给任意宿主 Agent 的详细协议见:
299
-
300
- ```text
301
- docs/AGENT_HANDOFF.md
164
+ ```bash
165
+ aiwiki query "<topic>"
302
166
  ```
303
167
 
304
- 核心要求:
305
-
306
- - Agent 负责读取网页正文。
307
- - Agent 应尽量提供 `analysis` 或 `wiki_entry`,让 Wiki Entry 进入 enriched 模式。
308
- - Agent 不要让用户保存 payload。
309
- - Agent 不要让用户手动运行 `ingest-agent`。
310
- - Agent 生成 payload 后优先通过 stdin 调用 `aiwiki ingest-agent --stdin`。
311
- - Agent 最后向用户汇报入库状态、摘要、Wiki 条目、质量模式、资料卡和处理记录。
312
-
313
- ## 7. 查询和整理
314
-
315
- 从知识库调度内容:
168
+ Useful filters:
316
169
 
317
170
  ```bash
318
- aiwiki context "AI Agent"
319
- aiwiki query "AI Agent"
171
+ aiwiki context "AI Agent" --type wiki_entries --source-role input --wiki-type source_knowledge --status active --limit 5
172
+ aiwiki query "AI Agent" --type source_cards --status to-review --limit 3
320
173
  ```
321
174
 
322
- `context` 返回 JSON 给宿主 Agent 使用;`query` 使用同一套检索结果,输出给人看的分组摘要。
175
+ AIWiki retrieval is local Markdown/frontmatter search. It is not vector search, external search, or RAG-over-wiki.
323
176
 
324
- 检查知识库结构:
177
+ ## 5. Check and Maintain the Workspace
325
178
 
326
- ```bash
327
- aiwiki lint
179
+ Tell your assistant:
180
+
181
+ ```text
182
+ Check and organize my AIWiki workspace.
328
183
  ```
329
184
 
330
- 常用工作台模式:
185
+ The assistant should run:
331
186
 
332
187
  ```bash
333
- aiwiki lint --severity warning
334
188
  aiwiki lint --json
335
- aiwiki lint --no-write
336
- aiwiki lint --fix-empty-dirs --json
337
189
  ```
338
190
 
339
- `lint` 会先输出 `lint_summary`、`safe_fixes`、`top_issue` 和报告路径,再按 Errors / Warnings / Info 分组展示问题。每个问题会尽量给出建议动作,例如 `enrich`、`fix_link`、`reingest`、`archive`、`mark_reviewed` 或 `remove_empty_optional_dir`。`--severity` 只查看指定级别,`--json` 给宿主 Agent 使用,`--no-write` 只在终端检查而不更新 `dashboards/Lint Report.md`。`--fix-empty-dirs --json` 只会删除已知且为空的可选增强目录,并在 `safe_fixes.applied` 里报告删除了什么。
340
-
341
- 查看下一步建议:
191
+ If only safe fixes are available and you allow cleanup:
342
192
 
343
193
  ```bash
344
- aiwiki next
194
+ aiwiki lint --fix-empty-dirs --json
195
+ aiwiki lint --json
345
196
  ```
346
197
 
347
- 默认情况下,`lint` 输出报告并写入 `dashboards/Lint Report.md`。
198
+ Current automatic safe fix:
348
199
 
349
- ## 8. 高级调试
200
+ - remove known empty optional enhancement directories
350
201
 
351
- 如果 Agent 只能输出 JSON,才需要手动保存 payload:
202
+ AIWiki must not delete core directories, unknown directories, non-empty directories, or files as a safe fix.
352
203
 
353
- ```bash
354
- aiwiki ingest-agent --payload "F:\knowledge_data\payload.json"
355
- ```
204
+ ## 6. Generated Artifacts
356
205
 
357
- 也可以用 stdin:
206
+ Core artifacts:
358
207
 
359
- ```bash
360
- type "F:\knowledge_data\payload.json" | aiwiki ingest-agent --stdin
361
- ```
362
-
363
- 本地 Markdown 文件:
364
-
365
- ```bash
366
- aiwiki ingest-file --file "F:\knowledge_data\article.md"
208
+ ```text
209
+ 09-runs/<run-id>/payload.json
210
+ 09-runs/<run-id>/raw.md
211
+ 09-runs/<run-id>/source-card.md
212
+ 09-runs/<run-id>/wiki-entry.md
213
+ 09-runs/<run-id>/processing-summary.md
214
+ 02-raw/articles/
215
+ 03-sources/article-cards/
216
+ 05-wiki/source-knowledge/
367
217
  ```
368
218
 
369
- 命名规则:
370
- - 本地 `md` 导入时,AIWiki 优先使用文件标题或文件名生成外部文件名。
371
- - 不会优先从正文内容里的 `# 一级标题` 反推文件名,避免整理后的文件名失去来源可追踪性。
372
- - 如果文件名本身没有语义,才会继续回退到更弱的兜底命名。
219
+ Optional artifacts appear only when the assistant provides matching content or explicitly requests them:
373
220
 
374
- 链接加正文文件:
375
-
376
- ```bash
377
- aiwiki ingest-url "https://example.com/article" --content-file "F:\knowledge_data\article.md"
221
+ ```text
222
+ 09-runs/<run-id>/creative-assets.md
223
+ 09-runs/<run-id>/topics.md
224
+ 09-runs/<run-id>/draft-outline.md
225
+ 04-claims/_suggestions/
226
+ 06-assets/_suggestions/
227
+ 07-topics/ready/
228
+ 08-outputs/outlines/
378
229
  ```
379
230
 
380
- 注意:`ingest-url` 不会抓网页,只会读取 `--content-file`。
231
+ Wiki Entry quality modes:
381
232
 
382
- ## 9. 常见问题
233
+ - `agent_enriched` / `enriched`: the assistant provided analysis or wiki content.
234
+ - `deterministic_fallback` / `scaffold`: AIWiki created a traceable shell from source content only.
383
235
 
384
- ### 找不到 `aiwiki` 命令
236
+ First-run success checklist:
385
237
 
386
- 本地仓库测试时重新执行:
238
+ - `09-runs/<run-id>/processing-summary.md` exists
239
+ - a raw record exists under `02-raw/articles/`
240
+ - a Source Card exists under `03-sources/article-cards/`
241
+ - a Wiki Entry exists under `05-wiki/source-knowledge/`
242
+ - `aiwiki query "<topic>" --path <workspace>` returns a relevant match
243
+ - `aiwiki context "<topic>" --path <workspace>` returns machine-readable context for the assistant
244
+ - `aiwiki lint --json --path <workspace>` returns structured workspace feedback
387
245
 
388
- ```bash
389
- cd "<AIWiki 仓库路径>"
390
- npm run build
391
- npm link
392
- ```
246
+ ## 7. Obsidian and Dataview
393
247
 
394
- ### `doctor` 提示没有默认知识库
248
+ AIWiki writes plain Markdown and frontmatter.
395
249
 
396
- 运行:
250
+ Obsidian is optional. Dataview is optional. AIWiki does not edit `.obsidian`, install plugins, or require Dataview to query the knowledge base.
397
251
 
398
- ```bash
399
- aiwiki setup --path "F:\knowledge_data\aiwiki" --yes
400
- ```
401
-
402
- ### 宿主 Agent 抓不到网页
252
+ `aiwiki setup` creates dashboard and schema files when missing and preserves user-edited files.
403
253
 
404
- 这是宿主 Agent 的网页读取问题,不是 AIWiki CLI 的问题。让宿主 Agent 生成 `fetch_status=failed` 的 payload,AIWiki 会记录失败原因。
254
+ ## 8. Troubleshooting
405
255
 
406
- ### 想换默认知识库目录
256
+ ### The `aiwiki` command is missing
407
257
 
408
- 重新运行:
258
+ Ask your assistant to reinstall globally:
409
259
 
410
260
  ```bash
411
- aiwiki setup --path "新的知识库路径" --yes
261
+ npm install -g @itradingai/aiwiki@latest
262
+ aiwiki --version
412
263
  ```
413
264
 
414
- ## 10. 最小验收清单
265
+ ### The assistant still searches files directly
415
266
 
416
- 完成一次 Agent 入库测试后,检查:
267
+ Run:
417
268
 
418
269
  ```bash
419
- aiwiki status
270
+ aiwiki agent sync --yes
271
+ aiwiki agent sync --path <workspace> --yes
272
+ aiwiki agent check --path <workspace> --json
420
273
  ```
421
274
 
422
- 验收标准:
423
-
424
- - `run_count` 增加。
425
- - `09-runs` 下出现新目录。
426
- - `processing-summary.md` 存在。
427
- - 成功读取时,`03-sources/article-cards` 下出现资料卡。
428
- - 成功读取时,`05-wiki/source-knowledge` 下出现 Wiki Entry。
429
- - 抓取失败时,`09-runs/<run-id>-fetch-failed` 下出现失败记录。
430
- # System Purpose Files
431
-
432
- `aiwiki setup` now also seeds `_system/purpose.md`, `_system/index.md`, and `_system/log.md` when they are missing. These files give humans and host Agents a stable entry point for the knowledge-base goal, scope, common folders, common commands, and lightweight event notes. Re-running setup preserves user edits.
433
-
434
- ## Diagnostic Commands
275
+ Then restart or reload the assistant if needed.
435
276
 
436
- `aiwiki doctor` checks the workspace directories, write permission, and required system files: `_system/purpose.md`, `_system/index.md`, and `_system/log.md`.
277
+ The assistant should use `aiwiki lint`, `aiwiki status`, `aiwiki query`, `aiwiki context`, `aiwiki ingest-file`, or `aiwiki ingest-agent` before falling back to generic file search.
437
278
 
438
- `aiwiki status` keeps the existing run-count summary and also reports:
279
+ ### The assistant cannot read a webpage
439
280
 
440
- - `fallback_entries`: Wiki entries generated as deterministic fallback/scaffold.
441
- - `grounding_review_entries`: Wiki entries marked for grounding review.
442
- - `lint_status`: whether a lint report is missing, clean, or needs attention.
443
- - `system_files`: readiness of purpose, index, and log files.
444
- - `next_action`: the recommended next command.
281
+ That is a host assistant access issue, not an AIWiki crawler failure. Ask the assistant to record a failed fetch payload so the attempt remains traceable.
445
282
 
446
- `aiwiki next` uses the same repair order: fix workspace structure first, then lint errors, lint warnings, empty-workspace onboarding, and finally healthy-state query guidance.
283
+ ### You want to move the default workspace
447
284
 
448
- ## Query and Context Filters
449
-
450
- `aiwiki context` and `aiwiki query` use local Markdown/frontmatter search. They do not use vector search, a database, external search, or RAG-over-wiki.
451
-
452
- Useful filters:
285
+ Run:
453
286
 
454
287
  ```bash
455
- aiwiki context "AI Agent" --type wiki_entries --source-role input --wiki-type source_knowledge --status active --limit 5
456
- aiwiki query "AI Agent" --type source_cards --status to-review --limit 3
288
+ aiwiki setup --path <new-workspace> --yes
289
+ aiwiki agent sync --path <new-workspace> --yes
290
+ aiwiki agent check --path <new-workspace> --json
457
291
  ```
458
292
 
459
- Supported filters:
460
-
461
- - `--type`: one result group, such as `wiki_entries`, `source_cards`, `claims`, `topics`, `outlines`, or `raw_refs`.
462
- - `--source-role`: frontmatter `source_role`, usually `input`, `processing`, or `output`.
463
- - `--wiki-type`: frontmatter `wiki_type`, such as `source_knowledge` or `personal_knowledge`.
464
- - `--status`: frontmatter status, such as `active`, `to-review`, `ready`, or `draft`.
465
- - `--limit`: per-group result limit, clamped from 1 to 50.
466
-
467
- The JSON result keeps the stable `schema_version: "aiwiki.context.v1"` and now also includes:
468
-
469
- - `query_scope`: filters, limit, and searched groups.
470
- - `result_quality`: total matches, best score, whether a Wiki Entry was found, and warnings.
471
- - `recommended_next_action`: for example `use_matches_for_answer`, `review_grounding_or_enrich_entry`, or `broaden_query_or_ingest_source`.
472
- - Per match: `match_reasons`, `quality_signals`, and `related_refs`.
473
-
474
- Use `match_reasons` to explain why a result matched. Use `quality_signals` before answering confidently: scaffold or grounding-review entries should be treated as traceable leads, not final knowledge.
293
+ ### You want to give trial feedback
475
294
 
476
- ## Agent Skill Sync
295
+ Use [`TRIAL_FEEDBACK_TEMPLATE.md`](TRIAL_FEEDBACK_TEMPLATE.md). The template captures setup, first ingest, query/context reuse, lint/doctor clarity, and the user's practical scenario without adding a new AIWiki command.
477
296
 
478
- AIWiki does not modify Agent configuration during `npm install`. After first install or upgrade, sync the packaged skill explicitly:
297
+ ## 9. Local Development
479
298
 
480
- ```bash
481
- aiwiki agent sync --yes
482
- aiwiki agent check
483
- ```
484
-
485
- For one host Agent:
299
+ For repository development:
486
300
 
487
301
  ```bash
488
- aiwiki agent sync --agent codex --yes
489
- aiwiki agent sync --agent claude --yes
302
+ npm install
303
+ npm run build
304
+ npm test
305
+ npm link
490
306
  ```
491
307
 
492
- Useful Agent-facing options:
308
+ Use a temporary test workspace:
493
309
 
494
310
  ```bash
495
- aiwiki agent sync --dry-run
496
- aiwiki agent sync --json --yes
497
- aiwiki agent check --json
498
- aiwiki agent help
499
- aiwiki context --help
311
+ aiwiki setup --path "./aiwiki-test" --yes
312
+ aiwiki doctor --path "./aiwiki-test"
313
+ aiwiki status --path "./aiwiki-test"
500
314
  ```
501
-
502
- `agent sync` is safe for first install and cross-version upgrades. It installs missing targets, leaves current targets unchanged, and backs up changed installed skill files before overwrite. If a backup is created, tell the user the backup path and that rollback means copying the backup file back to the target path.