GitHub Copilot Wiki: An AI-Powered Second Brain Template

A forkable template for building LLM-maintained personal knowledge bases using GitHub Copilot, implementing Andrej Karpathy's Compounding Knowledge Pattern.

View on GitHub

GitHub Copilot LLM Wiki: Compounding Knowledge Engine

A production-grade, zero-dependency, LLM-first personal knowledge engine implementing Andrej Karpathy’s Compounding Knowledge Pattern.

License: MIT Python: 3.10+ Multi-LLM Knowledge Graph Semantic Retrieval PRs Welcome


πŸ’‘ The Philosophy: LLM-First Compounding Knowledge

Traditional RAG (Retrieval-Augmented Generation) chops unstructured text into disjointed chunks and embeds them into opaque vector databases. Every query searches for statistical cosine similarity, leaving the knowledge base static, fragile, and disconnected from document hierarchy.

This project implements the Compounding Knowledge Pattern popularized by Andrej Karpathy, purpose-built as an LLM-First Knowledge Engine:

                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚          HUMAN USER            β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                     β”‚ Natural Language Queries
                                     β–Ό
                     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                     β”‚    AI ASSISTANT / AGENT        β”‚
                     β”‚ (Copilot, Claude, Gemini, etc) β”‚
                     β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”˜
          Deterministic Tool β”‚                β”‚ Progressive Context
               & Graph Calls β”‚                β”‚ Retrieval
                             β–Ό                β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        KNOWLEDGE ENGINE CORE                           β”‚
β”‚                                                                        β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  compiles  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   raw/ (Immutable)    β”‚ ─────────► β”‚ wiki/                       β”‚  β”‚
β”‚  β”‚   - Primary Sources   β”‚            β”‚   - entities/   - concepts/ β”‚  β”‚
β”‚  β”‚   - Archived Deltas   β”‚            β”‚   - comparisons/- sources/  β”‚  β”‚
β”‚  β”‚                       β”‚            β”‚   - qa/         - archive/  β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚                                                      β”‚                 β”‚
β”‚         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”‚
β”‚         β–Ό                                                       β–Ό      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ wiki/semantic-index.json      β”‚     β”‚ wiki/graph.json            β”‚  β”‚
β”‚  β”‚ (Dense summaries & keywords)  β”‚     β”‚ (Nodes & directed edges)   β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🌟 What This Repository Offers

1. πŸ” Sub-Cent Query Routing (wiki/semantic-index.json)

Large wikis (200+ pages) quickly saturate LLM context windows if agents load arbitrary markdown files. The engine generates a dense, file-based semantic index containing entity summaries, high-signal keyword maps (with built-in stopword filtering), and outbound link lists.

2. πŸ•ΈοΈ Directed Property Graph (wiki/graph.json)

The entire wiki is modeled as a formal directed property graph. Every entity and concept declares typed, single-direction relationships adhering to a closed taxonomy:

The manifest generator compiles all nodes and relationships into wiki/graph.json with sub-second execution, automatically detecting graph orphans and disconnected components.

3. πŸ“‚ Hierarchical Progressive Disclosure Indexes

To scale beyond context limits, indexes are deterministically compiled by scripts/build-index.py:

4. πŸ€– Multi-LLM Environment Adapters

Dedicated instruction files tuned for each major AI coding assistant, synchronized from authoritative schemas to eliminate prompt drift:

5. πŸ”Œ Pluggable Source Intake Architecture (adapters/)

Normalize diverse external formats into clean, standardized markdown in raw/<slug>.md:

6. πŸ•’ Living Source Freshness & Volatility Classes

Knowledge decays at different rates. Every ingested source document specifies an explicit Volatility Class:

The linter (scripts/lint-wiki.py) automatically evaluates Last Verified timestamps and warns when documents enter aging or stale status.

7. πŸ”„ 3-Way Delta Reingest Engine (scripts/reingest.py)

When a primary source changes:

8. πŸ“Έ Git-Backed Semantic Snapshots & Instant Rollback

Perform batch operations and experimental ingests with complete safety:

9. πŸ›‘οΈ Strict Deterministic Linter (scripts/lint-wiki.py)

