You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+94-34Lines changed: 94 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -162,33 +162,50 @@ OpenKB commands fall into two layers: the **wiki foundation** (compile + manage
162
162
| Command | Description |
163
163
|---|---|
164
164
|`openkb init`| Initialize a new knowledge base (interactive) |
165
-
| <code>openkb add <file_or_dir_or_URL></code> | Add documents and compile to wiki. URL ingest auto-detects PDF (saved as `.pdf` → PageIndex / markitdown) vs HTML (trafilatura main-content extract → `.md`) |
166
-
| <code>openkb remove <doc></code> | Remove a document and clean up its wiki pages, images, registry, and PageIndex state (use `--dry-run` to preview, `--keep-raw` / `--keep-empty` to retain artifacts) |
167
-
| <code>openkb recompile [<doc>] [--all]</code> | Re-run the current compile pipeline on already-indexed docs (e.g. to backfill the `entities/` layer) without re-indexing. Regenerates summaries and rewrites concept pages; manual edits are overwritten. Use `--dry-run` to preview, `--refresh-schema` to also update `wiki/AGENTS.md`|
168
-
|`openkb watch`| Watch `raw/` and auto-compile new files |
169
-
|`openkb lint`| Run structural + knowledge health checks |
165
+
| <code>openkb add <file_or_dir_or_URL></code> | Add files, directories, or URLs and compile to wiki. URLs auto-detect content type (PDF or HTML) |
170
166
|`openkb list`| List indexed documents and concepts |
171
167
|`openkb status`| Show knowledge base stats |
168
+
|`openkb watch`| Watch `raw/` and auto-compile new files |
169
+
|`openkb lint`| Run structural + knowledge health checks |
170
+
171
+
<details>
172
+
<summary><i>More wiki commands:</i></summary>
173
+
174
+
| Command | Description |
175
+
|---|---|
176
+
| <code>openkb remove <doc></code> | Remove a document and clean up its wiki pages, images, registry, and PageIndex state (use `--dry-run` to preview, `--keep-raw` / `--keep-empty` to retain artifacts) |
177
+
| <code>openkb recompile [<doc>] [--all]</code> | Re-run the current compile pipeline on already-indexed docs without re-indexing. Regenerates summaries and rewrites concept pages; manual edits are overwritten. Use `--dry-run` to preview, `--refresh-schema` to also update `wiki/AGENTS.md`|
172
178
| <code>openkb feedback ["msg"]</code> | File feedback by opening a prefilled GitHub issue (use `--type bug/feature/question` to tag the issue) |
173
179
174
180
<!-- | `openkb lint --fix` | Auto-fix what it can | -->
175
181
182
+
</details>
183
+
176
184
## ✨ Generators — turn the wiki into output
177
185
178
186
A "generator" reads from the compiled wiki and produces something usable: an answer, a conversation, a skill folder. The wiki is the substrate; generators are the surfaces.
179
187
180
188
| Command | Output |
181
189
|---|---|
182
190
| <code>openkb query "question"</code> | A grounded answer with citations (use `--save` to persist to `wiki/explorations/`) |
183
-
|`openkb chat`| Interactive multi-turn session over the wiki (use `--resume`, `--list`, `--delete` to manage sessions) |
184
-
| <code>openkb skill new <name> "<intent>"</code> | A redistributable Anthropic Skill at `<kb>/output/skills/<name>/` + auto-updated `marketplace.json`|
185
-
| <code>openkb skill validate [name]</code> | Structural lint of compiled skills (frontmatter, file sizes, wikilinks, scripts/ stdlib check with `--strict`). Auto-runs at end of `skill new`|
191
+
| <code>openkb chat</code> | Interactive multi-turn session over the wiki (use `--resume`, `--list`, `--delete` to manage sessions) |
192
+
|||
193
+
| <code>openkb skill new <name> "<intent>"</code> | A redistributable agent skill — see [Skill Factory](#-skill-factory--drop-in-a-book-out-comes-a-digital-expert) below |
194
+
195
+
<details>
196
+
<summary><i>More skill commands:</i></summary>
197
+
198
+
| Command | Output |
199
+
|---|---|
200
+
| <code>openkb skill validate [name]</code> | Validate compiled skills (YAML frontmatter, file sizes, wikilinks, scripts). Auto-runs at end of `skill new`. Use `--strict` to treat warnings as failures |
186
201
| <code>openkb skill eval <name></code> | Trigger-accuracy evaluation: does the `description:` field actually fire? LLM generates eval prompts; grader LLM scores activation. `--save` persists the eval set |
187
-
| <code>openkb skill history <name></code> / <code>openkb skill rollback <name></code> | Iteration workspace: every overwrite saves the previous version to `output/skills/<name>-workspace/iteration-N/` with a structural diff. Rollback restores any iteration |
202
+
| <code>openkb skill history <name></code> / <code>openkb skill rollback <name></code> | Version history for skills. Each overwrite saves the previous version to `iteration-N/` with a diff. Rollback restores any iteration |
203
+
204
+
</details>
188
205
189
206
### Query & Chat — ask the wiki
190
207
191
-
`openkb query "..."` answers a single question. `openkb chat` is interactive — each turn carries history, so you can dig into a topic without re-typing context. Both use the same underlying wiki and the same retrieval primitives (PageIndex for long docs, direct concept reads for short).
208
+
`openkb query "..."` answers a single question. `openkb chat` is interactive; each turn carries history, so you can dig into a topic without re-typing context. Both use the same underlying wiki and the same retrieval primitives (PageIndex for long docs, direct concept reads for short).
192
209
193
210
```bash
194
211
openkb query "What does the literature say about attention scaling?"
Inside a chat, type `/` to access slash commands (Tab to complete):
204
221
222
+
<details>
223
+
<summary><i>Slash commands</i></summary>
224
+
205
225
-`/help` — list available commands
206
226
-`/status` — show knowledge base status
207
227
-`/list` — list all documents
@@ -212,6 +232,8 @@ Inside a chat, type `/` to access slash commands (Tab to complete):
212
232
-`/lint` — run knowledge base lint
213
233
-`/exit` — exit (Ctrl-D also works)
214
234
235
+
</details>
236
+
215
237
### 🛠 Skill Factory — *Drop in a book. Out comes a digital expert.*
216
238
217
239
The newest generator. `openkb skill new` distills an [agent skill](https://docs.claude.com/en/docs/build-with-claude/skills) from any subset of your wiki, a portable folder that major agents (Claude Code, Codex, etc.) install and load natively. Drop in a book's worth of papers; out comes a specialist that other agents can call on.
@@ -221,7 +243,8 @@ openkb skill new karpathy-thinking \
221
243
"Reason about transformers and attention in Karpathy's style"
222
244
```
223
245
224
-
This produces:
246
+
<details>
247
+
<summary><i>Output</i></summary>
225
248
226
249
```
227
250
<kb>/output/skills/karpathy-thinking/
@@ -234,19 +257,32 @@ This produces:
234
257
235
258
…plus an auto-updated `<kb>/.claude-plugin/marketplace.json` so the whole KB is one-line installable.
**Share with others** — push your KB to GitHub, then anyone runs:
269
+
</details>
270
+
271
+
<details>
272
+
<summary><i>Share with others</i></summary>
273
+
274
+
Push your KB to GitHub, then anyone runs:
244
275
245
276
```bash
246
277
npx skills@latest add <your-org>/<your-repo>
247
278
```
248
279
249
-
**Iterate from chat** — compilation is one-shot, but follow-up edits aren't. Inside `openkb chat`, you can refine without re-running the whole pipeline:
280
+
</details>
281
+
282
+
<details>
283
+
<summary><i>Iterate from chat</i></summary>
284
+
285
+
Compilation is one-shot, but follow-up edits aren't. Inside `openkb chat`, you can refine without re-running the whole pipeline:
250
286
251
287
```
252
288
/skill new karpathy-thinking "Reason about transformers like Karpathy"
**Quality gates** — structural validation, trigger-accuracy + body-coverage evaluation, and full history/rollback:
294
+
</details>
295
+
296
+
<details>
297
+
<summary><i>Quality gates</i></summary>
298
+
299
+
Structural validation, trigger-accuracy + body-coverage evaluation, and full history/rollback:
259
300
260
301
```bash
261
302
# Lint structure (auto-runs at end of `skill new`)
@@ -270,7 +311,11 @@ openkb skill history karpathy-thinking
270
311
openkb skill rollback karpathy-thinking --to 2
271
312
```
272
313
273
-
### Configuration
314
+
</details>
315
+
316
+
# 🔧 Configuration
317
+
318
+
### Settings
274
319
275
320
Settings are initialized by `openkb init`, and stored in `.openkb/config.yaml`:
276
321
@@ -280,6 +325,17 @@ language: en # Wiki output language
280
325
pageindex_threshold: 20# PDF pages threshold for PageIndex
281
326
```
282
327
328
+
Model names use `provider/model` LiteLLM [format](https://docs.litellm.ai/docs/providers) (OpenAI models can omit the prefix):
329
+
330
+
| Provider | Model example |
331
+
|---|---|
332
+
| OpenAI | `gpt-5.4` |
333
+
| Anthropic | `anthropic/claude-sonnet-4-6` |
334
+
| Gemini | `gemini/gemini-3.1-pro-preview` |
335
+
336
+
<details>
337
+
<summary><i>Advanced options</i></summary>
338
+
283
339
`entity_types` (optional): a YAML list overriding the entity-type vocabulary used for entity pages; omit it to use the default `person`, `organization`, `place`, `product`, `work`, `event`, `other`.
284
340
285
341
`extra_headers` (optional): a YAML mapping of extra HTTP headers sent with every LLM request (forwarded to LiteLLM's `extra_headers`). Useful for providers that expect custom headers, e.g. GitHub Copilot IDE-auth headers:
@@ -292,22 +348,15 @@ extra_headers:
292
348
293
349
Subscription-based providers that authenticate via OAuth device flow (e.g. `chatgpt/*`, `github_copilot/*`) need no API key; OpenKB skips the missing-key warning for them.
294
350
295
-
Model names use `provider/model` LiteLLM [format](https://docs.litellm.ai/docs/providers) (OpenAI models can omit the prefix):
296
-
297
-
| Provider | Model example |
298
-
|---|---|
299
-
| OpenAI | `gpt-5.4` |
300
-
| Anthropic | `anthropic/claude-sonnet-4-6` |
301
-
| Gemini | `gemini/gemini-3.1-pro-preview` |
351
+
</details>
302
352
303
-
### PageIndex Integration
353
+
### PageIndex
304
354
305
-
Long documents are challenging for LLMs due to context limits, context rot, and summarization loss.
306
-
[PageIndex](https://github.com/VectifyAI/PageIndex) solves this with vectorless, reasoning-based retrieval, building a hierarchical tree index that lets LLMs reason over the index for context-aware retrieval.
355
+
Long-document retrieval is a [known challenge](https://x.com/karpathy/status/2039823314982744522) for LLMs. [PageIndex](https://github.com/VectifyAI/PageIndex) solves this with vectorless, reasoning-based retrieval, building a hierarchical tree index that lets LLMs reason over the index for context-aware retrieval.
307
356
308
357
PageIndex runs locally by default using the [open-source version](https://github.com/VectifyAI/PageIndex), with no external dependencies required.
309
358
310
-
#### Optional: Cloud Support
359
+
#### Cloud Support (Optional)
311
360
312
361
For large or complex PDFs, [PageIndex Cloud](https://docs.pageindex.ai/) can be used to access additional capabilities, including:
313
362
@@ -327,6 +376,8 @@ The `wiki/AGENTS.md` file defines wiki structure and conventions. It's the LLM's
327
376
328
377
At runtime, the LLM reads `AGENTS.md` from disk, so your edits take effect immediately.
329
378
379
+
# 🔌 Integrations
380
+
330
381
### Using with Obsidian
331
382
332
383
OpenKB's wiki is a directory of Markdown files with `[[wikilinks]]`. Obsidian renders it natively.
@@ -340,27 +391,36 @@ OpenKB's wiki is a directory of Markdown files with `[[wikilinks]]`. Obsidian re
340
391
341
392
OpenKB ships a `SKILL.md` so any agent CLI can read your compiled wiki. No extra runtime, no MCP setup, just install the skill once.
The skill is read-only; it won't run `openkb add`, `remove`, or `lint --fix` without you asking. See [`skills/openkb/SKILL.md`](skills/openkb/SKILL.md) for the full instruction set.
0 commit comments