# LLM Wiki An Obsidian plugin that turns raw notes, clippings, and chat exports into an interlinked, AI-maintained personal wiki. Pages get YAML frontmatter, confidence scores, memory tiers, and graph edges — and the plugin keeps them healthy over time. Designed as the knowledge core of a self-hosted second brain. Pairs naturally with [signal-bridge](https://github.com/enduserlab/signal-bridge), [signal-inbox](https://github.com/enduserlab/signal-inbox), and [perplexity-bridge](https://github.com/enduserlab/perplexity-bridge) for capture, and with [canvas-knowledge-graph](https://github.com/enduserlab/canvas-renderer) for spatial exploration. ## How it works LLM Wiki implements four operations against a pool of raw sources: 1. **Ingest** — reads files from a raw sources folder, asks Claude to extract a title, summary, body, entities, tags, and confidence, then writes a structured wiki page with rich frontmatter and `[[wiki links]]`. 2. **Query** — runs local keyword search across wiki pages, or hands ranked context to Claude for a synthesised answer with cited sources. 3. **Lint** — scans the wiki for orphans, broken links, stale confidence, low-confidence pages, duplicate entities, missing frontmatter, empty pages, and tier mismatches. 4. **Crystallize** — picks groups of related pages and asks Claude to merge them into a higher-tier consolidated page, marking contradictions and creating `supersedes` edges. A separate **memory lifecycle** runs Ebbinghaus-style confidence decay, evaluates tier promotions/demotions, and flags stale pages. ## Memory tiers Every page lives in one of four tiers, inspired by human memory consolidation: | Tier | What it means | |--------------|----------------------------------------------------| | `working` | Just ingested, not yet validated | | `episodic` | Confirmed once, still tied to its source | | `semantic` | Corroborated, generalised, durable | | `procedural` | High-confidence, multi-source, long-lived | Pages start in `working` and get promoted as confidence grows and corroborations accumulate. They get demoted when confidence decays below the tier floor. ## Setup ### Prerequisites - Obsidian 1.5.0+ - An Anthropic API key ([console.anthropic.com](https://console.anthropic.com)) ### Install 1. Copy the `llm-wiki` folder into your vault's `.obsidian/plugins/` directory 2. Run `npm install && npm run build` inside the plugin folder 3. Enable "LLM Wiki" in Obsidian Settings → Community Plugins 4. Open LLM Wiki settings and enter your API key 5. (Optional) Adjust raw sources, wiki, and schema folder paths ### Folder layout ``` your-vault/ ├── _sources/ ← drop raw files here for ingest ├── _schema/ │ └── graph.json ← knowledge graph (nodes + edges) └── wiki/ ← structured wiki pages with frontmatter ``` All paths are configurable in settings. ## Frontmatter shape After ingest, wiki pages look like this: ```yaml --- title: Retrieval-augmented generation aliases: - RAG tags: - llm - architecture tier: semantic source_type: llm-ingest source_path: _sources/karpathy-talk.md entity_type: concept created: 2026-04-12T20:00:00.000Z modified: 2026-04-15T08:30:00.000Z related: - "[[Vector Databases]]" - "[[Embeddings]]" supersedes: [] confidence: value: 0.78 last_evaluated: 2026-04-15T08:30:00.000Z source_date: 2026-04-12T20:00:00.000Z corroborations: 3 disputed: false --- ``` ## Commands - **Ingest all raw sources** — process every file in the raw sources folder - **Ingest current file** — process the active file - **Search wiki (local)** — fast keyword search, no API calls - **Ask wiki (Claude-powered)** — Claude synthesises an answer from top-matching pages - **Lint wiki** — surface health issues across the wiki - **Run memory lifecycle** — apply confidence decay and tier evaluation - **Show crystallize candidates** — list groups of pages that could be merged - **Show wiki stats** — counts of nodes, edges, and orphans ## Settings | Setting | Default | Description | |-----------------------|-------------------------------|------------------------------------------------------| | API key | — | Your Anthropic API key | | Model | Sonnet 4 | Model used for ingest, query, crystallize | | Max tokens | 4096 | Maximum tokens per response | | Raw sources folder | `_sources` | Where unprocessed files live | | Wiki folder | `wiki` | Where structured pages are written | | Schema folder | `_schema` | Where `graph.json` is stored | | Auto-ingest | On | Automatically ingest new files dropped into sources | | Lint on startup | On | Run lint when the vault opens | | Confidence decay rate | 0.02 | Daily exponential decay rate | | Stale days | 30 | Days before a page is flagged stale | | Default entity type | concept | Used when ingest can't infer one | ## Knowledge graph The plugin maintains a JSON-encoded graph at `_schema/graph.json`: - **Nodes** — one per wiki page, indexed by file path. Stores title, entity type, tier, and confidence. - **Edges** — typed, directed relationships: `related-to`, `part-of`, `derived-from`, `contradicts`, `supersedes`, `supports`, `example-of`, `prerequisite`. The graph is the source of truth for orphan detection, crystallize candidate selection, and supersedes resolution. Pair with the [Canvas Knowledge Graph](https://github.com/enduserlab/canvas-renderer) plugin to render it as a live Obsidian canvas. ## Development ```bash cd llm-wiki npm install npm run dev # watch mode — rebuilds on save ``` Symlink the plugin folder into your test vault's `.obsidian/plugins/` directory. Reload Obsidian (Ctrl+R / Cmd+R) after rebuilds. ## License MIT