Run python scripts/lint-wiki.py --strict to validate:


πŸ“ Repository Structure

copilot-llm-wiki/
β”œβ”€β”€ raw/                             ← Primary sources (IMMUTABLE: read-only)
β”‚   └── archive/                     ← Previous source snapshots for delta reingest
β”œβ”€β”€ wiki/                            ← Persistent knowledge layer (LLM-MAINTAINED)
β”‚   β”œβ”€β”€ index.md                     ← Root routing index
β”‚   β”œβ”€β”€ log.md                       ← Append-only chronological audit log
β”‚   β”œβ”€β”€ overview.md                  ← Top-level orientation and domain overview
β”‚   β”œβ”€β”€ graph.json                   ← Auto-generated directed property graph
β”‚   β”œβ”€β”€ semantic-index.json          ← Dense local keyword & candidate routing index
β”‚   β”œβ”€β”€ entities/                    ← Named things: actors, systems, APIs, services
β”‚   β”œβ”€β”€ concepts/                    ← Core abstractions: protocols, lifecycles, rules
β”‚   β”œβ”€β”€ comparisons/                 ← Side-by-side matrices and trade-off tables
β”‚   β”œβ”€β”€ sources/                     ← Summaries and volatility metadata of ingested docs
β”‚   β”œβ”€β”€ qa/                          ← Synthesized answers to multi-page queries
β”‚   └── archive/                     ← Deprecated and superseded knowledge documents
β”œβ”€β”€ adapters/                        ← Pluggable intake adapter framework
β”‚   β”œβ”€β”€ base.py                      ← Abstract BaseSourceAdapter
β”‚   β”œβ”€β”€ url_adapter.py               ← Web page scraper and markdown converter
β”‚   β”œβ”€β”€ pdf_adapter.py               ← PDF text extractor
β”‚   β”œβ”€β”€ csv_adapter.py               ← CSV to Markdown table converter
β”‚   β”œβ”€β”€ github_issues_adapter.py     ← GitHub Issue/PR parser
β”‚   └── registry.py                  ← Protocol and extension routing registry
β”œβ”€β”€ scripts/                         ← Deterministic automation CLI tools (Python + Shell + PS1)
β”‚   β”œβ”€β”€ build-index.py               ← Hierarchical sub-index & root catalog compiler
β”‚   β”œβ”€β”€ build-graph.py               ← Directed property graph compiler
β”‚   β”œβ”€β”€ build-semantic-index.py      ← Semantic candidate index compiler
β”‚   β”œβ”€β”€ intake.py                    ← Multi-format intake router
β”‚   β”œβ”€β”€ reingest.py                  ← Delta reingestion & archive engine
β”‚   β”œβ”€β”€ lint-wiki.py                 ← Strict comprehensive wiki linter
β”‚   β”œβ”€β”€ snapshot.py                  ← Git tag-based snapshot capture
β”‚   β”œβ”€β”€ rollback.py                  ← Instant semantic rollback
β”‚   └── sync-adapters.py             ← Multi-LLM adapter synchronizer
β”œβ”€β”€ tests/                           ← Comprehensive stdlib test suite (23 tests)
β”œβ”€β”€ .github/copilot-instructions.md  ← Authoritative GitHub Copilot instruction schema
β”œβ”€β”€ AGENTS.md                        ← Cross-vendor unified agent instructions
β”œβ”€β”€ CLAUDE.md                        ← Claude Code environment instructions
β”œβ”€β”€ .gemini/GEMINI.md                ← Google Antigravity & Gemini CLI instructions
β”œβ”€β”€ .cursorrules                     ← Cursor IDE root instructions
└── .cursor/rules/wiki.mdc           ← Cursor rules file format

⚑ Quickstart Guide

1. Clone & Set Up

git clone https://github.com/SriSatyaLokesh/copilot-llm-wiki.git my-wiki
cd my-wiki

No virtual environments or pip installs required for core operations. Python 3.10+ standard library is all you need.

2. Ingesting New Material

Tell your LLM assistant:

