llm-wiki-compiler 0.5.0 → 0.6.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 CHANGED
@@ -112,6 +112,23 @@ The OpenAI SDK defaults to a 10-minute per-request timeout, which can cut off lo
112
112
 
113
113
  Defaults: 10 minutes for `openai`, 30 minutes for `ollama` (local models commonly need more).
114
114
 
115
+ ### Output language
116
+
117
+ Generated wiki content defaults to whatever language the model produces from the source material — typically English. Override with either:
118
+
119
+ - `LLMWIKI_OUTPUT_LANG` — e.g. `zh-CN`, `Chinese`, `ja`, `Japanese`. Applies to every prompt the compile and query pipelines make.
120
+ - `--lang <code>` on `llmwiki compile` and `llmwiki query` — same effect, scoped to one invocation. Wins over the env var.
121
+
122
+ Unset preserves prior behaviour byte-for-byte.
123
+
124
+ ### Per-concept prompt budget
125
+
126
+ 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.
127
+
128
+ - `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.
129
+
130
+ A truncation warning prints to stderr when the cap fires so you know which concept hit the budget.
131
+
115
132
  ## Why not just RAG?
116
133
 
117
134
  RAG retrieves chunks at query time. Every question re-discovers the same relationships from scratch. Nothing accumulates.
@@ -167,8 +184,10 @@ Pages include source attribution in frontmatter. Paragraphs are annotated with `
167
184
  | Command | What it does |
168
185
  |---------|-------------|
169
186
  | `llmwiki ingest <url\|file>` | Fetch a URL or copy a local file into `sources/` |
187
+ | `llmwiki ingest-session <path>` | Import a Claude/Codex/Cursor session export (single file or whole directory) into `sources/` |
170
188
  | `llmwiki compile` | Incremental compile: extract concepts, generate wiki pages |
171
189
  | `llmwiki compile --review` | Write candidate pages to `.llmwiki/candidates/` instead of `wiki/` so you can review before they land |
190
+ | `llmwiki compile --lang <code>` | Generate wiki content in the given language (e.g. `Chinese`, `ja`, `zh-CN`); also works on `query` |
172
191
  | `llmwiki review list` | List pending candidate pages |
173
192
  | `llmwiki review show <id>` | Print a candidate's title, summary, and body |
174
193
  | `llmwiki review approve <id>` | Promote a candidate into `wiki/` and refresh index/MOC/embeddings |
@@ -177,6 +196,7 @@ Pages include source attribution in frontmatter. Paragraphs are annotated with `
177
196
  | `llmwiki schema show` | Print the resolved schema for the current project |
178
197
  | `llmwiki query "question"` | Ask questions against your compiled wiki |
179
198
  | `llmwiki query "question" --save` | Answer and save the result as a wiki page |
199
+ | `llmwiki export [--target <name>]` | Export the wiki to portable formats — `llms.txt`, `llms-full.txt`, JSON, JSON-LD, GraphML, Marp slides |
180
200
  | `llmwiki lint` | Check wiki quality (broken links, orphans, empty pages, low confidence, contradictions, etc.) |
181
201
  | `llmwiki watch` | Auto-recompile when `sources/` changes |
182
202
  | `llmwiki serve [--root <dir>]` | Start an MCP server exposing wiki tools to AI agents |
@@ -229,17 +249,16 @@ confidence: 0.82 # 0–1, LLM-reported confidence in the synthesized p
229
249
  provenanceState: merged # extracted | merged | inferred | ambiguous
230
250
  contradictedBy:
231
251
  - slug: probabilistic-reasoning
232
- inferredParagraphs: 1 # paragraphs the LLM marked as inferred (vs cited)
233
252
  ---
234
253
  ```
235
254
 
236
- When multiple sources merge into one slug, metadata is reconciled: `min` confidence, `provenanceState = 'merged'`, union of `contradictedBy` (deduped by slug), `max` `inferredParagraphs`.
255
+ When multiple sources merge into one slug, metadata is reconciled: `min` confidence, `provenanceState = 'merged'`, union of `contradictedBy` (deduped by slug).
237
256
 
238
257
  `llmwiki lint` adds three rules that surface this metadata:
239
258
 
240
259
  - `low-confidence` — flags pages with `confidence` below a threshold
241
260
  - `contradicted-page` — flags pages with non-empty `contradictedBy`
242
- - `excess-inferred-paragraphs` — flags pages with too many inferred paragraphs without citations
261
+ - `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)
243
262
 
244
263
  ## Claim-level provenance
245
264
 
@@ -364,12 +383,19 @@ Karpathy describes an abstract pattern for turning raw data into compiled knowle
364
383
  | Auto-recompile | `llmwiki watch` | Implemented |
365
384
  | Linting / health-check pass | `llmwiki lint` | Implemented |
366
385
  | Agent integration | `llmwiki serve` (MCP server) | Implemented |
367
- | Image support | | Not yet implemented |
368
- | Marp slides | | Not yet implemented |
386
+ | Image support | `llmwiki ingest <image>` | Implemented |
387
+ | Marp slides | `llmwiki export --target marp` | Implemented |
369
388
  | Fine-tuning | — | Not yet implemented |
370
389
 
371
390
  ## Roadmap
372
391
 
392
+ Shipped in 0.6.0:
393
+
394
+ - ✅ Export bundle (`llms.txt`, JSON, JSON-LD, GraphML, Marp slides)
395
+ - ✅ Session-history adapters — `llmwiki ingest-session` for Claude, Codex, and Cursor exports
396
+ - ✅ Configurable output language — `--lang <code>` and `LLMWIKI_OUTPUT_LANG`
397
+ - ✅ Defensive per-concept prompt budget so popular shared concepts don't crash compile
398
+
373
399
  Shipped in 0.5.0:
374
400
 
375
401
  - ✅ Multimodal ingest (images, PDFs, transcripts)
@@ -395,11 +421,6 @@ Shipped in 0.2.0:
395
421
  - ✅ Deeper Obsidian integration (tags, aliases, Map of Content)
396
422
  - ✅ MCP server for agent integration
397
423
 
398
- Next up:
399
-
400
- - Export bundle (`llms.txt`, JSON, JSON-LD, GraphML, Marp)
401
- - Session-history adapters (Claude, Codex, Cursor exports)
402
-
403
424
  Future ideas (open to discussion):
404
425
 
405
426
  - Recurring source refresh jobs — re-ingest URLs on a schedule, diff against the prior snapshot, re-compile only what changed