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
+91-17Lines changed: 91 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,17 +22,7 @@ The idea is based on a [concept](https://x.com/karpathy/status/20398056595256445
22
22
23
23
Traditional RAG rediscovers knowledge from scratch on every query. Nothing accumulates. OpenKB compiles knowledge once into a persistent wiki, then keeps it current. Cross-references already exist. Contradictions are flagged. Synthesis reflects everything consumed.
24
24
25
-
### Features
26
-
27
-
-**Broad format support** — PDF, Word, Markdown, PowerPoint, HTML, Excel, text, and more via markitdown
28
-
-**Scale to long documents** — Long and complex documents are handled via [PageIndex](https://github.com/VectifyAI/PageIndex) tree indexing, enabling accurate, vectorless long-context retrieval
29
-
-**Native multi-modality** — Retrieves and understands figures, tables, and images, not just text
30
-
-**Compiled Wiki** — LLM manages and compiles your documents into summaries, concept pages, and cross-links, all kept in sync
31
-
-**Query** — Ask questions (one-off) against your wiki. The LLM navigates your compiled knowledge to answer
32
-
-**Interactive Chat** — Multi-turn conversations with persisted sessions you can resume across runs
33
-
-**Lint** — Health checks find contradictions, gaps, orphans, and stale content
34
-
-**Watch mode** — Drop files into `raw/`, wiki updates automatically
35
-
-**Obsidian compatible** — Wiki is plain `.md` files with `[[wikilinks]]`. Open in Obsidian for graph view and browsing
25
+
OpenKB has two layers: a **wiki foundation** that compiles and maintains your knowledge, and **generators** (query / chat / Skill Factory) that turn it into useful output. See [Usage](#️-usage) for the full command list.
36
26
37
27
# 🚀 Getting Started
38
28
@@ -80,6 +70,9 @@ openkb query "What are the main findings?"
80
70
81
71
# 5. Or chat interactively
82
72
openkb chat
73
+
74
+
# 6. Or distill your wiki into a redistributable skill
75
+
openkb skill new my-expert "Reason like an expert on <topic-from-your-docs>"
83
76
```
84
77
85
78
### Set up your LLM
@@ -109,7 +102,7 @@ raw/ You drop files here
109
102
│ Wiki Compilation (using LLM)
110
103
│ │
111
104
▼ ▼
112
-
wiki/
105
+
wiki/ │ ← the foundation
113
106
├── index.md Knowledge base overview
114
107
├── log.md Operations timeline
115
108
├── AGENTS.md Wiki schema (LLM instructions)
@@ -118,6 +111,13 @@ wiki/
118
111
├── concepts/ Cross-document synthesis ← the good stuff
119
112
├── explorations/ Saved query results
120
113
└── reports/ Lint reports
114
+
│
115
+
┌──────────────────────┼──────────────────────┐
116
+
▼ ▼ ▼
117
+
query / chat Skill Factory (future)
118
+
(LLM answers from openkb skill new ppt / podcast /
119
+
the wiki) → output/skills/ report / …
120
+
+ marketplace.json
121
121
```
122
122
123
123
### Short vs. Long Document Handling
@@ -144,15 +144,15 @@ A single source might touch 10-15 wiki pages. Knowledge accumulates: each docume
144
144
145
145
# ⚙️ Usage
146
146
147
-
### Commands
147
+
OpenKB commands fall into two layers: the **wiki foundation** (compile + manage your knowledge) and **generators** (turn that wiki into useful output).
148
+
149
+
## 🧱 Wiki Foundation — compile and maintain
148
150
149
151
| Command | Description |
150
152
|---|---|
151
153
|`openkb init`| Initialize a new knowledge base (interactive) |
152
154
| <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`) |
153
155
| <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-concepts` to retain artifacts) |
154
-
| <code>openkb query "question"</code> | Ask a question over the knowledge base (use `--save` to save the answer to `wiki/explorations/`) |
155
-
|`openkb chat`| Start an interactive multi-turn chat (use `--resume`, `--list`, `--delete` to manage sessions) |
156
156
|`openkb watch`| Watch `raw/` and auto-compile new files |
157
157
|`openkb lint`| Run structural + knowledge health checks |
158
158
|`openkb list`| List indexed documents and concepts |
@@ -161,11 +161,26 @@ A single source might touch 10-15 wiki pages. Knowledge accumulates: each docume
161
161
162
162
<!-- | `openkb lint --fix` | Auto-fix what it can | -->
163
163
164
-
### Interactive Chat
164
+
## ✨ Generators — turn the wiki into output
165
+
166
+
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.
167
+
168
+
| Command | Output |
169
+
|---|---|
170
+
| <code>openkb query "question"</code> | A grounded answer with citations (use `--save` to persist to `wiki/explorations/`) |
171
+
|`openkb chat`| Interactive multi-turn session over the wiki (use `--resume`, `--list`, `--delete` to manage sessions) |
172
+
| <code>openkb skill new <name> "<intent>"</code> | A redistributable Anthropic Skill at `<kb>/output/skills/<name>/` + auto-updated `marketplace.json`|
173
+
| <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`|
174
+
| <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 |
175
+
| <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 |
165
176
166
-
`openkb chat` opens an interactive chat session over your wiki knowledge base. Unlike the one-shot `openkb query`, each turn carries the conversation history, so you can dig into a topic without re-typing context.
177
+
### Query & Chat — ask the wiki
178
+
179
+
`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).
167
180
168
181
```bash
182
+
openkb query "What does the literature say about attention scaling?"
183
+
169
184
openkb chat # start a new session
170
185
openkb chat --resume # resume the most recent session
171
186
openkb chat --resume 20260411 # resume by id (unique prefix works)
@@ -179,11 +194,70 @@ Inside a chat, type `/` to access slash commands (Tab to complete):
179
194
-`/status` — show knowledge base status
180
195
-`/list` — list all documents
181
196
-`/add <path>` — add a document or directory without leaving the chat
197
+
-`/skill new <name> "<intent>"` — compile a skill from this chat (see below)
182
198
-`/save [name]` — export the transcript to `wiki/explorations/`
183
199
-`/clear` — start a fresh session (the current one stays on disk)
184
200
-`/lint` — run knowledge base lint
185
201
-`/exit` — exit (Ctrl-D also works)
186
202
203
+
### 🛠 Skill Factory — *Drop in a book. Out comes a digital expert.*
204
+
205
+
The newest generator. `openkb skill new` distills any subset of your wiki into an [Anthropic Skill](https://docs.claude.com/en/docs/build-with-claude/skills) — a portable folder that **Claude Code, Codex CLI, Gemini CLI, and Cursor** all install and load natively. Drop in a book's worth of papers; out comes a specialist that other agents can call on.
206
+
207
+
```bash
208
+
openkb skill new karpathy-thinking \
209
+
"Reason about transformers and attention in Karpathy's style"
**Share with others** — push your KB to GitHub, then anyone runs:
232
+
233
+
```bash
234
+
npx skills@latest add <your-org>/<your-repo>
235
+
```
236
+
237
+
**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:
238
+
239
+
```
240
+
/skill new karpathy-thinking "Reason about transformers like Karpathy"
241
+
[generation streams]
242
+
> description is too generic, make it about transformer implementations specifically
243
+
[agent edits SKILL.md frontmatter in place]
244
+
```
245
+
246
+
**Quality gates** — structural validation, trigger-accuracy + body-coverage evaluation, and full history/rollback:
247
+
248
+
```bash
249
+
# Lint structure (auto-runs at end of `skill new`)
250
+
openkb skill validate karpathy-thinking
251
+
openkb skill validate --strict # treat warnings as failures
252
+
253
+
# Does the description actually fire when it should?
254
+
openkb skill eval karpathy-thinking --save
255
+
256
+
# History + rollback if a new iteration regresses
257
+
openkb skill history karpathy-thinking
258
+
openkb skill rollback karpathy-thinking --to 2
259
+
```
260
+
187
261
### Configuration
188
262
189
263
Settings are initialized by `openkb init`, and stored in `.openkb/config.yaml`:
0 commit comments