llm-wiki-compiler 0.2.0 → 0.3.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 +111 -8
- package/dist/cli.js +846 -223
- package/dist/cli.js.map +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -66,6 +66,43 @@ Example with zero exports (Claude Code already configured):
|
|
|
66
66
|
llmwiki compile
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
### OpenAI-Compatible Local Servers
|
|
70
|
+
|
|
71
|
+
Use the OpenAI provider for local OpenAI-compatible servers such as
|
|
72
|
+
`llama-server`. `OPENAI_BASE_URL` is used for chat/tool calls, and
|
|
73
|
+
`OPENAI_EMBEDDINGS_BASE_URL` is optional. Set it only when embeddings are
|
|
74
|
+
served from a different endpoint; when unset, embeddings use the same client
|
|
75
|
+
and base URL as chat. Include `/v1` in custom URLs.
|
|
76
|
+
|
|
77
|
+
Split endpoint example:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export LLMWIKI_PROVIDER=openai
|
|
81
|
+
export LLMWIKI_MODEL=qwen3.6-35b
|
|
82
|
+
export LLMWIKI_EMBEDDING_MODEL=text-embedding-model
|
|
83
|
+
export OPENAI_API_KEY=sk-local
|
|
84
|
+
export OPENAI_BASE_URL=http://host_url:port/v1
|
|
85
|
+
export OPENAI_EMBEDDINGS_BASE_URL=http://host_url:port/v1
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
`OPENAI_API_KEY` is still required by the CLI and OpenAI SDK. For local
|
|
89
|
+
servers that do not check authentication, any dummy value is sufficient.
|
|
90
|
+
|
|
91
|
+
### Ollama
|
|
92
|
+
|
|
93
|
+
Ollama uses its OpenAI-compatible endpoint. Set `OLLAMA_HOST` for chat and
|
|
94
|
+
optionally set `OLLAMA_EMBEDDINGS_HOST` only when embeddings are served from a
|
|
95
|
+
different endpoint. When unset, embeddings use `OLLAMA_HOST`. Include `/v1` in
|
|
96
|
+
custom URLs.
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
export LLMWIKI_PROVIDER=ollama
|
|
100
|
+
export LLMWIKI_MODEL=llama3.1
|
|
101
|
+
export LLMWIKI_EMBEDDING_MODEL=nomic-embed-text
|
|
102
|
+
export OLLAMA_HOST=http://ollama_host:11434/v1
|
|
103
|
+
export OLLAMA_EMBEDDINGS_HOST=http://ollama_host:11435/v1
|
|
104
|
+
```
|
|
105
|
+
|
|
69
106
|
## Why not just RAG?
|
|
70
107
|
|
|
71
108
|
RAG retrieves chunks at query time. Every question re-discovers the same relationships from scratch. Nothing accumulates.
|
|
@@ -121,9 +158,14 @@ Pages include source attribution in frontmatter. Paragraphs are annotated with `
|
|
|
121
158
|
|---------|-------------|
|
|
122
159
|
| `llmwiki ingest <url\|file>` | Fetch a URL or copy a local file into `sources/` |
|
|
123
160
|
| `llmwiki compile` | Incremental compile: extract concepts, generate wiki pages |
|
|
161
|
+
| `llmwiki compile --review` | Write candidate pages to `.llmwiki/candidates/` instead of `wiki/` so you can review before they land |
|
|
162
|
+
| `llmwiki review list` | List pending candidate pages |
|
|
163
|
+
| `llmwiki review show <id>` | Print a candidate's title, summary, and body |
|
|
164
|
+
| `llmwiki review approve <id>` | Promote a candidate into `wiki/` and refresh index/MOC/embeddings |
|
|
165
|
+
| `llmwiki review reject <id>` | Archive a candidate without touching `wiki/` |
|
|
124
166
|
| `llmwiki query "question"` | Ask questions against your compiled wiki |
|
|
125
167
|
| `llmwiki query "question" --save` | Answer and save the result as a wiki page |
|
|
126
|
-
| `llmwiki lint` | Check wiki quality (broken links, orphans, empty pages, etc.) |
|
|
168
|
+
| `llmwiki lint` | Check wiki quality (broken links, orphans, empty pages, low confidence, contradictions, etc.) |
|
|
127
169
|
| `llmwiki watch` | Auto-recompile when `sources/` changes |
|
|
128
170
|
| `llmwiki serve [--root <dir>]` | Start an MCP server exposing wiki tools to AI agents |
|
|
129
171
|
|
|
@@ -131,13 +173,61 @@ Pages include source attribution in frontmatter. Paragraphs are annotated with `
|
|
|
131
173
|
|
|
132
174
|
```
|
|
133
175
|
wiki/
|
|
134
|
-
concepts/
|
|
135
|
-
queries/
|
|
136
|
-
index.md
|
|
176
|
+
concepts/ one .md file per concept, with YAML frontmatter
|
|
177
|
+
queries/ saved query answers, included in index and retrieval
|
|
178
|
+
index.md auto-generated table of contents
|
|
179
|
+
.llmwiki/
|
|
180
|
+
candidates/ pending review candidates from `compile --review`
|
|
181
|
+
candidates/archive/ rejected candidates kept for audit
|
|
137
182
|
```
|
|
138
183
|
|
|
139
184
|
Obsidian-compatible. `[[wikilinks]]` resolve to concept titles.
|
|
140
185
|
|
|
186
|
+
## Review queue
|
|
187
|
+
|
|
188
|
+
By default, `compile` writes pages directly to `wiki/`. Add `--review` to write candidate JSON records to `.llmwiki/candidates/` instead, so you can inspect each generated page before it lands.
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
llmwiki compile --review # produces candidates, leaves wiki/ untouched
|
|
192
|
+
llmwiki review list # see what's pending
|
|
193
|
+
llmwiki review show <id> # inspect a single candidate
|
|
194
|
+
llmwiki review approve <id> # write into wiki/ + refresh index/MOC/embeddings
|
|
195
|
+
llmwiki review reject <id> # archive to .llmwiki/candidates/archive/
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
A few things to know:
|
|
199
|
+
|
|
200
|
+
- **Approve and reject acquire `.llmwiki/lock`** so they serialize cleanly against each other and against any concurrent `compile`.
|
|
201
|
+
- **Source state is deferred per-source.** When one source produces multiple candidates, the source isn't marked compiled until the last candidate is approved — so unresolved siblings stay re-detectable on the next `compile --review`.
|
|
202
|
+
- **Deletion bookkeeping is deferred.** `compile --review` does not orphan-mark deleted sources; the next non-review `compile` does that. The `--review` help text advertises this.
|
|
203
|
+
- MCP `wiki_status` exposes `pendingCandidates` so agents can see the queue depth.
|
|
204
|
+
|
|
205
|
+
## Page metadata
|
|
206
|
+
|
|
207
|
+
Compiled pages can carry epistemic metadata in frontmatter so consumers know how trustworthy each page is. All fields are optional and existing pages without them continue to work.
|
|
208
|
+
|
|
209
|
+
```yaml
|
|
210
|
+
---
|
|
211
|
+
title: Knowledge Compilation
|
|
212
|
+
summary: Techniques for converting knowledge representations...
|
|
213
|
+
sources:
|
|
214
|
+
- knowledge-compilation.md
|
|
215
|
+
confidence: 0.82 # 0–1, LLM-reported confidence in the synthesized page
|
|
216
|
+
provenanceState: merged # extracted | merged | inferred | ambiguous
|
|
217
|
+
contradictedBy:
|
|
218
|
+
- slug: probabilistic-reasoning
|
|
219
|
+
inferredParagraphs: 1 # paragraphs the LLM marked as inferred (vs cited)
|
|
220
|
+
---
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
When multiple sources merge into one slug, metadata is reconciled: `min` confidence, `provenanceState = 'merged'`, union of `contradictedBy` (deduped by slug), `max` `inferredParagraphs`.
|
|
224
|
+
|
|
225
|
+
`llmwiki lint` adds three rules that surface this metadata:
|
|
226
|
+
|
|
227
|
+
- `low-confidence` — flags pages with `confidence` below a threshold
|
|
228
|
+
- `contradicted-page` — flags pages with non-empty `contradictedBy`
|
|
229
|
+
- `excess-inferred-paragraphs` — flags pages with too many inferred paragraphs without citations
|
|
230
|
+
|
|
141
231
|
## Demo
|
|
142
232
|
|
|
143
233
|
Try it on any article or document:
|
|
@@ -232,17 +322,30 @@ Karpathy describes an abstract pattern for turning raw data into compiled knowle
|
|
|
232
322
|
|
|
233
323
|
## Roadmap
|
|
234
324
|
|
|
325
|
+
Shipped in 0.3.0:
|
|
326
|
+
|
|
327
|
+
- ✅ Candidate review queue (approve compile output before pages are written)
|
|
328
|
+
- ✅ Confidence and contradiction metadata on compiled pages
|
|
329
|
+
|
|
330
|
+
Shipped in 0.2.0:
|
|
331
|
+
|
|
235
332
|
- ✅ Better provenance (paragraph-level source attribution)
|
|
236
333
|
- ✅ Linting pass for wiki quality checks
|
|
237
334
|
- ✅ Multi-provider support (OpenAI, Ollama, MiniMax)
|
|
238
335
|
- ✅ Larger-corpus query strategy (semantic search, embeddings)
|
|
239
336
|
- ✅ Deeper Obsidian integration (tags, aliases, Map of Content)
|
|
240
337
|
- ✅ MCP server for agent integration
|
|
241
|
-
- Image support
|
|
242
|
-
- Marp slides
|
|
243
|
-
- Fine-tuning
|
|
244
338
|
|
|
245
|
-
|
|
339
|
+
Next up:
|
|
340
|
+
|
|
341
|
+
- Claim-level provenance with source ranges
|
|
342
|
+
- First-class schema layer with typed page kinds (`concept`, `entity`, `comparison`, `overview`)
|
|
343
|
+
- Multimodal ingest (images, PDFs, transcripts)
|
|
344
|
+
- Chunked retrieval with reranking
|
|
345
|
+
- Export bundle (`llms.txt`, JSON, JSON-LD, GraphML, Marp)
|
|
346
|
+
- Session-history adapters (Claude, Codex, Cursor exports)
|
|
347
|
+
|
|
348
|
+
If you like ambitious problems: **schema layer + typed page kinds**, **claim-level provenance**, and **chunked retrieval with reranking** are the meatiest. Open an issue to claim one or kick off a design discussion.
|
|
246
349
|
|
|
247
350
|
## Requirements
|
|
248
351
|
|