Skip to content

Commit 8ab9a33

Browse files
authored
Merge pull request #109 from VectifyAI/restructure-readme
update readme
2 parents 8dde0e8 + 310f6e5 commit 8ab9a33

1 file changed

Lines changed: 94 additions & 34 deletions

File tree

README.md

Lines changed: 94 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -162,33 +162,50 @@ OpenKB commands fall into two layers: the **wiki foundation** (compile + manage
162162
| Command | Description |
163163
|---|---|
164164
| `openkb init` | Initialize a new knowledge base (interactive) |
165-
| <code>openkb&nbsp;add&nbsp;&lt;file_or_dir_or_URL&gt;</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&nbsp;remove&nbsp;&lt;doc&gt;</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&nbsp;recompile&nbsp;[&lt;doc&gt;]&nbsp;[--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&nbsp;add&nbsp;&lt;file_or_dir_or_URL&gt;</code> | Add files, directories, or URLs and compile to wiki. URLs auto-detect content type (PDF or HTML) |
170166
| `openkb list` | List indexed documents and concepts |
171167
| `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&nbsp;remove&nbsp;&lt;doc&gt;</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&nbsp;recompile&nbsp;[&lt;doc&gt;]&nbsp;[--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` |
172178
| <code>openkb&nbsp;feedback&nbsp;["msg"]</code> | File feedback by opening a prefilled GitHub issue (use `--type bug/feature/question` to tag the issue) |
173179

174180
<!-- | `openkb lint --fix` | Auto-fix what it can | -->
175181

182+
</details>
183+
176184
## ✨ Generators — turn the wiki into output
177185

178186
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.
179187

180188
| Command | Output |
181189
|---|---|
182190
| <code>openkb&nbsp;query&nbsp;"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&nbsp;skill&nbsp;new&nbsp;&lt;name&gt;&nbsp;"&lt;intent&gt;"</code> | A redistributable Anthropic Skill at `<kb>/output/skills/<name>/` + auto-updated `marketplace.json` |
185-
| <code>openkb&nbsp;skill&nbsp;validate&nbsp;[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&nbsp;chat</code> | Interactive multi-turn session over the wiki (use `--resume`, `--list`, `--delete` to manage sessions) |
192+
| | |
193+
| <code>openkb&nbsp;skill&nbsp;new&nbsp;&lt;name&gt;&nbsp;"&lt;intent&gt;"</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&nbsp;skill&nbsp;validate&nbsp;[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 |
186201
| <code>openkb&nbsp;skill&nbsp;eval&nbsp;&lt;name&gt;</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&nbsp;skill&nbsp;history&nbsp;&lt;name&gt;</code> / <code>openkb&nbsp;skill&nbsp;rollback&nbsp;&lt;name&gt;</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&nbsp;skill&nbsp;history&nbsp;&lt;name&gt;</code> / <code>openkb&nbsp;skill&nbsp;rollback&nbsp;&lt;name&gt;</code> | Version history for skills. Each overwrite saves the previous version to `iteration-N/` with a diff. Rollback restores any iteration |
203+
204+
</details>
188205

189206
### Query & Chat — ask the wiki
190207

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).
192209

193210
```bash
194211
openkb query "What does the literature say about attention scaling?"
@@ -202,6 +219,9 @@ openkb chat --delete <id> # delete a session
202219

203220
Inside a chat, type `/` to access slash commands (Tab to complete):
204221

222+
<details>
223+
<summary><i>Slash commands</i></summary>
224+
205225
- `/help` — list available commands
206226
- `/status` — show knowledge base status
207227
- `/list` — list all documents
@@ -212,6 +232,8 @@ Inside a chat, type `/` to access slash commands (Tab to complete):
212232
- `/lint` — run knowledge base lint
213233
- `/exit` — exit (Ctrl-D also works)
214234

235+
</details>
236+
215237
### 🛠 Skill Factory — *Drop in a book. Out comes a digital expert.*
216238

217239
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 \
221243
"Reason about transformers and attention in Karpathy's style"
222244
```
223245

224-
This produces:
246+
<details>
247+
<summary><i>Output</i></summary>
225248

226249
```
227250
<kb>/output/skills/karpathy-thinking/
@@ -234,19 +257,32 @@ This produces:
234257

235258
…plus an auto-updated `<kb>/.claude-plugin/marketplace.json` so the whole KB is one-line installable.
236259

237-
**Install locally:**
260+
</details>
261+
262+
<details>
263+
<summary><i>Install locally</i></summary>
238264

239265
```bash
240266
cp -r output/skills/karpathy-thinking ~/.claude/skills/
241267
```
242268

243-
**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:
244275

245276
```bash
246277
npx skills@latest add <your-org>/<your-repo>
247278
```
248279

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:
250286

251287
```
252288
/skill new karpathy-thinking "Reason about transformers like Karpathy"
@@ -255,7 +291,12 @@ npx skills@latest add <your-org>/<your-repo>
255291
[agent edits SKILL.md frontmatter in place]
256292
```
257293

258-
**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:
259300

260301
```bash
261302
# Lint structure (auto-runs at end of `skill new`)
@@ -270,7 +311,11 @@ openkb skill history karpathy-thinking
270311
openkb skill rollback karpathy-thinking --to 2
271312
```
272313

273-
### Configuration
314+
</details>
315+
316+
# 🔧 Configuration
317+
318+
### Settings
274319

275320
Settings are initialized by `openkb init`, and stored in `.openkb/config.yaml`:
276321

@@ -280,6 +325,17 @@ language: en # Wiki output language
280325
pageindex_threshold: 20 # PDF pages threshold for PageIndex
281326
```
282327
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+
283339
`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`.
284340

285341
`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:
292348

293349
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.
294350

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>
302352

303-
### PageIndex Integration
353+
### PageIndex
304354

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.
307356

308357
PageIndex runs locally by default using the [open-source version](https://github.com/VectifyAI/PageIndex), with no external dependencies required.
309358

310-
#### Optional: Cloud Support
359+
#### Cloud Support (Optional)
311360

312361
For large or complex PDFs, [PageIndex Cloud](https://docs.pageindex.ai/) can be used to access additional capabilities, including:
313362

@@ -327,6 +376,8 @@ The `wiki/AGENTS.md` file defines wiki structure and conventions. It's the LLM's
327376

328377
At runtime, the LLM reads `AGENTS.md` from disk, so your edits take effect immediately.
329378

379+
# 🔌 Integrations
380+
330381
### Using with Obsidian
331382

332383
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
340391

341392
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.
342393

343-
**Claude Code**:
394+
<details>
395+
<summary><b>Claude Code</b></summary>
344396

345397
```
346398
/plugin marketplace add VectifyAI/OpenKB
347399
/plugin install openkb@vectify
348400
```
349401
350-
**Gemini CLI**:
351-
352-
```bash
353-
gemini skills install https://github.com/VectifyAI/OpenKB.git --path skills/openkb --consent
354-
```
402+
</details>
355403
356-
**OpenAI Codex CLI** (no marketplace command yet; manual symlink):
404+
<details>
405+
<summary><b>OpenAI Codex CLI</b> <i>(no marketplace command yet; manual symlink)</i></summary>
357406
358407
```bash
359408
git clone https://github.com/VectifyAI/OpenKB.git ~/openkb-src
360409
mkdir -p ~/.agents/skills
361410
ln -s ~/openkb-src/skills/openkb ~/.agents/skills/openkb
362411
```
363412

413+
</details>
414+
415+
<details>
416+
<summary><b>Gemini CLI</b></summary>
417+
418+
```bash
419+
gemini skills install https://github.com/VectifyAI/OpenKB.git --path skills/openkb --consent
420+
```
421+
422+
</details>
423+
364424
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.
365425

366426
# 🧭 Learn More

0 commit comments

Comments
 (0)