β€œIngest https://docs.github.com/en/copilot/overview” or β€œAdd data/pricing.csv to the wiki”

Or run the intake router from your terminal:

# Normalize any URL, PDF, CSV, or GitHub issue into raw/<slug>.md
python scripts/intake.py https://docs.github.com/en/copilot/overview

The LLM will:

  1. Normalize and read the source into raw/<slug>.md.
  2. Present key takeaways and outline pages to create or update.
  3. Check for contradictions against existing wiki notes.
  4. Write a source summary in wiki/sources/<slug>.md with its Volatility Class.
  5. Create or update entity and concept pages with explicit ## Relationships and provenance footnotes.
  6. Rebuild all indexes, graph manifests, and semantic indexes via python scripts/build-index.py.
  7. Append an audit entry to wiki/log.md.

3. Querying Accumulated Knowledge

Ask your AI assistant:

β€œWhat systems participate in change order provisioning and what are their dependencies?”

The LLM will:

  1. Consult wiki/semantic-index.json or scripts/build-semantic-index.py --query "..." to locate exact candidate files in milliseconds without scanning the whole repository.
  2. Traverse typed edges in wiki/graph.json to follow related entities.
  3. Synthesize an answer with explicit file and source citations.
  4. Offer to save the synthesized answer as a new document in wiki/qa/.

4. Health & Consistency Linting

Verify your knowledge base anytime:

python scripts/lint-wiki.py --strict
# Or use cross-platform runners:
./scripts/lint.sh
.\scripts\lint.ps1

5. Capturing Snapshots & Rolling Back

# Capture a snapshot before a batch ingest
python scripts/snapshot.py pre-ingest "Before importing 10 RFC specs"

# Rollback anytime if an ingest is unsatisfactory
python scripts/rollback.py pre-ingest

πŸ› οΈ CLI Tool Reference

All scripts provide cross-platform Bash (.sh) and PowerShell (.ps1) wrappers:

Command Description
python scripts/intake.py <src> Ingests URL, PDF, CSV, or GitHub Issue into raw/<slug>.md
python scripts/build-index.py Recompiles all 6 silo sub-indexes, root index.md, graph, and semantic index
python scripts/build-graph.py Generates wiki/graph.json and reports isolated orphan nodes
python scripts/build-semantic-index.py Generates wiki/semantic-index.json for fast keyword query routing
python scripts/lint-wiki.py --strict Runs strict validation (indexes, graph, links, citations, freshness, adapters)
python scripts/snapshot.py <name> Creates a semantic Git snapshot of the wiki
python scripts/rollback.py <name> Reverts wiki/ to a previously captured snapshot
python scripts/reingest.py <slug> Archives prior source and triggers 3-way delta evaluation
python scripts/sync-adapters.py Synchronizes CLAUDE.md, .gemini/GEMINI.md, and Cursor instructions
python -m unittest discover tests Runs the full test suite (23 tests, sub-second execution)

πŸ”’ Cardinal Rules & Invariants

  1. raw/ is immutable: Never edit or delete files in raw/. It serves as the untampered source of truth for claim citations and delta reingestion.
  2. wiki/log.md is append-only: Never modify or truncate historical log entries.
  3. Index-first routing: LLMs must check wiki/semantic-index.json or wiki/index.md before loading or creating notes.
  4. Zero-contradiction guarantee: Any conflict between new sources and existing wiki pages must be explicitly surfaced to the user before committing.
  5. Deterministic indexing: LLMs never edit index.md, graph.json, or semantic-index.json manually; they are compiled deterministically by scripts.

🀝 Contributing & Community

Contributions are warmly welcomed! Please check out CONTRIBUTING.md and our Code of Conduct.


πŸ“œ Citation & License

@software{copilot_llm_wiki_2026,
  author = {Sri Satya Lokesh},
  title = {GitHub Copilot LLM Wiki: Compounding Knowledge Engine},
  url = {https://github.com/SriSatyaLokesh/copilot-llm-wiki},
  year = {2026}
}

This project is open-source software licensed under the MIT License.


Built on Andrej Karpathy’s Compounding Knowledge Pattern. Engineered for the multi-LLM era.