Skip to main content

LLM-powered CLI that compiles documents, papers, and notes into an Obsidian-compatible markdown wiki with automatic [[wiki-links]] and backlinks

Project description

wiki-compiler

PyPI Python License Tests

"I think there is room here for an incredible new product instead of a hacky collection of scripts."

An LLM-powered CLI that compiles raw documents into structured markdown wikis. Feed it articles, papers, notes, and transcripts -- it extracts concepts, builds cross-references, and maintains a living knowledge base.

Why not just use ChatGPT?

Chat conversations are ephemeral. You ask, you get an answer, it's gone. wiki-compiler builds something persistent and structured:

  • Accumulates knowledge -- every document you ingest adds to a growing, interconnected wiki
  • Cross-references automatically -- concepts link to each other via [[wiki-links]]
  • Lives in your filesystem -- plain markdown files you own, version with git, read with any editor
  • Works offline -- use Ollama for fully local compilation
  • Auditable -- every article tracks its sources and confidence level

Demo

$ wiki-compiler init my-research && cd my-research
Initialized knowledge base at ./my-research

$ wiki-compiler ingest paper.pdf --provider claude
Ingesting paper.pdf...
  Created: wiki/sources/attention-is-all-you-need.md
  Created: wiki/concepts/transformer-architecture.md
  Created: wiki/concepts/attention-mechanism.md
  Updated: wiki/_index.md
  3 articles created, 0 updated

$ wiki-compiler stats
  Articles: 3
  Concepts: 2  |  Sources: 1
  Wiki-links: 7  |  Backlinks: 5
  Tags: 4 unique across 3 articles

$ wiki-compiler lint
  0 errors  0 warnings  1 info
  Health Score: 98/100

Installation

pip install wiki-compiler

# Or with pipx for isolated install
pipx install wiki-compiler

# With specific LLM provider support
pip install "wiki-compiler[anthropic]"   # Claude
pip install "wiki-compiler[openai]"      # OpenAI
pip install "wiki-compiler[all]"         # All providers

Quick Start

# 1. Initialize a knowledge base
wiki-compiler init my-kb
cd my-kb

# 2. Ingest a document
wiki-compiler ingest paper.pdf --provider claude

# 3. See what you've built
wiki-compiler stats

# 4. Query your knowledge base
wiki-compiler query "what is transformer attention?"

Architecture

Raw Documents          wiki-compiler            Structured Wiki
                    +------------------+
  paper.pdf    --> |   Ingester       | -->  wiki/concepts/attention.md
  notes.md     --> |   Compiler       | -->  wiki/concepts/transformers.md
  article.txt  --> |   Linker         | -->  wiki/sources/paper-2024.md
                   |   Indexer        | -->  wiki/_index.md
                    +------------------+
                          |
                     LLM Provider
                   (Claude/OpenAI/Ollama)

Pipeline

  1. Ingest -- Raw document goes in, LLM extracts concepts and creates individual wiki articles
  2. Link -- Scanner finds [[wiki-links]], builds backlink graph, suggests new connections
  3. Compile -- LLM reads the full wiki, identifies gaps and overlaps, reorganizes
  4. Index -- Generates master index with categories, statistics, and navigation

Commands

Command LLM Required Description
wiki-compiler init [path] No Initialize a new knowledge base
wiki-compiler ingest <file> Yes Ingest a raw document
wiki-compiler compile Yes Reorganize and improve the wiki
wiki-compiler query "..." Yes Ask questions about your knowledge base
wiki-compiler lint [--fix] No Check wiki for structural issues
wiki-compiler stats No Show wiki statistics
wiki-compiler index No Rebuild the master index

Provider Configuration

Set your preferred provider via environment variables:

# Anthropic Claude (recommended)
export ANTHROPIC_API_KEY=sk-ant-...

# OpenAI
export OPENAI_API_KEY=sk-...

# Ollama (local, no key needed)
export OLLAMA_HOST=http://localhost:11434  # default

Override per-command:

wiki-compiler ingest doc.md --provider ollama --model llama3
wiki-compiler query "what is X?" --provider openai --model gpt-4o

Wiki Structure

my-kb/
  wiki/
    _index.md          # Auto-generated master index
    concepts/          # Extracted concepts and knowledge
      attention.md
      transformers.md
    sources/           # Source document summaries
      paper-2024.md
    wiki.yaml          # Wiki configuration

Each article includes YAML frontmatter:

---
title: "Attention Mechanism"
tags: [deep-learning, nlp, transformers]
sources: [paper-2024]
related: [transformers, self-attention]
confidence: high
created: 2026-04-03
updated: 2026-04-03
---

FAQ

How do I compile documents into a wiki with AI?

Install wiki-compiler via pip install wiki-compiler, run wiki-compiler init my-kb to create a knowledge base, then use wiki-compiler ingest <file> to feed it any document. The CLI uses an LLM to extract concepts, generate structured markdown articles, and automatically cross-reference them with [[wiki-links]].

What LLM providers does wiki-compiler support?

wiki-compiler supports Anthropic Claude, OpenAI (GPT-4o and others), and Ollama for local models. You can set a default provider via environment variables or override per-command with --provider and --model flags.

Can wiki-compiler work offline?

Yes. Use Ollama as your provider to run fully offline with local models like Llama 3. Commands that don't require an LLM -- such as lint, stats, and index -- always work offline with no API key needed.

How is wiki-compiler different from just using ChatGPT?

ChatGPT conversations are ephemeral -- you ask a question, get an answer, and it disappears into your history. wiki-compiler builds a persistent, structured knowledge base of plain markdown files that accumulate over time, cross-reference automatically, and live in your filesystem where you can version them with git.

Does wiki-compiler work with Obsidian?

Yes. wiki-compiler outputs standard markdown with [[wiki-links]] and YAML frontmatter, which is exactly the format Obsidian uses. You can point Obsidian at your wiki directory and get full graph view, backlinks, and search out of the box.

Sister Projects

Development

git clone https://github.com/SingggggYee/wiki-compiler
cd wiki-compiler
pip install -e ".[dev,all]"
pytest
ruff check src/

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

wiki_compiler-0.1.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wiki_compiler-0.1.0-py3-none-any.whl (29.2 kB view details)

Uploaded Python 3

File details

Details for the file wiki_compiler-0.1.0.tar.gz.

File metadata

  • Download URL: wiki_compiler-0.1.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.6

File hashes

Hashes for wiki_compiler-0.1.0.tar.gz
Algorithm Hash digest
SHA256 90b5de672ad13837b3ec2fb5495bf55fae452d84b589a46911bf6f146a235dc9
MD5 18d200a44a4caec027664b00c517fbd6
BLAKE2b-256 12ebaa8e2a0eb59d724af611cf16b8dc04171844516dc8f820b7ed695f55e500

See more details on using hashes here.

File details

Details for the file wiki_compiler-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wiki_compiler-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bf2e51c7a2205c7c44ee6883e301096ac37e271f5b0bdc315eb1cccd1647f8ed
MD5 90cc96f182ed43957e17bb3bada2fea7
BLAKE2b-256 a3dae1c44288e006ab2d2b2244dd4f3370010d31de44eaaf1835552ce988371e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page