LM Studio plugin that turns a folder into a persistent, LLM-maintained wiki: pages, raw sources, an auto-rebuilt index, and an append-only activity log.
The pattern follows Andrej Karpathy's LLM Wiki gist: instead of querying raw documents from scratch every time (RAG), the model incrementally builds and curates a markdown wiki that compounds over time. Three workflows: ingest new sources, query the wiki, lint for drift.
The plugin provides the primitives ā sandboxed, atomic, with auto-backup and auto-indexing. The model is the curator.
The plugin owns a single root directory, configured via the Wiki root field:
<root>/ āāā index.md # auto-maintained catalog (between marker comments) āāā log.md # append-only activity log āāā WIKI.md # editable schema/conventions doc the model reads āāā pages/ # wiki pages (markdown), one topic per file āāā sources/ # raw immutable sources (+ optional <name>.meta.json) āāā .wiki-backup/ # snapshots of overwritten/deleted files
index.md and log.md use marker comments (<!-- wiki:pages:auto -āā¦<!-- /wiki:pages:auto -ā) so the plugin only ever rewrites the auto-region ā anything outside is yours to edit freely.
wiki_init(name?, description?, schema?, overwrite?) ā scaffold a fresh wiki. Creates the dirs and the three top-level files.wiki_status() ā counts of pages and sources, last 10 log entries. First call when picking up wiki work.wiki_lint() ā read-only health-check: pages missing from the index, broken cross-links, orphans, duplicate names.wiki_save_source(name, content, origin?) ā store a raw source. origin is recorded in <name>.meta.json and shown in the index.wiki_read_source(name) ā read with origin.wiki_list_sources(filter?) ā list with origins.wiki_search(pattern, scope?, ignore_case?, max_results?) ā regex across pages/, sources/, or both.wiki_log_append(kind, subject, message) ā manual log entry for query results, ingest decisions, etc. (Writes/deletes/renames already log themselves.)The sibling filesystem plugin uses a two-call write protocol so the user can approve a preview before any write. That works on ~8B models but is brittle on ~4B (small models tend to skip the confirm). The wiki plugin drops the protocol entirely:
.wiki-backup/<kind>/<name>.<timestamp>.bak), so writes are reversible.This is the design choice: trade explicit preview for atomic operations + recoverability. Suited to a personal knowledge base where the user inspects the result after.
Designed to compose with the other plugins in this repo:
filesystem: pull in something from anywhere on disk and fold it in.
| Field | Type | Default | Notes |
|---|---|---|---|
| Wiki root | string | "" | Absolute path of the wiki dir. Tilde (~) expands. Required. |
| Max page size (KB) | int | 512 | Cap on wiki_read_page / wiki_read_source. |
| Max search matches | int | 200 | wiki_search stops after this many lines. |
| Max search files | int | 2000 | wiki_search stops after scanning this many files. |
Encoded in the auto-generated WIKI.md. Edit it freely to encode your own taxonomy ā the model is expected to read it before contributing. Defaults:
.md extension. One canonical name per concept.category, tags, summary (used by the index).[link text](other-page.md). The lint tool flags broken links.Linux (AppImage) / cross-OS:
After install: in any chat, click the tools button and enable wiki. Then set the Wiki root field in the per-chat config (e.g. ~/Documents/wiki) and ask the model to call wiki_init.
MIT
wiki_rebuild_index() ā force-rebuild the auto-region of index.md from disk.wiki_list_pages(filter?) ā list pages with summaries (frontmatter summary: or first prose line).wiki_read_page(name) ā read one page.wiki_write_page(name, content, summary?) ā create/overwrite. Backs up the prior version, rebuilds index, appends to log ā all in one call.wiki_delete_page(name) ā backup + delete + reindex + log.wiki_rename_page(old_name, new_name) ā rename + reindex + log. Returns potential_referrers (pages that may contain stale links) but does not rewrite them ā the model decides.anonymize: redact PII from a source before it lands in the wiki.
wiki_search / wiki_read_page to query, wiki_write_page to ingest, wiki_lint to maintain.lms clone zexigh/wiki
cd wiki
lms dev -i
read_file ā wiki_save_source ā wiki_write_page
read_file ā anonymize_text ā wiki_save_source ā wiki_write_page