LLM Wiki Monorepo
Agent-native knowledge compiler.
AI agents turn raw documents into persistent, cross-linked Markdown wikis.
No database. No API lock-in. One git clone.
What • Features • Quick Start • Architecture • Packages • Templates • Docs • Credits • License
pip install baissarienterprises-llm-wiki
No local models required. LLM Wiki is agent-native: the intelligence comes from the agent you already run (Codex, Hermes, Claude, OpenCode). The base install is lexical/keyword-only and performs no model downloads. Optional extras for local computation remain opt-in and are not part of the supported default story.
What's New in v0.6.4 — "Lean & Certified"
Local-model surface removed. The unused @sentropic/graphify hard dependency is gone (with its 239-package / ~606 MiB closure: @ai-sdk/*, Ollama provider, tree-sitters, DB drivers), along with the --code-analysis/merged/export-graph code paths and the web code-graph route (ADR-0035). The knowledge graph is fully offline and wikilink-derived. Optional Python extras remain opt-in and are no longer promoted as a recommended profile.
Provenance closed. graph-engine/src/relevance.ts and insights.ts were independently reimplemented as clean-room MIT code with behavior parity verified against the previous implementation; the provenance ledger now reflects this.
Packaging fixed. install.sh now installs the Python package (the llm-wiki console script actually exists afterwards), and wheels ship all 20 domain templates plus py.typed. scaffold resolves package-internal templates first, so pip-installed wikis are no longer silently generic.
Integrity hardened. Lock acquisition is race-free (O_EXCL + owner token + rename-based stale break), page writes are atomic, backups are temp+rename with sha256 verification and staged restore, malformed tuning.toml yields a clean config error, hybrid search honors --set bm25.*, and no-provider ask fails with an actionable message instead of a silent null.
Release gates are real. The version manifest is green, docs_truth_check scans the live docs, the certifier's gates exit nonzero on failure, the zero-test guard covers all workspaces, a slow-tests lane runs, coverage is floored at 70%, and publishing is gated on certification.
What's New in v0.6.2
Install.sh completeness. install.sh now builds all packages in dependency order: graph-bridge → graph-engine → mcp-server → audit-shared → web-viewer → obsidian-audit. Previously graph-bridge was missing, causing graph-engine imports to fail.
Template scaffolding fix. scaffold.py now handles both array and dict extra-dirs.json formats — 7 templates (business, commodities, decompilers, developer-tools, medicine, personal-growth, reading) previously created wrong directories.
Developer hygiene. .hermes/ added to .gitignore to prevent accidental commits of local skill config.
What's New in v0.6.0 — "Epistemic & Surface"
One-command setup. llm-wiki setup <root> [--title] scaffolds/validates a wiki and registers the MCP server with every detected client — claude, codex, opencode, hermes — idempotently, with --dry-run/--uninstall and a health + tools/list smoke test (LWM_035).
Ask this wiki. llm-wiki ask <root> "<question>" answers questions grounded in the wiki — hybrid retrieval over pages + community summaries with a summary-aware rerank, exactly one structured LLM call on the agent-native $0.00 default, a --no-llm deterministic offline mode, and a faithfulness contract (answer entities ⊆ cited pages). MCP llm_wiki_ask included (LWM_033).
Contradictions + evidence confidence. llm-wiki contradictions <root> detect|list|apply|unapply extracts typed claims, detects contradictions (unit-normalized numerics, polarity, exclusive categories) suggest-only, and computes evidence-grounded confidence (high/medium/low + evidence_score) into the confidence/contested/contradictions frontmatter fields — author-overridable via confidence_source: evidence|author (LWM_034).
Demo wiki. llm-wiki demo <dest> materializes a committed, lint-clean "Redis Internals" playground (8 pages) from the installed package or repo, in one command (LWM_036).
Optional local-compute extras (legacy, not required): [semantic], [leiden], [entity-resolution], and [ner] remain available for advanced local computation but are deliberately outside the supported default story — the base install and the agent-native $0.00 path cover every core operation (LWM_037).
Web-viewer derived overlay + Sigma.js + exports. The quarantined derived layer renders as an off-by-default dashed overlay (byte-identical when off), with a Sigma.js WebGL view and JSON Canvas / JSON-LD exports — web-viewer-only diff, no backend change (LWM_038).
Standing gold-set curation. scripts/curate_gold_set.py + a release-certify gate_search_goldset_fresh gate make per-minor gold-set growth a procedure, not a decision (LWM_039 §A).
What's New in v0.5.0 — "Graph Precision"
Entity resolution. llm-wiki entities resolve|list|unmerge collapses variant surface forms ("GPT-4" / "GPT 4" / "gpt-4") into one canonical id through a reversible canonical↔alias table (JSONL source of truth + additive SQLite alias tables). Every merge is reversible; no page prose is ever rewritten. ER-F1 on a committed gold set gates it (ADR-0024).
Leiden community detection. Optional [leiden] sidecar (graspologic) with hierarchical levels — guaranteed-connected communities, NMI/modularity verification against Louvain, TS still only consumes (no TS Leiden, ADR-0025).
Typed + directed + bitemporal edges. One additive edge-schema evolution (relType/directed/validFrom/validTo/observedAt) — the undirected default output is byte-identical (ADR-0026).
Derived edges, quarantined. The graph discovers similarity + co-occurrence edges into a separate layer, excluded from all analytics by default and included only when the NMI+modularity gate passes (fail-closed, ADR-0027).
Hierarchical community summaries. llm-wiki summarize-communities writes first-class community-summary pages per community level + a global summary, with faithfulness filtering and stale-page cleanup (LWM_030).
Tuning constants → config. Every precision constant (relevance weights + type-affinity matrix, insights thresholds + signal scores, community resolution/seed, RRF k, BM25 k1/b, claim penalties — 52 settable keys) lives in one canonical TuningConfig surfaced by llm-wiki tuning with CLI > env > file > default precedence, emitted to the graph-engine via --tuning-json (ADR-0028).
Hybrid search is the default. Search fuses BM25 + semantic KNN via RRF by default, degrades to keyword byte-identically without the [semantic] extra, and keeps --keyword as the escape hatch — certified by a committed search gold set + gate (ADR-0020).
What is this?
LLM Wiki is a production-grade knowledge engine that turns raw documents into a living, cross-linked Markdown wiki. Instead of re-retrieving documents on every query (RAG), the system incrementally builds and maintains a persistent knowledge base. Sources are compiled once, kept current, and compound over time.
It's everything needed to run a self-building wiki in one monorepo: a Python CLI package, an MCP server, a knowledge graph engine with community detection, a Chrome web clipper, a web viewer, an Obsidian plugin, and 20 domain templates — wired through an agent skill that works with any LLM.
Five ways to run this
One repo, five entry surfaces — all reading and writing the same wiki/ directory. Pick the one that fits your setup.
1. CLI (Python package)
pip install baissarienterprises-llm-wiki
llm-wiki search ~/my-wiki "attention"
Scripts, CI, and humans get the full command surface — run llm-wiki <command> --help to explore. See the CLI reference.
2. MCP server (any MCP client)
npx llm-wiki-mcp --wiki ~/my-wiki
claude mcp add llm-wiki -- npx llm-wiki-mcp --wiki ~/my-wiki
Programmatic wiki access for any MCP client (Claude, Codex, Cursor, opencode) via 15 stdio tools. Register it with claude mcp add, the opencode opencode.json mcp form, or llm-wiki setup (one-command wiring, v0.6.0). Requires a built mcp-server: cd mcp-server && npm run build (or bash install.sh). See the MCP tools reference.
3. Hermes skill (in-conversation agent workflow)
ln -sf /path/to/llm-wiki-monorepo/skill ~/.hermes/skills/research/llm-wiki
Loads the ten-operation skill for Claude/Hermes sessions — agent-native, no API keys needed. See skill/SKILL.md.
4. Cron / automation
0 3 * * * cd ~/wikis/my-project && llm-wiki ingest raw/ --provider opencode
Schedule maintenance like ingest, lint, or backup. portalocker advisory locks make concurrent agent runs safe — multiple agents or CI jobs can operate on the same wiki without corrupting pages. See the concurrency reference and the quickstart.
5. MCP server launcher (stdio)
llm-wiki serve ~/my-wiki
Relay the MCP server over stdio (with --build to compile it on demand and --projects for multi-wiki mode). MCP clients normally launch npx llm-wiki-mcp --wiki <root> directly — see section 2 above. The optional web preview (mermaid, KaTeX, audit feedback) is the separate web-viewer server: cd web-viewer && npm start -- --wiki ~/my-wiki. It is local-only by default — see the security boundary.
Features
-
Two-Step Ingest — LLM analyzes sources first, then generates structured wiki pages. SHA256 caching skips unchanged files. Streaming progress, multi-provider support (OpenAI, Anthropic, DeepSeek), and agent-native mode that needs zero API keys.
-
Agent-Native Provider — route ingest through Hermes, Claude Code, or Codex directly. No external API keys required when running inside an AI agent session.
-
Structured Output — Pydantic-typed parsing via instructor. No regex guesswork. Retry with exponential backoff on transient failures. Token counting and cost estimation per operation.
-
Concurrency Control — per-page advisory locking, atomic writes (temp → fsync → rename), SHA256 conflict detection, and three-tier conflict management with automatic cleanup. Multiple agents can safely operate on the same wiki.
-
Knowledge Graph Engine — Louvain community detection with full Blondel et al. modularity. 4-signal relevance model with precomputed adjacency. Surprising connection discovery and knowledge gap detection. Pure Python fallback included.
-
15-Pass Automated Lint — dead links, orphans, frontmatter validation, contradictions, source drift, unresolved conflicts, and stale page detection when raw sources change.
-
SQLite FTS5 Search — full-text search with SHA256 freshness detection. Pre-builds at startup, incremental updates, BM25 fallback. Rebuild with
--rebuild. -
Inverted Entity Index — dual-map entity→pages + page→entities for O(1) link suggestions. 4-signal scoring with automatic wikilink insertion. Reversible entity resolution (canonical↔alias) collapses duplicate surface forms.
-
MCP Server — 15 stdio tools for programmatic wiki access. Direct Python sidecar with zero subprocess overhead. Integrates with Claude Desktop, Codex, Cursor, and any MCP-compatible client.
-
Hybrid Search (default) — BM25 + semantic vector KNN fused via RRF with a
--keywordescape hatch; degrades to keyword byte-identically without the[semantic]extra. Gold-set gate certifies no keyword regression. -
Tuning Config Surface —
llm-wiki tuningexposes every precision constant (relevance weights + type-affinity matrix, insights signal scores, community resolution/seed, RRF k, BM25 k1/b, claim penalties) with CLI > env > file > default precedence and a--emitboundary for the graph-engine. -
Community Verification Suite — NMI/ARI cross-validation across 5 seeds, statistical similarity metrics, modularity tolerance within 1% relative error. Optional Leiden engine with hierarchical levels (graspologic,
[leiden]extra). -
Derived-Edge Layer — similarity + co-occurrence edges the graph discovers into a separate quarantined layer, excluded from analytics by default and NMI+modularity-gated on inclusion (fail-closed).
-
Hierarchical Community Summaries — opt-in LLM summaries per community level + global summary as first-class generated pages, with faithfulness filtering and orphan cleanup.
-
Backup & Recovery — tar.gz snapshots with restore, integrity verification, and automatic pruning. One-command
--autofor safe state. -
20 Domain Templates — research, codebase, finance, machine learning, cybersecurity, medicine, algorithmic trading, and more. Every template ships with PURPOSE.md, SCHEMA.md → CLAUDE.md, and extra-dirs.json.
-
Deep Research — web search → fetch → ingest → synthesize. Multi-source compilation into structured wiki pages.
-
Chrome Web Clipper — one-click web page capture with Readability + Turndown; downloads clean markdown for manual
llm-wiki ingest. -
Claim & Epistemic Tracking — optional sidecar model: claims, epistemic events (created/reinforced/challenged/weakened/superseded/resolved), and contradiction records with JSONL storage. Health reports and diffs between wiki states.
-
Modular Architecture — the package ships 14 subpackages under
src/llm_wiki/:core/(primitives),quality/{claims,lint,audit}/,ingest/(pipeline),providers/(LLM adapters),graph/(louvain, insights, suggestions, entities, ask),search/(FTS5),semantic/(optional embeddings),eval/(gold-set gates),setup/(client wiring),ops/(health, serve, benchmark),wiki/(scaffold, backup, demo),research/(deep-research),contracts/(schema validation), andtemplates/(wheel template data). The MCP server is split from a 1,287-line monolith into 32 focused TypeScript files. -
CI/CD Pipeline — pytest + vitest matrix across Python 3.10–3.12 and Node 18–22, coverage reporting, trusted OIDC publishing to PyPI on tag push.
Quick Start
# Install from PyPI
pip install baissarienterprises-llm-wiki
# Or install the full repo from source — pip-installs the Python package
# (installing the `llm-wiki` console script), builds the TypeScript
# surfaces, and validates the CLI.
git clone https://github.com/JeanBaissari/llm-wiki-monorepo.git
cd llm-wiki-monorepo
bash install.sh
# Scaffold a wiki
llm-wiki scaffold ~/my-wiki "My Research" --template research
# Ingest a source (two-step agent loop)
llm-wiki ingest ~/my-wiki raw/articles/my-source.md
# Use agent-native provider (no API keys — inside Hermes/Claude Code/Codex)
llm-wiki ingest ~/my-wiki raw/articles/my-source.md --llm opencode
# Check quality (15 automated checks; --json for machine output)
llm-wiki lint ~/my-wiki
# Build search index
llm-wiki index ~/my-wiki
# Discover hidden connections
llm-wiki insights ~/my-wiki
# Health check
llm-wiki health ~/my-wiki
# Claim tracking (optional sidecar)
llm-wiki claims health ~/my-wiki
# Start the MCP server (15 tools via stdio)
npx llm-wiki-mcp --wiki ~/my-wiki
# Or run the opt-in local web preview (mermaid, KaTeX, audit feedback)
cd web-viewer && npm start -- --wiki ~/my-wiki
Architecture
wiki/ directory ← shared state (Markdown files)
│
├── Agent Skill + Python Scripts → 20+ scripts: scaffold, ingest, lint,
│ discover, insights, backup, link-suggest,
│ deep-research, audit, benchmark, serve
├── Python Package (src/llm_wiki/) → modular: core/ (primitives),
│ ├── core/ quality/ (claims, lint, audit),
│ ├── quality/ ingest/ (pipeline), providers/,
│ ├── ingest/ + providers/ graph/ (louvain, insights),
│ ├── graph/ + search/ search/ (FTS5), ops/ (health, serve),
│ ├── ops/ + wiki/ + research/ wiki/ (scaffold, backup),
│ └── contracts/ research/ (deep-research)
├── MCP Server (stdio) → 15 tools, modular: tools/,
│ adapters/, projects/, security/
├── Graph Engine (Node.js) → relevance model, Louvain, insights
├── shared-types (TS) → canonical GraphNode/GraphEdge types
├── Web Viewer + Obsidian Plugin → human browsing + feedback
├── Browser Extension → web clipping
└── src/llm_wiki/templates/ → 20 domain schemas
Packages
| Package | Language | Tier | Purpose |
|---|---|---|---|
skill/ |
Python + Markdown | adapter | Agent skill (10 operations) + 26 scripts + 12 reference docs |
src/llm_wiki/ |
Python | core | PyPI package — CLI, LLM providers, concurrency, search, graph insights |
mcp-server/ |
TypeScript | programmatic-access | MCP server — 15 tools, direct sidecar integration |
graph-engine/ |
TypeScript | analysis | Knowledge graph — relevance, Louvain communities, insights, verification |
src/llm_wiki/templates/ |
Markdown + JSON | core | 20 domain-specific project templates (single canonical tree) |
tests/ |
Python + TypeScript | core | pytest (ingest, lint, concurrency, search, opencode) + vitest (graph, mcp) |
web-viewer/ |
TypeScript | optional | Preview server with search + graph insights panel |
extension/ |
JavaScript | optional | Chrome web clipper |
audit-shared/ |
TypeScript | core | Shared audit file format library |
plugins/obsidian-audit/ |
TypeScript | optional | Obsidian plugin — file feedback from vault |
packages/shared-types/ |
TypeScript | core | Canonical GraphNode/GraphEdge type definitions |
Templates (20 domains)
research codebase finance algorithmic-trading algorithmic-trading-mql4 cybersecurity machine-learning prompt-engineering copywriting marketing design-systems architecture crypto commodities decompilers medicine developer-tools personal-growth reading business
Templates live in src/llm_wiki/templates/ — a single canonical package-internal tree (also shipped in the wheel).
Every template provides: PURPOSE.md (scope + goals), SCHEMA.md → CLAUDE.md (page types, conventions, frontmatter, cross-referencing, contradiction handling), extra-dirs.json (domain directories).
Documentation
| File | What it covers |
|---|---|
README.md |
You are here |
docs/getting-started/quickstart.md |
Every command with real examples |
docs/reference/cli.md |
Full CLI reference — all 27 commands with flags and examples |
docs/reference/mcp-tools.md |
All 15 MCP tools with schemas and usage examples |
AGENTS.md |
Architecture, conventions, build/test commands, Python Dependency Policy |
docs/release/changelog.md |
Full version history — all features, changes, and breaking changes |
docs/reference/file-map.md |
Complete file tree with descriptions |
docs/reference/tuning.md |
Tuning config surface — every constant, precedence, emit boundary |
docs/operations/ |
Operations runbooks — hybrid-default search migration note, index |
docs/operations/security-and-boundaries.md |
Per-wiki auth/visibility boundary — filesystem + git permissions, no network surface |
docs/release/versioning.md |
Semantic versioning policy and release process |
docs/architecture/overview.md |
Why this system exists — design philosophy and goals |
docs/adr/ |
Architecture Decision Records — ADRs 0001–0028 + index + decision register |
skill/references/ |
12 detailed reference guides including concurrency, observability, and ingest |
Requirements
- Python 3.10+ — for all skill scripts and PyPI package
- Node.js 18+ — for MCP server, graph engine, web viewer
- npm — for TypeScript package management
- pip dependencies — openai, anthropic, litellm, instructor, tenacity, pydantic, portalocker, tomli (Python 3.10 only) (auto-installed via
pip install)
Credits
Inspirations
The foundational methodology is inspired by Andrej Karpathy's llm-wiki pattern (MIT) — using LLMs to incrementally build and maintain a personal wiki from raw sources. This project is an independent, production-grade implementation with concurrency control, multi-provider LLM support, FTS5 search, MCP integration, and community detection. No code from Karpathy's gist is used.
Additional design patterns and API methodology were informed by nashsu/llm_wiki (GPL-3.0) and nashsu/llm_wiki_skill (GPL-3.0). Concepts from anzal1/quicky-wiki (MIT) influenced linting and claim-management design.
Code Derivations
graph-engine/src/relevance.ts— 4-signal relevance model with configurable weights, source indexing, and type-safe interfaces. Independently reimplemented as clean-room MIT code in v0.6.4. See docs/legal/provenance.md.graph-engine/src/insights.ts— Surprising connection detection and knowledge gap discovery with extensible signal registry. Independently reimplemented as clean-room MIT code in v0.6.4. See docs/legal/provenance.md.graph-engine/src/louvain.ts— Implements the Louvain community detection algorithm (Blondel et al. 2008) via the MIT-licensedgraphology-communities-louvainlibrary.
Related Projects
- nashsu/llm_wiki — Cross-platform Tauri desktop app with graph visualization, vector search, and rich chat interface. Licensed GPL-3.0.
- anzal1/quicky-wiki — MIT-licensed CLI/dashboard for claim extraction, confidence scoring, and metabolism.
Upstream License Notice
This project was inspired by concepts from GPL-3.0-licensed upstream projects. Code previously derived from nashsu/llm_wiki was independently reimplemented as clean-room MIT code in v0.6.4 (graph-engine/src/relevance.ts, graph-engine/src/insights.ts) with behavior parity verified against the prior implementation. See docs/legal/provenance.md for the full provenance ledger.
License
MIT
Metadata
Release files for baissarienterprises-llm-wiki 0.6.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| baissarienterprises_llm_wiki-0.6.4.tar.gz | 407.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| baissarienterprises_llm_wiki-0.6.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 715.8 kB
Release files / baissarienterprises_llm_wiki-0.6.4.tar.gz
| Download URL | baissarienterprises_llm_wiki-0.6.4.tar.gz |
|---|---|
| Size | 407.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9b93ddd77bd3f025372fb05a78fad00366b291184216a3a956cbd76ca5b9d9c2
|
|
BLAKE2b-256 checksum How to use checksums |
826891cdfad93cf122e75f95a3fa14fda5d72086160d321c9920f4bdf90d9a27
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / baissarienterprises_llm_wiki-0.6.4-py3-none-any.whl
| Download URL | baissarienterprises_llm_wiki-0.6.4-py3-none-any.whl |
|---|---|
| Size | 308.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1721e91f1b4d4807d1a084527fa9fbf9ac45cbc031d119224c0654ae35bd1eea
|
|
BLAKE2b-256 checksum How to use checksums |
dd868b141f45bd293c9b4966222150f123600481cc1a81a4b506b12431dcdab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log