@creativeaitools/agent-wiki 2.0.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 ADDED
@@ -0,0 +1,429 @@
1
+ # Agent Wiki
2
+
3
+ An Obsidian-compatible knowledge vault that AI agents can safely maintain.
4
+
5
+ Drop notes, PDFs, transcripts, links, or research into `_inbox/`. Agents promote them into source pages, extract claims and evidence, link entities and concepts, track open questions, flag contradictions, and compile the vault into machine-readable caches.
6
+
7
+ Agent Wiki supports two operating modes:
8
+
9
+ - **Vault wiki** — the current repository/vault structure. Raw files enter through `_inbox/`, agents promote them into `sources/`, and original raw files move to `raw/`.
10
+ - **Workspace wiki** — the same wiki structure stored inside a larger workspace, defaulting to `workspace/wiki`. The CLI discovers new or changed non-code files outside `wiki/`; agents decide which files become canonical source pages. Original workspace files stay in place and are never modified by the wiki workflow.
11
+
12
+ Most LLM wiki projects focus on generating and maintaining wiki pages.
13
+
14
+ Agent Wiki focuses on evidence-aware structured knowledge:
15
+
16
+ - claims
17
+ - evidence
18
+ - relations
19
+ - questions
20
+ - contradictions
21
+ - timelines
22
+ - compiled agent caches
23
+
24
+ It is markdown-first, Git-friendly, Obsidian-compatible, and designed for both humans and agents.
25
+
26
+ Inspired by Karpathy’s [LLM Wiki gist][karpathy-wiki].
27
+
28
+ [karpathy-wiki]: https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f
29
+
30
+ ## Why Agent Wiki exists
31
+
32
+ LLMs are useful when they have reliable context. They are unreliable when every task starts from a pile of raw files, old notes, chat logs, and half-remembered summaries.
33
+
34
+ Agent Wiki gives agents a maintained knowledge layer:
35
+
36
+ - sources stay separate from summaries
37
+ - claims stay separate from prose
38
+ - evidence stays attached to claims
39
+ - contradictions are tracked instead of hidden
40
+ - open questions remain visible
41
+ - generated caches can be rebuilt instead of hand-edited
42
+
43
+ The result is a vault humans can read and agents can compile into compact runtime context.
44
+
45
+ ## How it works
46
+
47
+ ```text
48
+ _inbox/
49
+ raw notes, PDFs, links, transcripts
50
+
51
+ sources/
52
+ canonical source pages
53
+
54
+ claims/ entities/ concepts/ questions/
55
+ structured knowledge primitives with evidence and relations
56
+
57
+ _system/cache/
58
+ compact agent-facing indexes
59
+
60
+ index.md overview.md reports/
61
+ human-facing generated views
62
+ ```
63
+
64
+ Structured evidence, relations, contradictions, and timeline events are stored in page frontmatter and compiled cache files rather than separate root folders.
65
+
66
+ ## Quick Start
67
+
68
+ Create and register a fresh vault wiki:
69
+
70
+ ```bash
71
+ npx agent-wiki init --type vault --root ./Business
72
+ npx agent-wiki registry add Business --root ./Business --type vault
73
+ npx agent-wiki --wiki Business onboard --check
74
+ npx agent-wiki --wiki Business compile
75
+ npx agent-wiki --wiki Business index --check
76
+ ```
77
+
78
+ Confirm registered wikis:
79
+
80
+ ```bash
81
+ npx agent-wiki list
82
+ ```
83
+
84
+ Create and register a workspace wiki inside an existing project:
85
+
86
+ ```bash
87
+ cd /path/to/workspace
88
+ npx agent-wiki init --type workspace --workspace-root . --wiki-dir wiki
89
+ npx agent-wiki registry add MyProject --root ./wiki --type workspace
90
+ npx agent-wiki --wiki MyProject onboard --check
91
+ npx agent-wiki --wiki MyProject workspace pending --workspace-root . --json
92
+ ```
93
+
94
+ Run deterministic onboarding directly against a path when a wiki is not registered:
95
+
96
+ ```bash
97
+ npx agent-wiki onboard --check --wiki-root /path/to/wiki
98
+ npx agent-wiki onboard --check --questions --wiki-root /path/to/wiki
99
+ ```
100
+
101
+ Use the JSON report for automation and the numbered questions only when a human needs to choose local setup policy. `ONBOARD.md` is the operator guide that explains this flow; the CLI report is the source of truth.
102
+
103
+ Track machine-local Agent Wiki roots:
104
+
105
+ ```bash
106
+ agent-wiki registry add Business --root /path/to/wiki --type vault
107
+ agent-wiki list
108
+ agent-wiki --wiki Business onboard --check
109
+ agent-wiki check --all
110
+ agent-wiki check --all --full
111
+ ```
112
+
113
+ The registry is local to the machine and stored outside any wiki at `~/.config/agent-wiki/registry.json`. `check --all` is light and read-only. `check --all --full` also runs compile and index validation.
114
+
115
+ For multiple fresh vault wikis:
116
+
117
+ ```bash
118
+ npx agent-wiki init --type vault --root ./Business
119
+ npx agent-wiki registry add Business --root ./Business --type vault
120
+ npx agent-wiki init --type vault --root ./Research
121
+ npx agent-wiki registry add Research --root ./Research --type vault
122
+ npx agent-wiki list
123
+ npx agent-wiki check --all
124
+ ```
125
+
126
+ Install the local CLI during development:
127
+
128
+ ```bash
129
+ npm install
130
+ npm run build
131
+ npm link
132
+ ```
133
+
134
+ Upgrade an existing v1.x wiki to the npm/TypeScript CLI layout:
135
+
136
+ ```bash
137
+ cd /path/to/wiki
138
+ npx agent-wiki migrate --from v1 --check
139
+ npx agent-wiki migrate --from v1 --write
140
+ ```
141
+
142
+ Check wiki health without changing files:
143
+
144
+ ```bash
145
+ agent-wiki doctor --wiki-root /path/to/wiki
146
+ agent-wiki --wiki Business doctor
147
+ ```
148
+
149
+ Ingest text or markdown from `_inbox/` in a new agent session:
150
+
151
+ ```text
152
+ Read AGENTS.md, then run the local process-inbox skill from skills/
153
+ ```
154
+
155
+ *Text and markdown ingest works out of the box.*
156
+
157
+ Then run the `extract-knowledge-primitives` skill to extract claims, evidence, relations, questions, and contradictions. From a new agent session:
158
+
159
+ ```text
160
+ Read AGENTS.md and run the local extract-knowledge-primitives skill from skills/
161
+ ```
162
+
163
+ Then compile the wiki:
164
+
165
+ ```text
166
+ Read AGENTS.md and run the local compile-wiki skill from skills/
167
+ ```
168
+
169
+ Write a durable synthesis when you need cross-source interpretation, a brief, a comparison, or a timeline narrative:
170
+
171
+ ```text
172
+ Read AGENTS.md and run the local write-synthesis skill from skills/
173
+ ```
174
+
175
+ Generate the overview landing page:
176
+
177
+ ```text
178
+ Read AGENTS.md and run the local update-overview skill from skills/
179
+ ```
180
+
181
+ For daily vault work, start a new agent session, then:
182
+
183
+ ```text
184
+ Read AGENTS.md, and WIKI.md sections 4.1, 5, 6, 7, 8, 12, and 13 before ordinary vault work.
185
+ Use AGENT-WIKI-SPEC-v2.md only for project changes, ambiguity, or missing runtime detail.
186
+ ```
187
+
188
+ These can all be scheduled as tasks for an agent.
189
+
190
+ ## Workspace Mode
191
+
192
+ Workspace mode is for projects where the wiki lives inside a larger project or company folder:
193
+
194
+ ```text
195
+ workspace/
196
+ docs/
197
+ research/
198
+ decisions/
199
+ wiki/
200
+ sources/
201
+ entities/
202
+ concepts/
203
+ ```
204
+
205
+ Discover source candidates outside the wiki directory:
206
+
207
+ ```bash
208
+ agent-wiki workspace pending --workspace-root /path/to/workspace --json
209
+ ```
210
+
211
+ The pending command reports files that are new or changed relative to local state. It returns path, modified time, size, extension, sha256, recommended source type, and any known source-page mapping. The command does not read files semantically, create pages, or modify source files.
212
+
213
+ Agents should use `skills/process-workspace-sources/SKILL.md` to review that worklist and create canonical source pages inside `wiki/sources/` with `originPath` pointing back to the workspace-relative source path. After source pages exist, the existing extraction and compile workflows apply unchanged.
214
+
215
+ After an agent creates a source page for a workspace file, it can record the local mapping:
216
+
217
+ ```bash
218
+ agent-wiki workspace mark-sourced \
219
+ --workspace-root /path/to/workspace \
220
+ --path docs/customer-research.md \
221
+ --source-id source.2026-06-26.document.customer-research \
222
+ --source-path sources/2026-06-26-document-customer-research.md
223
+ ```
224
+
225
+ ## Core documents
226
+
227
+ - [ONBOARD.md](ONBOARD.md) — first-run setup, onboarding probe, local configuration, and import-link setup.
228
+ - [AGENTS.md](AGENTS.md) — the agent behavior contract.
229
+ - [WIKI.md](WIKI.md) — page types, schemas, status enums, runtime examples, linking rules, and vault rules.
230
+ - [AGENT-WIKI-SPEC-v2.md](AGENT-WIKI-SPEC-v2.md) — full project contract for changing behavior, scripts, skills, configuration, or validation.
231
+
232
+ ## How Agent Wiki differs from other LLM wiki projects
233
+
234
+ Other LLM wiki projects focus on generating and maintaining wiki pages.
235
+
236
+ Agent Wiki focuses on evidence-aware structured knowledge. The wiki is not just prose; it is a vault of linked primitives that agents can safely maintain and compile.
237
+
238
+ | Area | Typical LLM wiki | Agent Wiki |
239
+ |---|---|---|
240
+ | Main output | Wiki pages | Wiki pages + structured knowledge primitives |
241
+ | Truth model | Summaries and links | Claims backed by evidence |
242
+ | Contradictions | Usually prose-level | First-class tracked objects |
243
+ | Runtime use | Read pages as context | Compile compact machine-facing caches |
244
+ | Human editing | Often mixed with generated content | Human and generated lanes stay separate |
245
+ | Agent safety | Prompt conventions | Explicit behavior contract and schemas |
246
+
247
+ ## What Agent Wiki produces
248
+
249
+ A maintained vault can produce human-readable pages and machine-facing artifacts such as:
250
+
251
+ ```text
252
+ sources/
253
+ canonical source pages
254
+
255
+ entities/
256
+ people, companies, projects, tools, locations, and other named things
257
+
258
+ concepts/
259
+ reusable ideas, patterns, methods, and definitions
260
+
261
+ claims/
262
+ atomic statements with source-backed evidence
263
+
264
+ questions/
265
+ unresolved issues, unknowns, and research targets
266
+
267
+ syntheses/
268
+ higher-level summaries and interpretations
269
+
270
+ reports/
271
+ generated human-readable views
272
+
273
+ _system/cache/
274
+ agent-digest.json
275
+ claims.jsonl
276
+ relations.jsonl
277
+ pages.json
278
+
279
+ _system/indexes/
280
+ generated machine-readable indexes
281
+ ```
282
+
283
+ ## Design principles
284
+
285
+ Agent Wiki is built around a few strict rules:
286
+
287
+ - Human-authored notes and agent-authored material should stay distinguishable.
288
+ - Sources are not the same thing as summaries.
289
+ - Claims should be traceable to evidence.
290
+ - Contradictions should be tracked, not hidden.
291
+ - Generated reports are views, not canonical truth.
292
+ - Compiled caches should be rebuilt by tools, not hand-edited.
293
+ - Agents should follow explicit schemas and behavior contracts.
294
+
295
+ ## Compile
296
+
297
+ The compiler is built into the TypeScript CLI:
298
+
299
+ ```bash
300
+ agent-wiki compile
301
+ ```
302
+
303
+ It reads vault pages and emits generated artifacts such as:
304
+
305
+ - `index.md`
306
+ - `_system/cache/pages.json`
307
+ - `_system/cache/claims.jsonl`
308
+ - `_system/cache/relations.jsonl`
309
+ - `_system/cache/agent-digest.json`
310
+ - `_system/cache/validation-issues.json`
311
+ - `_system/indexes/`
312
+ - `_system/logs/log.md`
313
+ - `reports/`
314
+
315
+ These outputs are generated artifacts. Do not hand-edit them, and do not treat reports or logs as primary truth. Durable orientation prose belongs in root documentation files such as `overview.md`, not `index.md`.
316
+
317
+ ## Skills
318
+
319
+ Skills live under `skills/`:
320
+
321
+ - `compile-wiki` regenerates the root page catalog, caches, indexes, logs, and reports.
322
+ - `import-link` imports external links and captures into canonical `source` pages after local configuration in `skills/import-link/config.json`. It uses `agent-wiki create-page` to write source pages. Large captures are partitioned into parent source pages and source parts.
323
+ - `process-inbox` promotes raw files dropped into `_inbox/` into canonical `source` pages and moves originals to `raw/`. It uses `agent-wiki create-page` to write source pages. Large documents are represented by a short parent source page plus source part pages under `sources/parts/`.
324
+ - `process-workspace-sources` promotes selected files discovered outside a workspace wiki into canonical `source` pages without modifying or moving the original workspace files.
325
+ - `extract-knowledge-primitives` extracts entities, concepts, claims, evidence, questions, and relations from sources. It uses `agent-wiki create-page` for new primitive page files. For large sources, extraction operates on source parts rather than the parent manifest.
326
+ - `write-synthesis` creates or refreshes durable synthesis pages for cross-source summaries, briefs, analyses, comparisons, and timeline narratives. It uses `agent-wiki create-page` for new synthesis page files.
327
+ - `update-overview` creates or refreshes root `overview.md` as the human-facing vault landing page.
328
+
329
+ The page scaffolder covers required frontmatter for `source`, `entity`, `concept`, `claim`, `question`, and `synthesis` pages. It does not invent optional metadata, evidence, relationships, body prose, source capture, synthesis judgment, or large-document split decisions.
330
+
331
+ ## Scheduled Work
332
+
333
+ This repo does not ship a scheduler, daemon, or background task runner. For recurring maintenance, use an external scheduled-agent harness such as Claude Desktop/Cowork, Cody, OpenClaw cron, or an OS scheduler that launches an agent task.
334
+
335
+ Generate ready-to-paste scheduled prompts from the local registry:
336
+
337
+ ```bash
338
+ agent-wiki schedule prompt process-inbox
339
+ agent-wiki schedule prompt extract-primitives
340
+ agent-wiki schedule prompt update-overview
341
+ ```
342
+
343
+ By default, each prompt targets all registered Agent Wiki roots from `agent-wiki list --json`. Target a subset by passing names:
344
+
345
+ ```bash
346
+ agent-wiki schedule prompt process-inbox Business Research
347
+ agent-wiki schedule prompt update-overview --wiki Business
348
+ ```
349
+
350
+ These commands only print prompts. They do not run the workflows. The scheduled agent should read each target wiki's `AGENTS.md` and `WIKI.md`, then follow the local skill:
351
+
352
+ - `skills/process-inbox/SKILL.md`
353
+ - `skills/extract-knowledge-primitives/SKILL.md`
354
+ - `skills/update-overview/SKILL.md`
355
+
356
+ Recommended cadences:
357
+
358
+ - process inbox daily around 1:00 AM
359
+ - extract knowledge primitives daily around 7:00 AM
360
+ - update overview daily around 5:30 PM
361
+
362
+ Re-run compile after meaningful vault changes so `index.md`, caches, indexes, logs, and reports stay current.
363
+
364
+ ## Customization
365
+
366
+ Treat this repository as a foundation for your own wiki, not a finished off-the-shelf knowledge system.
367
+
368
+ You will likely customize:
369
+
370
+ - domain-specific page conventions
371
+ - source import settings
372
+ - extraction prompts and review workflows
373
+ - maintenance schedules
374
+ - ontology and relationship vocabularies
375
+
376
+ Use [WIKI.md section 4.1](WIKI.md#41-common-runtime-schemas) for ordinary wiki work. Keep [AGENT-WIKI-SPEC-v2.md](AGENT-WIKI-SPEC-v2.md) as the source of truth when changing schema, script, skill, configuration, or validation behavior.
377
+
378
+ ## Updating an Existing Agent Wiki
379
+
380
+ Before updating, commit or back up your current vault. Updates may change root documentation, scripts, skills, configuration templates, and generated behavior.
381
+
382
+ To update from the upstream repository:
383
+
384
+ ```bash
385
+ git fetch origin --tags
386
+ git checkout main
387
+ git pull --ff-only origin main
388
+ ```
389
+
390
+ To update to a specific release tag instead of the latest `main`:
391
+
392
+ ```bash
393
+ git fetch origin --tags
394
+ git checkout v1.4.0
395
+ ```
396
+
397
+ Do not overwrite local `_system/config.json`; it is local-only operator policy. Compare `_system/config.example.json` after updating and copy only settings you explicitly want.
398
+
399
+ After updating, run the onboarding probe and compile pipeline:
400
+
401
+ ```bash
402
+ agent-wiki onboard --check
403
+ agent-wiki compile
404
+ ```
405
+
406
+ If the release notes mention a migration script, run its dry-run mode first and review the planned changes before applying it.
407
+
408
+ ## Development Workflow
409
+
410
+ Changes to this project should move from contract to implementation in a consistent order.
411
+
412
+ When adding a feature or changing project behavior:
413
+
414
+ 1. Update [AGENT-WIKI-SPEC-v2.md](AGENT-WIKI-SPEC-v2.md) first.
415
+ 2. Update configuration files or configuration templates when the change affects operator policy, defaults, or local setup.
416
+ 3. Update deterministic scripts.
417
+ 4. Update skill instructions and skill-local support files.
418
+ 5. Update root-level Markdown documentation other than the specification.
419
+
420
+ Skip any step that the change does not affect. The specification should be reviewed first because it defines the contract that configuration, scripts, skills, and root-level documentation implement.
421
+
422
+ ## Harness and Models
423
+
424
+ This project has been tested and working with:
425
+
426
+ - OpenCode on Windows (PowerShell) + Kimi K2.6 (openrouter)
427
+ - Claude Desktop on Windows + Sonnet 4.6 (low)
428
+ - Claude CLI on WSL2 + Sonnet 4.6
429
+ - Codex CLI on Windows (PowerShell) and WSL2 + GPT-5.4