llm-wiki-compiler 0.8.0 → 0.10.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/CHANGELOG.md +55 -0
- package/README.md +198 -530
- package/dist/cli.js +4053 -1068
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1052 -0
- package/dist/index.js +7637 -0
- package/dist/index.js.map +1 -0
- package/dist/viewer/assets/viewer-rail.js +71 -0
- package/dist/viewer/assets/viewer-sidebar.js +115 -4
- package/dist/viewer/assets/viewer.css +69 -0
- package/dist/viewer/assets/viewer.js +48 -0
- package/package.json +19 -5
package/README.md
CHANGED
|
@@ -1,629 +1,297 @@
|
|
|
1
1
|
# llmwiki
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
<div align="center">
|
|
4
|
+
<div style="border: 2px solid #4F46E5; border-radius: 18px; padding: 20px 24px; margin: 18px 0; background: #EEF2FF; color: #111827; max-width: 900px;">
|
|
5
|
+
<h2 style="color: #312E81;">Breaking News: llmwiki 0.10.0 supports Open Knowledge Format</h2>
|
|
6
|
+
<p style="color: #1F2937;">
|
|
7
|
+
llmwiki is now an <strong>Open Knowledge Format (OKF)</strong> producer and consumer,
|
|
8
|
+
aligning compiled agent knowledge with Google Cloud's emerging standard for portable knowledge sharing.
|
|
9
|
+
</p>
|
|
10
|
+
<p style="color: #1F2937;">
|
|
11
|
+
Export compiled wikis with <code>llmwiki export --target okf</code>,
|
|
12
|
+
import external bundles with <code>llmwiki import --okf</code>,
|
|
13
|
+
and stage untrusted knowledge through review before it becomes live agent context.
|
|
14
|
+
</p>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
Compile raw sources into an interlinked, citation-traceable markdown wiki that agents and humans can browse, query, lint, export, and reuse.
|
|
19
|
+
|
|
20
|
+
llmwiki implements the [LLM Wiki](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) pattern: instead of re-discovering knowledge from raw files at query time, compile it once into durable pages that accumulate structure, provenance, review state, and retrieval metadata over time.
|
|
6
21
|
|
|
7
22
|

|
|
8
23
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
- **AI researchers and engineers** building persistent knowledge from papers, docs, and notes
|
|
12
|
-
- **Technical writers** compiling scattered sources into a structured, interlinked reference
|
|
13
|
-
- **Anyone with too many bookmarks** who wants a wiki instead of a graveyard of tabs
|
|
14
|
-
|
|
15
|
-
## Quick start
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -g llm-wiki-compiler
|
|
19
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
20
|
-
# Or use ANTHROPIC_AUTH_TOKEN if your Anthropic-compatible gateway expects it.
|
|
21
|
-
# Or use a different provider:
|
|
22
|
-
# export LLMWIKI_PROVIDER=openai
|
|
23
|
-
# export OPENAI_API_KEY=sk-...
|
|
24
|
-
|
|
25
|
-
llmwiki quickstart ./notes.md
|
|
26
|
-
llmwiki query "what is X?"
|
|
27
|
-
llmwiki view --open
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
`llmwiki quickstart ./notes.md` ingests one supported source, compiles the wiki, and opens the local viewer when pages are ready. Use `--no-open` to stop after compile, `--review` to queue candidates instead of writing pages, or `--json` for an agent-friendly envelope. If you're inside an existing project and unsure what to do next, run `llmwiki next`.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<br>
|
|
24
|
+
## When to use this repo
|
|
34
25
|
|
|
35
|
-
|
|
26
|
+
Use llmwiki when you need a persistent knowledge base from raw material:
|
|
36
27
|
|
|
37
|
-
|
|
28
|
+
- Compile papers, notes, READMEs, transcripts, PDFs, images, or web pages into typed wiki pages.
|
|
29
|
+
- Give agents a stable, citation-aware context pack instead of a pile of loose files.
|
|
30
|
+
- Keep generated knowledge auditable with source citations, review queues, freshness checks, and quality gates.
|
|
31
|
+
- Browse the result locally, query it from the CLI, expose it over MCP, or embed it through the SDK.
|
|
32
|
+
- Exchange compiled knowledge with other tools using Open Knowledge Format (OKF), JSON, JSON-LD, GraphML, Marp, and `llms.txt`.
|
|
38
33
|
|
|
34
|
+
Do not use llmwiki as a general static-site generator, a heavy ontology database, or a replacement for ad-hoc search over fast-changing raw logs. It is strongest when source knowledge is worth compiling, reviewing, and reusing.
|
|
39
35
|
|
|
40
|
-
|
|
41
|
-
<summary><span style="font-size: 1.4em;"><strong>Configuration — click to expand</strong></span></summary>
|
|
36
|
+
## What you get
|
|
42
37
|
|
|
38
|
+
- **Compiled wiki, not chunks.** A two-phase LLM pipeline extracts concepts, then generates typed pages: `concept`, `entity`, `comparison`, and `overview`.
|
|
39
|
+
- **Citation-traceable output.** Paragraphs and claims cite source files and line ranges, and `llmwiki lint` validates the links.
|
|
40
|
+
- **Hybrid retrieval.** Semantic chunk search, BM25 reranking, and wikilink graph expansion build compact evidence packs for queries and agents.
|
|
41
|
+
- **Local viewer.** `llmwiki view` opens a read-only browser UI with search, page metadata, graph exploration, source-freshness badges, and citation chips.
|
|
42
|
+
- **Review policy.** Generated pages can be auto-held for review when confidence, contradiction, schema, or provenance rules trip.
|
|
43
|
+
- **Freshness repair.** `llmwiki lint` and `llmwiki next` surface stale/orphaned pages; `llmwiki refresh --stale` repairs changed knowledge without compiling unrelated new sources.
|
|
44
|
+
- **Eval harness.** `llmwiki eval` reports health score, citation coverage/precision, corpus stats, regression deltas, and optional judge-model citation support.
|
|
45
|
+
- **MCP server.** `llmwiki serve` exposes ingest, compile, query, lint, read, status, eval, and context-pack tools to MCP-compatible agents.
|
|
46
|
+
- **SDK.** `createWiki({ root })` drives ingest, compile, query, context, status, export, and eval from TypeScript without shelling out.
|
|
47
|
+
- **Open Knowledge Format exchange.** Export and import OKF bundles for portable, markdown-native knowledge exchange. External OKF imports are staged through the review queue by default; trusted bundles can be written live explicitly.
|
|
48
|
+
- **Other portable exports.** Export JSON, JSON-LD, GraphML, Marp slides, and `llms.txt` for downstream systems.
|
|
49
|
+
- **Provider portable.** Anthropic, Claude Agent SDK local login, OpenAI-compatible servers, Ollama, GitHub Copilot, and local OpenAI-compatible runtimes.
|
|
43
50
|
|
|
44
|
-
|
|
51
|
+
## Karpathy's LLM Wiki pattern
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
Andrej Karpathy described the LLM Wiki pattern as a way to turn raw material into compiled knowledge that future agents can reuse. llmwiki is a concrete compiler for that pattern.
|
|
47
54
|
|
|
48
|
-
|
|
49
|
-
2. Claude Code settings fallback (`~/.claude/settings.json` → `env` block)
|
|
50
|
-
3. Built-in provider defaults (where applicable)
|
|
55
|
+
The key shift is moving work from query time to compile time. Traditional RAG repeatedly retrieves raw chunks and asks the model to reconstruct relationships for each question. llmwiki first turns sources into typed, interlinked pages with citations, metadata, and review state. Queries, context packs, exports, and MCP tools then operate over that compiled artifact.
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
- `LLMWIKI_MODEL`: The model name to override the provider default.
|
|
57
|
+
That makes llmwiki useful when knowledge should compound: concepts shared across sources become one page, saved answers become future context, stale pages can be detected and repaired, and agents can consume a stable evidence pack instead of re-reading the same raw files from scratch.
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
See [`docs/concepts/karpathy-pattern.mdx`](docs/concepts/karpathy-pattern.mdx) for the deeper explanation.
|
|
56
60
|
|
|
57
|
-
|
|
58
|
-
- `ANTHROPIC_BASE_URL`: Optional. Custom endpoint for proxies. Valid HTTP(S) URLs are accepted, including Claude-style path endpoints such as `https://api.kimi.com/coding/`.
|
|
59
|
-
|
|
60
|
-
Example using an Anthropic or cc-switch custom proxy:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
export LLMWIKI_PROVIDER=anthropic
|
|
64
|
-
export ANTHROPIC_API_KEY=sk-...
|
|
65
|
-
export ANTHROPIC_BASE_URL=https://proxy.example.com
|
|
66
|
-
```
|
|
61
|
+
## Agent decision guide
|
|
67
62
|
|
|
68
|
-
If
|
|
63
|
+
If an agent is scanning this README, these are the high-signal entry points:
|
|
69
64
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
65
|
+
| Goal | Use |
|
|
66
|
+
|---|---|
|
|
67
|
+
| Create a wiki from one source and inspect it | `llmwiki quickstart <source>` |
|
|
68
|
+
| Add more files or URLs | `llmwiki ingest <url-or-file>` |
|
|
69
|
+
| Compile or recompile changed sources | `llmwiki compile` |
|
|
70
|
+
| Hold generated pages for human approval | `llmwiki compile --review` or review policy config |
|
|
71
|
+
| Ask grounded questions | `llmwiki query "question"` |
|
|
72
|
+
| Save an answer back into the wiki | `llmwiki query "question" --save` |
|
|
73
|
+
| Build an evidence pack for another agent | `llmwiki context "<task>" --json` or MCP `get_context_pack` |
|
|
74
|
+
| Inspect the compiled knowledge base | `llmwiki view --open` |
|
|
75
|
+
| Check broken links, citations, confidence, freshness, and quality | `llmwiki lint` and `llmwiki eval` |
|
|
76
|
+
| Repair stale compiled pages | `llmwiki refresh --stale --dry-run`, then `llmwiki refresh --stale` |
|
|
77
|
+
| Drive llmwiki from an agent | `llmwiki serve --root <project>` |
|
|
78
|
+
| Drive llmwiki from TypeScript | `createWiki({ root })` |
|
|
79
|
+
| Export for another system | `llmwiki export --target <format>` |
|
|
80
|
+
| Export an Open Knowledge Format bundle | `llmwiki export --target okf --out <dir>` |
|
|
81
|
+
| Import an Open Knowledge Format bundle | `llmwiki import --okf <dir> --dry-run`, then review/approve |
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
## Quick start
|
|
76
84
|
|
|
77
85
|
```bash
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### OpenAI-Compatible Local Servers
|
|
82
|
-
|
|
83
|
-
Use the OpenAI provider for local OpenAI-compatible servers such as
|
|
84
|
-
`llama-server`. `OPENAI_BASE_URL` is used for chat/tool calls, and
|
|
85
|
-
`OPENAI_EMBEDDINGS_BASE_URL` is optional. Set it only when embeddings are
|
|
86
|
-
served from a different endpoint; when unset, embeddings use the same client
|
|
87
|
-
and base URL as chat. Include `/v1` in custom URLs.
|
|
86
|
+
npm install -g llm-wiki-compiler
|
|
88
87
|
|
|
89
|
-
|
|
88
|
+
export ANTHROPIC_API_KEY=sk-...
|
|
89
|
+
# or choose another provider:
|
|
90
|
+
# export LLMWIKI_PROVIDER=openai
|
|
91
|
+
# export OPENAI_API_KEY=sk-...
|
|
90
92
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
export LLMWIKI_EMBEDDING_MODEL=text-embedding-model
|
|
95
|
-
export OPENAI_API_KEY=sk-local
|
|
96
|
-
export OPENAI_BASE_URL=http://host_url:port/v1
|
|
97
|
-
export OPENAI_EMBEDDINGS_BASE_URL=http://host_url:port/v1
|
|
93
|
+
llmwiki quickstart ./notes.md
|
|
94
|
+
llmwiki query "what are the key ideas?"
|
|
95
|
+
llmwiki view --open
|
|
98
96
|
```
|
|
99
97
|
|
|
100
|
-
`
|
|
101
|
-
servers that do not check authentication, any dummy value is sufficient.
|
|
98
|
+
`quickstart` ingests one source, compiles pages, and opens the viewer. Inside an existing project, run `llmwiki next` when you want the safest next action.
|
|
102
99
|
|
|
103
|
-
|
|
100
|
+
## Demo
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
optionally set `OLLAMA_EMBEDDINGS_HOST` only when embeddings are served from a
|
|
107
|
-
different endpoint. When unset, embeddings use `OLLAMA_HOST`. Include `/v1` in
|
|
108
|
-
custom URLs.
|
|
102
|
+
Try it on any article or document:
|
|
109
103
|
|
|
110
104
|
```bash
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
export OLLAMA_HOST=http://ollama_host:11434/v1
|
|
115
|
-
export OLLAMA_EMBEDDINGS_HOST=http://ollama_host:11435/v1
|
|
105
|
+
mkdir my-wiki && cd my-wiki
|
|
106
|
+
llmwiki quickstart https://en.wikipedia.org/wiki/Andrej_Karpathy
|
|
107
|
+
llmwiki query "What terms did Andrej coin?"
|
|
116
108
|
```
|
|
117
109
|
|
|
118
|
-
|
|
110
|
+
The [`examples/basic/`](examples/basic/) directory includes a small pre-generated wiki you can inspect without an API key.
|
|
119
111
|
|
|
120
|
-
|
|
121
|
-
OpenAI-compatible endpoint available to Copilot subscribers. Requires a GitHub
|
|
122
|
-
OAuth token with the `copilot` scope — **classic PATs are not supported**.
|
|
112
|
+
## Core commands
|
|
123
113
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
114
|
+
| Command | What it does |
|
|
115
|
+
|---|---|
|
|
116
|
+
| `llmwiki ingest <url-or-file>` | Fetch a URL or copy a local file into `sources/`. |
|
|
117
|
+
| `llmwiki ingest-session <path>` | Import exported Claude, Codex, or Cursor sessions into `sources/`. |
|
|
118
|
+
| `llmwiki quickstart <source>` | Ingest, compile, and optionally open the viewer in one step. |
|
|
119
|
+
| `llmwiki compile` | Incrementally extract concepts and generate wiki pages. |
|
|
120
|
+
| `llmwiki refresh --stale [--dry-run]` | Recompile changed owners of stale pages and clean selected orphaned ownership. |
|
|
121
|
+
| `llmwiki review list/show/approve/reject` | Inspect and manage held candidates. |
|
|
122
|
+
| `llmwiki query "question" [--save]` | Ask questions against the compiled wiki, optionally saving the answer. |
|
|
123
|
+
| `llmwiki context "<prompt>" --json` | Build a citation-aware evidence pack for agents. |
|
|
124
|
+
| `llmwiki view [--open]` | Start the read-only local browser viewer. |
|
|
125
|
+
| `llmwiki lint` | Validate wiki structure, citations, links, metadata, and freshness. |
|
|
126
|
+
| `llmwiki eval [--suite fast\|full]` | Measure wiki quality and optional citation support. |
|
|
127
|
+
| `llmwiki export --target <format>` | Export the wiki to portable formats, including Open Knowledge Format (`okf`). |
|
|
128
|
+
| `llmwiki import --okf <dir> [--dry-run] [--trusted]` | Import an Open Knowledge Format bundle, staged for review by default. |
|
|
129
|
+
| `llmwiki serve --root <dir>` | Start the MCP server. |
|
|
130
|
+
|
|
131
|
+
Full command docs live in [`docs/cli/`](docs/cli/).
|
|
132
|
+
|
|
133
|
+
## Open Knowledge Format
|
|
134
|
+
|
|
135
|
+
llmwiki is an Open Knowledge Format (OKF) producer and consumer. OKF is a Google Cloud initiative for sharing compiled knowledge as portable markdown files with structured frontmatter.
|
|
131
136
|
|
|
132
137
|
```bash
|
|
133
|
-
export
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
llmwiki export --target okf --out ./dist/okf
|
|
139
|
+
llmwiki import --okf ./dist/okf --dry-run
|
|
140
|
+
llmwiki import --okf ./dist/okf
|
|
136
141
|
```
|
|
137
142
|
|
|
138
|
-
|
|
139
|
-
`claude-sonnet-4.5`, `claude-sonnet-4.6`, `claude-opus-4.5`, `gemini-2.5-pro`,
|
|
140
|
-
and others — availability depends on your Copilot plan.
|
|
141
|
-
|
|
142
|
-
**Embeddings:** The GitHub Copilot API does not expose an embeddings endpoint.
|
|
143
|
-
Semantic search (used by `llmwiki query` with chunked retrieval) will fall back
|
|
144
|
-
to full-index selection without embeddings. For embedding-dependent workflows,
|
|
145
|
-
switch to the `openai` provider and provide `OPENAI_API_KEY`.
|
|
146
|
-
|
|
147
|
-
### Request timeouts
|
|
148
|
-
|
|
149
|
-
The OpenAI SDK defaults to a 10-minute per-request timeout, which can cut off long compile-time completions on slower local models. Override per provider:
|
|
150
|
-
|
|
151
|
-
- `LLMWIKI_REQUEST_TIMEOUT_MS` — provider-agnostic timeout in milliseconds. Applies to both the `openai` and `ollama` backends.
|
|
152
|
-
- `OLLAMA_TIMEOUT_MS` — Ollama-specific override. Wins over `LLMWIKI_REQUEST_TIMEOUT_MS` when both are set.
|
|
153
|
-
|
|
154
|
-
Defaults: 10 minutes for `openai`, 30 minutes for `ollama` (local models commonly need more).
|
|
155
|
-
|
|
156
|
-
### Output language
|
|
157
|
-
|
|
158
|
-
Generated wiki content defaults to whatever language the model produces from the source material — typically English. Override with either:
|
|
159
|
-
|
|
160
|
-
- `LLMWIKI_OUTPUT_LANG` — e.g. `zh-CN`, `Chinese`, `ja`, `Japanese`. Applies to every prompt the compile and query pipelines make.
|
|
161
|
-
- `--lang <code>` on `llmwiki compile` and `llmwiki query` — same effect, scoped to one invocation. Wins over the env var.
|
|
162
|
-
|
|
163
|
-
Unset preserves prior behaviour byte-for-byte.
|
|
164
|
-
|
|
165
|
-
### Per-concept prompt budget
|
|
166
|
-
|
|
167
|
-
When many sources contribute to the same compiled concept, `compile` enforces a per-concept character cap on the combined source content sent to the LLM so popular shared concepts don't blow past the model's context window. Each contributing source gets a fair share when truncation kicks in.
|
|
168
|
-
|
|
169
|
-
- `LLMWIKI_PROMPT_BUDGET_CHARS` — character ceiling for the combined per-concept prompt. Defaults to `200000` (~50k tokens), which fits modern context windows with headroom. Raise it for larger-context models, lower it for local small-context models.
|
|
170
|
-
|
|
171
|
-
A truncation warning prints to stderr when the cap fires so you know which concept hit the budget.
|
|
172
|
-
|
|
173
|
-
</details>
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
<br>
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
<br>
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
## Why not just RAG?
|
|
184
|
-
|
|
185
|
-
RAG retrieves chunks at query time. Every question re-discovers the same relationships from scratch. Nothing accumulates.
|
|
186
|
-
|
|
187
|
-
llmwiki **compiles** your sources into a wiki. Concepts get their own pages. Pages link to each other. When you ask a question with `--save`, the answer becomes a new page, and future queries use it as context. Your explorations compound.
|
|
188
|
-
|
|
189
|
-
This is complementary to RAG, not a replacement. RAG is great for ad-hoc retrieval over large corpora. llmwiki gives you a persistent, structured artifact to retrieve from.
|
|
190
|
-
|
|
191
|
-
```
|
|
192
|
-
RAG: query → search chunks → answer → forget
|
|
193
|
-
llmwiki: sources → compile → wiki → query → save → richer wiki → better answers
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
## How it works
|
|
197
|
-
|
|
198
|
-
```
|
|
199
|
-
sources/ → SHA-256 hash check → LLM concept extraction → wiki page generation → [[wikilink]] resolution → index.md
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
**Two-phase pipeline.** Phase 1 extracts all concepts from all sources. Phase 2 generates pages. This eliminates order-dependence, catches failures before writing anything, and merges concepts shared across multiple sources into single pages.
|
|
203
|
-
|
|
204
|
-
**Incremental.** Only changed sources go through the LLM. Everything else is skipped via hash-based change detection.
|
|
205
|
-
|
|
206
|
-
**Compounding queries.** `llmwiki query --save` writes the answer as a wiki page and immediately rebuilds the index. Saved answers show up in future queries as context.
|
|
207
|
-
|
|
208
|
-
### What it produces
|
|
209
|
-
|
|
210
|
-
A raw source like a Wikipedia article on knowledge compilation becomes a structured wiki page:
|
|
211
|
-
|
|
212
|
-
```yaml
|
|
213
|
-
---
|
|
214
|
-
title: Knowledge Compilation
|
|
215
|
-
summary: Techniques for converting knowledge representations into forms that support efficient reasoning.
|
|
216
|
-
kind: concept
|
|
217
|
-
sources:
|
|
218
|
-
- knowledge-compilation.md
|
|
219
|
-
createdAt: "2026-04-05T12:00:00Z"
|
|
220
|
-
updatedAt: "2026-04-05T12:00:00Z"
|
|
221
|
-
---
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
```markdown
|
|
225
|
-
Knowledge compilation refers to a family of techniques for pre-processing
|
|
226
|
-
a knowledge base into a target language that supports efficient queries.
|
|
227
|
-
|
|
228
|
-
Related concepts: [[Propositional Logic]], [[Model Counting]]
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
Pages include source attribution in frontmatter. Paragraphs are annotated with `^[filename.md]` markers pointing back to the source file that contributed the content; specific claims can use line ranges like `^[filename.md:42-58]` or `^[filename.md#L42-L58]`.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
<br>
|
|
143
|
+
OKF import is intentionally review-first: untrusted bundles become review candidates, not live wiki pages. The importer preserves foreign OKF metadata, stores llmwiki provenance under `x-llmwiki`, and re-exports imported pages honestly after local edits.
|
|
235
144
|
|
|
236
|
-
|
|
145
|
+
See [`docs/guides/open-knowledge-format.mdx`](docs/guides/open-knowledge-format.mdx), [`docs/cli/export.mdx`](docs/cli/export.mdx), and [`docs/cli/import.mdx`](docs/cli/import.mdx).
|
|
237
146
|
|
|
238
|
-
|
|
147
|
+
## What llmwiki creates
|
|
239
148
|
|
|
149
|
+
A project has raw inputs in `sources/`, compiled markdown in `wiki/`, and compiler state under `.llmwiki/`:
|
|
240
150
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
## Commands
|
|
246
|
-
|
|
247
|
-
| Command | What it does |
|
|
248
|
-
|---------|-------------|
|
|
249
|
-
| `llmwiki ingest <url\|file>` | Fetch a URL or copy a local file into `sources/` |
|
|
250
|
-
| `llmwiki ingest-session <path>` | Import a Claude/Codex/Cursor session export (single file or whole directory) into `sources/` |
|
|
251
|
-
| `llmwiki quickstart <source>` | Ingest a source and compile a wiki in one step; supports `--review`, `--no-open`, `--provider`, `--lang`, and `--json` |
|
|
252
|
-
| `llmwiki compile` | Incremental compile: extract concepts, generate wiki pages |
|
|
253
|
-
| `llmwiki compile --review` | Write candidate pages to `.llmwiki/candidates/` instead of `wiki/` so you can review before they land |
|
|
254
|
-
| `llmwiki compile --lang <code>` | Generate wiki content in the given language (e.g. `Chinese`, `ja`, `zh-CN`); also works on `query` |
|
|
255
|
-
| `llmwiki review list` | List pending candidate pages |
|
|
256
|
-
| `llmwiki review show <id>` | Print a candidate's title, summary, and body |
|
|
257
|
-
| `llmwiki review approve <id>` | Promote a candidate into `wiki/` and refresh index/MOC/embeddings |
|
|
258
|
-
| `llmwiki review reject <id>` | Archive a candidate without touching `wiki/` |
|
|
259
|
-
| `llmwiki schema init` | Write a starter `.llmwiki/schema.json` file |
|
|
260
|
-
| `llmwiki schema show` | Print the resolved schema for the current project |
|
|
261
|
-
| `llmwiki query "question"` | Ask questions against your compiled wiki |
|
|
262
|
-
| `llmwiki query "question" --save` | Answer and save the result as a wiki page |
|
|
263
|
-
| `llmwiki export [--target <name>]` | Export the wiki to portable formats — `llms.txt`, `llms-full.txt`, JSON, JSON-LD, GraphML, Marp slides |
|
|
264
|
-
| `llmwiki view [--open]` | Start a read-only local web viewer for browsing, searching, and inspecting the compiled wiki |
|
|
265
|
-
| `llmwiki next [--json]` | Show the recommended next action for this project (read-only); `--json` emits a stable envelope for agents |
|
|
266
|
-
| `llmwiki context "<prompt>" [--json]` | Build an agent-ready evidence pack (primary pages, citations, neighbors, suggested actions) — same v1 envelope as MCP `get_context_pack` |
|
|
267
|
-
| `llmwiki lint` | Check wiki quality (broken links, orphans, empty pages, low confidence, contradictions, etc.) |
|
|
268
|
-
| `llmwiki eval [--suite fast\|full]` | Measure wiki quality: health score (0–100), citation coverage, corpus stats. `--suite full` adds LLM-as-judge citation support scoring |
|
|
269
|
-
| `llmwiki eval cache show` | Print score distribution and top-cited pages from the citation judgement cache |
|
|
270
|
-
| `llmwiki eval cache clear` | Remove the citation judgement cache |
|
|
271
|
-
| `llmwiki eval report` | Print the most recent eval report |
|
|
272
|
-
| `llmwiki eval history [--n N]` | Show a trend table of past eval runs from `history.jsonl` |
|
|
273
|
-
| `llmwiki eval judgements [--score 0\|1\|2] [--page slug]` | Inspect individual citation judgements with optional score or page filters |
|
|
274
|
-
| `llmwiki watch` | Auto-recompile when `sources/` changes |
|
|
275
|
-
| `llmwiki serve [--root <dir>]` | Start an MCP server exposing wiki tools to AI agents |
|
|
276
|
-
|
|
277
|
-
`llmwiki context --include-sources` and MCP `get_context_pack` with `includeSources: true` are opt-in because they can return raw snippets from files under `sources/`. Path confinement prevents reads outside `sources/`, but only enable source windows for agents you trust with the ingested source text.
|
|
278
|
-
|
|
279
|
-
## Output
|
|
280
|
-
|
|
281
|
-
```
|
|
151
|
+
```text
|
|
152
|
+
sources/
|
|
153
|
+
raw source files
|
|
282
154
|
wiki/
|
|
283
|
-
concepts/
|
|
284
|
-
queries/
|
|
285
|
-
index.md
|
|
155
|
+
concepts/ compiled pages
|
|
156
|
+
queries/ saved answers
|
|
157
|
+
index.md generated TOC
|
|
286
158
|
.llmwiki/
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
159
|
+
config.json review policy
|
|
160
|
+
schema.json page-kind/cross-link policy
|
|
161
|
+
state.json source hashes and ownership
|
|
162
|
+
candidates/ held review candidates
|
|
163
|
+
eval/ quality history and thresholds
|
|
164
|
+
log.md activity journal
|
|
290
165
|
```
|
|
291
166
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
## Local web viewer
|
|
295
|
-
|
|
296
|
-
Run `llmwiki view` from a project root to browse the compiled wiki in a local browser without Obsidian. The viewer is read-only: it renders `wiki/`, exposes sidebar navigation, search, page metadata, health counts, and provenance/citation chips, but does not mutate sources or generated pages.
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
llmwiki view # prints Viewer ready at http://127.0.0.1:<port>
|
|
300
|
-
llmwiki view --open # also opens the URL in your default browser
|
|
301
|
-
```
|
|
167
|
+
Compiled pages are plain markdown with YAML frontmatter, plus enough metadata for agents to reason about citations, freshness, confidence, contradictions, and review state. See [`docs/concepts/wiki-model.mdx`](docs/concepts/wiki-model.mdx).
|
|
302
168
|
|
|
303
|
-
|
|
169
|
+
## Agent integration
|
|
304
170
|
|
|
305
|
-
|
|
171
|
+
### MCP
|
|
306
172
|
|
|
307
|
-
|
|
173
|
+
Run:
|
|
308
174
|
|
|
309
175
|
```bash
|
|
310
|
-
llmwiki
|
|
311
|
-
llmwiki review list # see what's pending
|
|
312
|
-
llmwiki review show <id> # inspect a single candidate
|
|
313
|
-
llmwiki review approve <id> # write into wiki/ + refresh index/MOC/embeddings
|
|
314
|
-
llmwiki review reject <id> # archive to .llmwiki/candidates/archive/
|
|
176
|
+
llmwiki serve --root /path/to/wiki-project
|
|
315
177
|
```
|
|
316
178
|
|
|
317
|
-
|
|
179
|
+
MCP clients can ingest sources, compile, query, search pages, read pages, lint, run eval, inspect status, and request context packs. Read-only tools work without provider credentials; LLM-backed tools validate provider credentials at call time.
|
|
318
180
|
|
|
319
|
-
|
|
320
|
-
- **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`.
|
|
321
|
-
- **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.
|
|
322
|
-
- MCP `wiki_status` exposes `pendingCandidates` so agents can see the queue depth.
|
|
181
|
+
See [`docs/guides/mcp-agent-integration.mdx`](docs/guides/mcp-agent-integration.mdx).
|
|
323
182
|
|
|
324
|
-
|
|
183
|
+
### SDK
|
|
325
184
|
|
|
326
|
-
|
|
185
|
+
```ts
|
|
186
|
+
import { createWiki } from "llm-wiki-compiler";
|
|
327
187
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
sources:
|
|
333
|
-
- knowledge-compilation.md
|
|
334
|
-
confidence: 0.82 # 0–1, LLM-reported confidence in the synthesized page
|
|
335
|
-
provenanceState: merged # extracted | merged | inferred | ambiguous
|
|
336
|
-
contradictedBy:
|
|
337
|
-
- slug: probabilistic-reasoning
|
|
338
|
-
---
|
|
188
|
+
const wiki = createWiki({ root: "/path/to/wiki-project" });
|
|
189
|
+
await wiki.ingest({ source: "./notes.md" });
|
|
190
|
+
await wiki.compile();
|
|
191
|
+
const answer = await wiki.query({ question: "What changed?" });
|
|
339
192
|
```
|
|
340
193
|
|
|
341
|
-
|
|
194
|
+
See [`docs/guides/sdk.mdx`](docs/guides/sdk.mdx).
|
|
342
195
|
|
|
343
|
-
|
|
196
|
+
## Configuration
|
|
344
197
|
|
|
345
|
-
|
|
346
|
-
- `contradicted-page` — flags pages with non-empty `contradictedBy`
|
|
347
|
-
- `excess-inferred-paragraphs` — flags pages whose body has too many uncited prose paragraphs (counted directly from the rendered text — the body is the single source of truth, no frontmatter field involved)
|
|
198
|
+
Minimum requirement: Node.js 24 or newer.
|
|
348
199
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
Paragraph citations continue to use the original source-marker form:
|
|
352
|
-
|
|
353
|
-
```markdown
|
|
354
|
-
This paragraph is grounded in the source. ^[source.md]
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
For claims that need tighter verification, pages can pin a statement to a line range in the ingested source:
|
|
358
|
-
|
|
359
|
-
```markdown
|
|
360
|
-
The system uses a two-phase compile pipeline. ^[architecture-notes.md:42-58]
|
|
361
|
-
The same range can also use GitHub-style anchors. ^[architecture-notes.md#L42-L58]
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
`llmwiki lint` validates both forms. It reports missing source files, malformed claim citations, impossible ranges like line `0` or `8-3`, and ranges that extend past the end of the source file.
|
|
365
|
-
|
|
366
|
-
## Schema layer
|
|
367
|
-
|
|
368
|
-
Projects can optionally define `.llmwiki/schema.json` to shape the wiki beyond flat concept pages. Existing projects do not need a schema file; missing or invalid `kind` values fall back to `concept`.
|
|
200
|
+
The default provider is Anthropic:
|
|
369
201
|
|
|
370
202
|
```bash
|
|
371
|
-
|
|
372
|
-
llmwiki schema show
|
|
373
|
-
```
|
|
374
|
-
|
|
375
|
-
The schema supports four page kinds:
|
|
376
|
-
|
|
377
|
-
- `concept` — standalone idea or pattern
|
|
378
|
-
- `entity` — specific person, product, organization, or named artifact
|
|
379
|
-
- `comparison` — side-by-side analysis across concepts or entities
|
|
380
|
-
- `overview` — map page that connects several concepts in a domain
|
|
381
|
-
|
|
382
|
-
Schema rules can set per-kind `minWikilinks` and optional `seedPages`. Compile can materialize seed pages such as overviews, lint enforces page-kind-specific cross-link minimums, and review candidates surface schema violations before approval.
|
|
383
|
-
|
|
384
|
-
## Eval / quality measurement
|
|
385
|
-
|
|
386
|
-
`llmwiki eval` gives the wiki a quantitative health score and tracks citation quality over time, making it possible to detect regressions after a recompile.
|
|
387
|
-
|
|
388
|
-
```bash
|
|
389
|
-
llmwiki eval # fast suite: health score, citation coverage, corpus stats
|
|
390
|
-
llmwiki eval --suite full # + LLM-as-judge citation support scoring (requires API)
|
|
391
|
-
llmwiki eval report # re-print the most recent report
|
|
392
|
-
llmwiki eval history # trend table across past runs
|
|
393
|
-
llmwiki eval history --n 10 # limit to last 10 entries
|
|
394
|
-
llmwiki eval judgements # all cached citation judgements
|
|
395
|
-
llmwiki eval judgements --score 0 # only unsupported citations
|
|
396
|
-
llmwiki eval judgements --page some-slug # filter to one page
|
|
397
|
-
llmwiki eval cache show # score distribution + top-cited pages
|
|
398
|
-
llmwiki eval cache clear # wipe the citation judgement cache
|
|
203
|
+
export ANTHROPIC_API_KEY=sk-...
|
|
399
204
|
```
|
|
400
205
|
|
|
401
|
-
|
|
206
|
+
Provider selection is environment-driven:
|
|
402
207
|
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
-
|
|
208
|
+
| Provider | Typical setup |
|
|
209
|
+
|---|---|
|
|
210
|
+
| Anthropic | `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN` |
|
|
211
|
+
| Claude Agent SDK | Local Claude Code login, `LLMWIKI_PROVIDER=claude-agent` |
|
|
212
|
+
| OpenAI-compatible | `LLMWIKI_PROVIDER=openai`, `OPENAI_API_KEY`, optional `OPENAI_BASE_URL` |
|
|
213
|
+
| Ollama | `LLMWIKI_PROVIDER=ollama`, `OLLAMA_HOST` |
|
|
214
|
+
| GitHub Copilot | `LLMWIKI_PROVIDER=copilot`, `GITHUB_TOKEN=$(gh auth token)` |
|
|
408
215
|
|
|
409
|
-
|
|
216
|
+
See [`docs/configuration/providers.mdx`](docs/configuration/providers.mdx) and [`docs/configuration/environment-variables.mdx`](docs/configuration/environment-variables.mdx).
|
|
410
217
|
|
|
411
|
-
|
|
412
|
-
health_score: 85
|
|
413
|
-
citation_coverage_percent: 70
|
|
414
|
-
citation_precision_percent: 90
|
|
415
|
-
citation_support_mean: 1.4 # only checked when --suite full
|
|
416
|
-
```
|
|
218
|
+
## Quality and safety model
|
|
417
219
|
|
|
418
|
-
|
|
220
|
+
llmwiki is designed for auditable generated knowledge:
|
|
419
221
|
|
|
420
|
-
**
|
|
222
|
+
- **Review before write.** Use `compile --review` or `.llmwiki/config.json` review policy to hold risky pages as candidates.
|
|
223
|
+
- **Fail-closed config.** Invalid review-policy config aborts compile instead of silently disabling review.
|
|
224
|
+
- **Source confinement.** Source snippets and import/export paths are confined to the project.
|
|
225
|
+
- **Freshness is explicit.** Pages can be fresh, stale, orphaned, or unverified; stale pages are flagged and repairable.
|
|
226
|
+
- **Imported compiled knowledge is staged by default.** External bundles go through the review queue unless explicitly trusted.
|
|
227
|
+
- **CI gates are supported.** `llmwiki lint` and `llmwiki eval` can enforce quality thresholds.
|
|
421
228
|
|
|
422
|
-
|
|
423
|
-
.llmwiki/eval/
|
|
424
|
-
history.jsonl one JSON line per eval run
|
|
425
|
-
citation-cache.jsonl one JSON line per citation judgement
|
|
426
|
-
thresholds.yaml optional CI threshold config
|
|
427
|
-
```
|
|
229
|
+
See [`docs/configuration/review-policy.mdx`](docs/configuration/review-policy.mdx), [`docs/troubleshooting/stale-pages.mdx`](docs/troubleshooting/stale-pages.mdx), and [`docs/guides/ci-quality-gates.mdx`](docs/guides/ci-quality-gates.mdx).
|
|
428
230
|
|
|
429
|
-
|
|
231
|
+
## Scale and what works
|
|
430
232
|
|
|
233
|
+
llmwiki is still early software, but it is no longer a toy pipeline for a handful of notes.
|
|
431
234
|
|
|
432
|
-
|
|
235
|
+
- **Incremental compilation** means unchanged sources do not flow back through the LLM.
|
|
236
|
+
- **Chunk-level embeddings** narrow large wikis before BM25 reranking and graph expansion.
|
|
237
|
+
- **Content-hash-aware embedding updates** avoid recomputing vectors for unchanged pages and chunks.
|
|
238
|
+
- **Cached citation judgements** make repeated `eval --suite full` runs cheaper.
|
|
239
|
+
- **Lexical fallback** keeps query/context workflows usable when the active provider has no embedding endpoint.
|
|
240
|
+
- **Prompt budgeting and ingest truncation metadata** make large sources explicit instead of silently pretending they fit.
|
|
433
241
|
|
|
434
|
-
|
|
242
|
+
The current sweet spot is a durable project or domain wiki: research folders, codebase docs, team handbooks, standards, design notes, decision logs, or curated source packs. The less ideal fit is a high-churn firehose where raw search is enough and compiled structure would go stale faster than it can be reviewed.
|
|
435
243
|
|
|
436
|
-
|
|
244
|
+
## Documentation
|
|
437
245
|
|
|
246
|
+
The full docs site source is in [`docs/`](docs/):
|
|
438
247
|
|
|
439
|
-
|
|
248
|
+
- Start here: [`docs/introduction.mdx`](docs/introduction.mdx)
|
|
249
|
+
- Quickstart: [`docs/quickstart.mdx`](docs/quickstart.mdx)
|
|
250
|
+
- Installation: [`docs/installation.mdx`](docs/installation.mdx)
|
|
251
|
+
- Karpathy's LLM Wiki pattern: [`docs/concepts/karpathy-pattern.mdx`](docs/concepts/karpathy-pattern.mdx)
|
|
252
|
+
- How the compiler works: [`docs/concepts/how-it-works.mdx`](docs/concepts/how-it-works.mdx)
|
|
253
|
+
- Wiki model: [`docs/concepts/wiki-model.mdx`](docs/concepts/wiki-model.mdx)
|
|
254
|
+
- CLI reference: [`docs/cli/`](docs/cli/)
|
|
255
|
+
- Open Knowledge Format: [`docs/guides/open-knowledge-format.mdx`](docs/guides/open-knowledge-format.mdx)
|
|
256
|
+
- MCP integration: [`docs/guides/mcp-agent-integration.mdx`](docs/guides/mcp-agent-integration.mdx)
|
|
257
|
+
- SDK: [`docs/guides/sdk.mdx`](docs/guides/sdk.mdx)
|
|
258
|
+
- Atomic Memory bridge: [`docs/guides/atomic-memory-bridge.mdx`](docs/guides/atomic-memory-bridge.mdx)
|
|
440
259
|
|
|
441
|
-
|
|
260
|
+
Preview the docs locally with Node 24:
|
|
442
261
|
|
|
443
262
|
```bash
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
llmwiki query "What terms did Andrej coin?"
|
|
263
|
+
cd docs
|
|
264
|
+
volta run --node 24 npx mint dev --port 3001
|
|
447
265
|
```
|
|
448
266
|
|
|
449
|
-
|
|
450
|
-
|
|
267
|
+
## Current release
|
|
451
268
|
|
|
452
|
-
|
|
269
|
+
Version `0.10.0` includes review policy, source-freshness repair, Open Knowledge Format import/export/re-export support, the Claude Agent SDK provider, and the Mintlify docs site. See [`CHANGELOG.md`](CHANGELOG.md) for release history.
|
|
453
270
|
|
|
454
|
-
|
|
271
|
+
## Companion: Atomic Memory
|
|
455
272
|
|
|
456
|
-
|
|
273
|
+
llmwiki and [Atomic Memory](https://github.com/atomicstrata/atomicmemory) are complementary open context infrastructure:
|
|
457
274
|
|
|
275
|
+
- **llmwiki** compiles source material into durable, inspectable knowledge.
|
|
276
|
+
- **Atomic Memory** gives agents runtime memory that is searchable, scoped, correctable, and inspectable.
|
|
458
277
|
|
|
459
|
-
<
|
|
460
|
-
<summary><span style="font-size: 1.4em;"><strong>MCP Server — click to expand</strong></span></summary>
|
|
278
|
+
Use them independently or together. The [`@atomicmemory/llmwiki`](https://github.com/atomicstrata/atomicmemory/tree/main/packages/llmwiki) bridge imports `llmwiki export --target json --project-id <id>` as durable memory records.
|
|
461
279
|
|
|
280
|
+
## Contributing
|
|
462
281
|
|
|
463
|
-
|
|
282
|
+
Good first contributions are usually docs, provider setup improvements, importer/exporter polish, eval fixtures, or focused CLI ergonomics. Larger feature work should start with an issue or design discussion.
|
|
464
283
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
Where [llm-wiki-kit](https://github.com/iamsashank09/llm-wiki-kit) gives agents raw CRUD against wiki pages, llmwiki exposes the **automated pipelines**: agents get intelligent compilation, incremental change detection, and semantic query routing built in.
|
|
468
|
-
|
|
469
|
-
### Setup
|
|
470
|
-
|
|
471
|
-
Start the server (stdio transport, no API key required at startup):
|
|
284
|
+
Before committing code changes, run:
|
|
472
285
|
|
|
473
286
|
```bash
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
Add to your client's MCP config (e.g. `claude_desktop_config.json`):
|
|
480
|
-
|
|
481
|
-
```json
|
|
482
|
-
{
|
|
483
|
-
"mcpServers": {
|
|
484
|
-
"llmwiki": {
|
|
485
|
-
"command": "npx",
|
|
486
|
-
"args": ["llm-wiki-compiler", "serve", "--root", "/path/to/wiki-project"],
|
|
487
|
-
"env": {
|
|
488
|
-
"ANTHROPIC_API_KEY": "sk-ant-..."
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
}
|
|
287
|
+
npx tsc --noEmit
|
|
288
|
+
npm run build
|
|
289
|
+
npm test
|
|
290
|
+
npm run fallow:ci
|
|
493
291
|
```
|
|
494
292
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
### Tools
|
|
498
|
-
|
|
499
|
-
| Tool | What it does |
|
|
500
|
-
|------|--------------|
|
|
501
|
-
| `ingest_source` | Fetch a URL or local file into `sources/`. |
|
|
502
|
-
| `compile_wiki` | Run the incremental compile pipeline; returns counts, slugs, errors. |
|
|
503
|
-
| `query_wiki` | Two-step grounded answer with optional `--save`. |
|
|
504
|
-
| `search_pages` | Return full content of pages relevant to a question. |
|
|
505
|
-
| `read_page` | Read a single page by slug (concepts/ then queries/). |
|
|
506
|
-
| `lint_wiki` | Run quality checks; returns structured diagnostics. |
|
|
507
|
-
| `wiki_status` | Page count, source count, orphans, pending changes (read-only). |
|
|
508
|
-
| `get_context_pack` | Build an agent-ready evidence pack (primary pages, semantic chunks, graph neighbors, citations, warnings, suggested actions) — same v1 JSON envelope as `llmwiki context --json`. `get_context_pack` **packages evidence**; `query_wiki` **generates answers**. |
|
|
509
|
-
|
|
510
|
-
### Resources
|
|
511
|
-
|
|
512
|
-
| URI | Returns |
|
|
513
|
-
|-----|---------|
|
|
514
|
-
| `llmwiki://index` | Full `wiki/index.md` content. |
|
|
515
|
-
| `llmwiki://concept/{slug}` | A single concept page (frontmatter + body). |
|
|
516
|
-
| `llmwiki://query/{slug}` | A single saved query page. |
|
|
517
|
-
| `llmwiki://sources` | List of ingested source files with metadata. |
|
|
518
|
-
| `llmwiki://state` | Compilation state (per-source hashes, last compile times). |
|
|
519
|
-
|
|
520
|
-
</details>
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
<br>
|
|
524
|
-
|
|
525
|
-
---
|
|
526
|
-
|
|
527
|
-
<br>
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
## Limitations
|
|
531
|
-
|
|
532
|
-
Early software. Best for small, high-signal corpora (a few dozen sources). Query routing is index-based.
|
|
533
|
-
|
|
534
|
-
**Honest about truncation.** Sources that exceed the character limit are truncated on ingest with `truncated: true` and the original character count recorded in frontmatter, so downstream consumers know they're working with partial content.
|
|
535
|
-
|
|
536
|
-
## Karpathy's LLM Wiki pattern vs this compiler
|
|
537
|
-
|
|
538
|
-
Karpathy describes an abstract pattern for turning raw data into compiled knowledge. Here's how llmwiki maps to it:
|
|
539
|
-
|
|
540
|
-
| Karpathy's concept | llmwiki | Status |
|
|
541
|
-
|---|---|---|
|
|
542
|
-
| Data ingest | `llmwiki ingest` | Implemented |
|
|
543
|
-
| Compile wiki | `llmwiki compile` | Implemented |
|
|
544
|
-
| Q&A | `llmwiki query` | Implemented |
|
|
545
|
-
| Output filing (save answers back) | `llmwiki query --save` | Implemented |
|
|
546
|
-
| Auto-recompile | `llmwiki watch` | Implemented |
|
|
547
|
-
| Linting / health-check pass | `llmwiki lint` | Implemented |
|
|
548
|
-
| Agent integration | `llmwiki serve` (MCP server) | Implemented |
|
|
549
|
-
| Image support | `llmwiki ingest <image>` | Implemented |
|
|
550
|
-
| Marp slides | `llmwiki export --target marp` | Implemented |
|
|
551
|
-
| Fine-tuning | — | Not yet implemented |
|
|
552
|
-
|
|
553
|
-
## Roadmap
|
|
554
|
-
|
|
555
|
-
Shipped in 0.8.0:
|
|
556
|
-
|
|
557
|
-
- ✅ Guided project flow — `llmwiki next` recommends the next useful command, and `llmwiki quickstart <source>` ingests, compiles, and opens the viewer in one step
|
|
558
|
-
- ✅ Graph/context layer — `llmwiki context` and MCP `get_context_pack` produce token-budgeted evidence packs with primary pages, graph neighbors, citations, optional source windows, warnings, and suggested actions
|
|
559
|
-
- ✅ Viewer graph route — `llmwiki view` includes a force-directed `#/graph` route for exploring page relationships
|
|
560
|
-
- ✅ Evaluation harness — `llmwiki eval` measures health score, citation coverage/precision, corpus stats, regression deltas, optional LLM-as-judge citation support, and CI thresholds
|
|
561
|
-
|
|
562
|
-
Shipped in 0.7.0:
|
|
563
|
-
|
|
564
|
-
- ✅ Read-only local web viewer — `llmwiki view` with sidebar navigation, markdown rendering, search, metadata, health counts, and provenance/citation chips
|
|
565
|
-
- ✅ GitHub Copilot provider — `LLMWIKI_PROVIDER=copilot` with `GITHUB_TOKEN=$(gh auth token)` for Copilot chat/tool calls
|
|
566
|
-
- ✅ Cached lint health summary — `llmwiki lint` writes `.llmwiki/last-lint.json` so viewer health can show the latest lint counts without re-running lint
|
|
567
|
-
|
|
568
|
-
Shipped in 0.6.0:
|
|
569
|
-
|
|
570
|
-
- ✅ Export bundle (`llms.txt`, JSON, JSON-LD, GraphML, Marp slides)
|
|
571
|
-
- ✅ Session-history adapters — `llmwiki ingest-session` for Claude, Codex, and Cursor exports
|
|
572
|
-
- ✅ Configurable output language — `--lang <code>` and `LLMWIKI_OUTPUT_LANG`
|
|
573
|
-
- ✅ Defensive per-concept prompt budget so popular shared concepts don't crash compile
|
|
574
|
-
|
|
575
|
-
Shipped in 0.5.0:
|
|
576
|
-
|
|
577
|
-
- ✅ Multimodal ingest (images, PDFs, transcripts)
|
|
578
|
-
- ✅ Chunked retrieval with reranking and `--debug` output
|
|
579
|
-
- ⚠️ Minimum Node version raised to 24 (was 18)
|
|
580
|
-
|
|
581
|
-
Shipped in 0.4.0:
|
|
582
|
-
|
|
583
|
-
- ✅ Claim-level provenance with source ranges
|
|
584
|
-
- ✅ First-class schema layer with typed page kinds (`concept`, `entity`, `comparison`, `overview`)
|
|
585
|
-
|
|
586
|
-
Shipped in 0.3.0:
|
|
587
|
-
|
|
588
|
-
- ✅ Candidate review queue (approve compile output before pages are written)
|
|
589
|
-
- ✅ Confidence and contradiction metadata on compiled pages
|
|
590
|
-
|
|
591
|
-
Shipped in 0.2.0:
|
|
592
|
-
|
|
593
|
-
- ✅ Better provenance (paragraph-level source attribution)
|
|
594
|
-
- ✅ Linting pass for wiki quality checks
|
|
595
|
-
- ✅ Multi-provider support (OpenAI, Ollama, MiniMax)
|
|
596
|
-
- ✅ Larger-corpus query strategy (semantic search, embeddings)
|
|
597
|
-
- ✅ Deeper Obsidian integration (tags, aliases, Map of Content)
|
|
598
|
-
- ✅ MCP server for agent integration
|
|
599
|
-
|
|
600
|
-
Next up:
|
|
601
|
-
|
|
602
|
-
- **Task and decision ledger** — turn session ingest into durable agent memory: goals, decisions, open questions, outcomes, and next-agent handoffs.
|
|
603
|
-
- **Rollback, audit, and source lifecycle** — undo/reverse ingest, compile diff reports, stale-claim checks, freshness reports, and a durable operation log.
|
|
604
|
-
- **Domain templates** — schema/prompt packs for research, codebase docs, team handbooks, decision logs, and standards/regulations.
|
|
605
|
-
- **Eval extensions** — retrieval recall suites, update-drift benchmarks, and comparisons against serious retrieval baselines.
|
|
606
|
-
|
|
607
|
-
Later / open to discussion:
|
|
608
|
-
|
|
609
|
-
- Recurring source refresh jobs — re-ingest URLs on a schedule, diff against the prior snapshot, re-compile only what changed
|
|
610
|
-
- MCP prompt resources — curated agent prompts such as "review the wiki", "propose new sources", and "draft a comparison page"
|
|
611
|
-
- Codex OAuth provider — ChatGPT subscription auth as a dedicated provider, with clear token refresh and embedding-limit behavior
|
|
612
|
-
- Team-chat connectors for Slack/Discord/Teams-style institutional memory
|
|
613
|
-
|
|
614
|
-
If you like ambitious problems: **task/decision ledger**, **rollback/audit tooling**, and **eval extensions** are the meatiest next contributions. Open an issue to claim one or kick off a design discussion.
|
|
615
|
-
|
|
616
|
-
Explicitly not planned (good ideas, just not for this repo): full static-site generator, desktop or mobile apps, fine-tuning, a formal ontology engine, heavy graph database infrastructure.
|
|
617
|
-
|
|
618
|
-
## Requirements
|
|
619
|
-
|
|
620
|
-
Node.js >= 24, plus provider credentials (for Anthropic: `ANTHROPIC_API_KEY` or `ANTHROPIC_AUTH_TOKEN`).
|
|
293
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md).
|
|
621
294
|
|
|
622
295
|
## License
|
|
623
296
|
|
|
624
297
|
MIT
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
## Disclaimer
|
|
628
|
-
|
|
629
|
-
No LLMs were harmed in the making of this repo.
|