Knowledge base operating system — AI agents compile raw sources into persistent, cross-linked Markdown wikis with concurrency control, multi-provider LLM integration, FTS5 search, and community detection
Project description
LLM Wiki Monorepo
pip install baissarienterprises-llm-wiki
A knowledge base that builds itself. AI agents compile raw sources into persistent, cross-linked Markdown wikis. Instead of re-retrieving documents on every query (RAG), the system incrementally builds and maintains a living wiki from your sources. Knowledge compounds over time. No database. No API lock-in. One repo. Any agent. Any machine.
Features
- Two-Step Chain-of-Thought Ingest — LLM analyzes sources first, then generates structured wiki pages with SHA256 caching, streaming Stage 1 progress, and multi-provider LLM support (OpenAI, Anthropic, DeepSeek, or agent-native with zero API keys)
- Agent-Native LLM Provider — routes ingest calls through Hermes, Claude Code, or Codex models directly — no external API keys required when running inside an AI agent session
- Structured Output — Pydantic-typed FILE and REVIEW blocks via instructor — no fragile regex parsing. 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), content-hash conflict detection (SHA256 in frontmatter), and three-tier conflict management with automatic cleanup
- 15-Pass Automated Lint — dead links, orphans, frontmatter validation, contradictions, source drift, unresolved conflicts, stale page detection when raw sources change
- 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
- SQLite FTS5 Search — full-text search with SHA256 freshness detection, pre-build at startup, incremental updates, BM25 fallback.
--rebuildflag for full reindex - Inverted Entity Index — dual-map entity→pages + page→entities for O(1) link suggestion lookups. 4-signal scoring with automatic wikilink insertion (
--apply) - MCP Server — 10 stdio tools for programmatic wiki access. Direct Python sidecar with zero subprocess overhead. Integrates with Claude Desktop, Codex, Cursor, and any MCP-compatible client
- Community Verification Suite — NMI/ARI cross-validation across 5 seeds, statistical similarity metrics, modularity tolerance within 1% relative error
- Backup & Recovery — tar.gz snapshots with restore, integrity verification, and automatic pruning. One-command
--autofor safe state - 19 Domain Templates — research, codebase, finance, machine learning, cybersecurity, medicine, algorithmic trading, and more. Every template provides 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, auto-trigger ingest after clip
- CI/CD Pipeline — pytest + vitest matrix across Python 3.10–3.12 and Node 18–22, coverage reporting, caching, benchmark artifacts
Quick Start
# Install from PyPI
pip install baissarienterprises-llm-wiki
# Or install from source
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
llm-wiki lint ~/my-wiki
# Clean up old conflicts automatically
llm-wiki lint ~/my-wiki --clean-conflicts
# Build search index
llm-wiki index ~/my-wiki
# Discover hidden connections
llm-wiki insights ~/my-wiki
# Health check
llm-wiki health ~/my-wiki
# Start MCP server
llm-wiki serve ~/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, sidecar,
│ lock_wiki, atomic_write, content_hash,
│ index_wiki, louvain, health_check, wiki_logging
├── LLM Provider Layer → openai, anthropic, litellm, opencode
│ (src/llm_wiki/ + skill/scripts/providers/)
├── MCP Server (stdio) → programmatic access, 10 tools,
│ direct sidecar (zero subprocess)
├── Graph Engine (Node.js) → relevance model, Louvain, insights,
│ graphology bridge, verification suite
├── Web Viewer + Obsidian Plugin → human browsing + feedback
├── Browser Extension → web clipping + auto-ingest
└── templates/ → 19 domain schemas
Packages
| Package | Language | Purpose |
|---|---|---|
skill/ |
Python + Markdown | Agent skill (8 operations) + 20+ scripts + 12 reference docs |
src/llm_wiki/ |
Python | PyPI package — CLI, LLM providers, concurrency, search, graph insights |
mcp-server/ |
TypeScript | MCP server — 10 tools, direct sidecar integration |
graph-engine/ |
TypeScript | Knowledge graph — relevance, Louvain communities, insights, verification |
templates/ |
Markdown + JSON | 19 domain-specific project templates |
tests/ |
Python + TypeScript | pytest (ingest, lint, concurrency, search, opencode) + vitest (graph, mcp) |
web-viewer/ |
TypeScript | Preview server with search + graph insights panel |
extension/ |
JavaScript | Chrome web clipper with auto-ingest |
audit-shared/ |
TypeScript | Shared audit file format library |
plugins/obsidian-audit/ |
TypeScript | Obsidian plugin — file feedback from vault |
Templates (19 domains)
research codebase finance algorithmic-trading cybersecurity machine-learning prompt-engineering copywriting marketing design-systems architecture crypto commodities decompilers medicine developer-tools personal-growth reading business
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 |
QUICKGUIDE.md |
Every command with real examples |
AGENTS.md |
Architecture, conventions, build/test commands, Python Dependency Policy |
CHANGELOG.md |
Full version history — all features, changes, and breaking changes |
INDEX.md |
Complete file tree with descriptions |
VERSIONING.md |
Semantic versioning policy and release process |
PURPOSE.md |
Why this system exists |
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, tiktoken, python-dotenv, pydantic, portalocker (auto-installed via
pip install)
Credits
The foundational methodology comes from Andrej Karpathy's llm-wiki pattern — using LLMs to incrementally build and maintain a personal wiki from raw sources. This project is a production-grade implementation with concurrency control, multi-provider LLM support, FTS5 search, MCP integration, and community detection.
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baissarienterprises_llm_wiki-0.2.1.tar.gz.
File metadata
- Download URL: baissarienterprises_llm_wiki-0.2.1.tar.gz
- Upload date:
- Size: 113.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de5708a2344c604699255062423c74949b00eb6e566911ef41d7b69626074ff6
|
|
| MD5 |
7cf790b37470f4a05e7abe4dcd3b4a4b
|
|
| BLAKE2b-256 |
3c3e61694ea6de29ef038394912159b407f99713b57bd3f947d1baa616ffb7b2
|
Provenance
The following attestation bundles were made for baissarienterprises_llm_wiki-0.2.1.tar.gz:
Publisher:
release.yml on JeanBaissari/llm-wiki-monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baissarienterprises_llm_wiki-0.2.1.tar.gz -
Subject digest:
de5708a2344c604699255062423c74949b00eb6e566911ef41d7b69626074ff6 - Sigstore transparency entry: 2073109876
- Sigstore integration time:
-
Permalink:
JeanBaissari/llm-wiki-monorepo@c4e8cc93920f208961b207993f7766cc6e6a0cae -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/JeanBaissari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4e8cc93920f208961b207993f7766cc6e6a0cae -
Trigger Event:
push
-
Statement type:
File details
Details for the file baissarienterprises_llm_wiki-0.2.1-py3-none-any.whl.
File metadata
- Download URL: baissarienterprises_llm_wiki-0.2.1-py3-none-any.whl
- Upload date:
- Size: 75.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1022923abee05774fb9aa9eeca2c8f1c6e5ab0d28681cb061d6dafdede45cd2
|
|
| MD5 |
71964d6d5ab42359661ee9bd947634b0
|
|
| BLAKE2b-256 |
f6c24d1462d149aa3d3a151544ab3f70f32dec270839c2c4c9bef7aa2fa34ab6
|
Provenance
The following attestation bundles were made for baissarienterprises_llm_wiki-0.2.1-py3-none-any.whl:
Publisher:
release.yml on JeanBaissari/llm-wiki-monorepo
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
baissarienterprises_llm_wiki-0.2.1-py3-none-any.whl -
Subject digest:
c1022923abee05774fb9aa9eeca2c8f1c6e5ab0d28681cb061d6dafdede45cd2 - Sigstore transparency entry: 2073109932
- Sigstore integration time:
-
Permalink:
JeanBaissari/llm-wiki-monorepo@c4e8cc93920f208961b207993f7766cc6e6a0cae -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/JeanBaissari
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c4e8cc93920f208961b207993f7766cc6e6a0cae -
Trigger Event:
push
-
Statement type: