GitHub Copilot LLM Wiki: Compounding Knowledge Engine
A production-grade, zero-dependency, LLM-first personal knowledge engine implementing Andrej Karpathyβs Compounding Knowledge Pattern.
π‘ 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:
- Humans query the LLM: You donβt waste time hunting through notes, browsing folder trees, or reading markdown files manually. You ask your AI coding assistant (GitHub Copilot, Claude Code, Gemini CLI, Cursor).
- The LLM maintains the Wiki: Your AI assistant acts as an autonomous librarian. It reads raw sources, creates canonical entities and concepts, tags claim citations, preserves historical provenance, and traverses semantic edges.
- Compounding returns: Every ingested document and every synthesized architectural answer permanently enriches the wiki. Instead of starting from scratch on every query, the LLM builds upon accumulated knowledge.
- Zero infrastructure overhead: 100% Python standard library. No vector database servers, no cloud API keys for storage, no Docker containers, and no complex external runtime dependencies. Runs directly inside any cloned git repository on Windows, Linux, and macOS.
ββββββββββββββββββββββββββββββββββ
β 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.
- Agents inspect
wiki/semantic-index.jsonor query via CLI (python scripts/build-semantic-index.py --query "<query>") to pinpoint exact candidate notes in milliseconds before reading file contents. - Zero cloud embeddings or vector DBs required.
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:
depends-on: Architectural or functional dependencyimplements: Realizes a specification, concept, or protocolpart-of: Hierarchical component or subsystem membershipsupersedes: Replaces an older entity or document (pairs with archiving)contradicts: Flags unresolved trade-offs or source conflictsrelated-to: Lateral association
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:
- Root Routing Index (
wiki/index.md): Contains high-level page counts and links to silo indexes. - Silo Sub-Indexes (
wiki/<silo>/index.md): Alphabetical catalogs with one-line descriptions forentities/,concepts/,comparisons/,sources/,qa/, andarchive/.
4. π€ Multi-LLM Environment Adapters
Dedicated instruction files tuned for each major AI coding assistant, synchronized from authoritative schemas to eliminate prompt drift:
- GitHub Copilot:
.github/copilot-instructions.md&AGENTS.md - Claude Code (Anthropic):
CLAUDE.md(optimized for Claude Opus/Sonnet, tool invocation, subagent delegation) - Google Antigravity & Gemini CLI:
.gemini/GEMINI.md(tuned for multi-tool workflows, directed graph navigation) - Cursor IDE:
.cursorrules&.cursor/rules/wiki.mdc(context indexing with@wiki/semantic-index.jsonand@wiki/graph.json) - Drift Synchronization Engine:
python scripts/sync-adapters.py --checkensures zero-drift across all platforms.
5. π Pluggable Source Intake Architecture (adapters/)
Normalize diverse external formats into clean, standardized markdown in raw/<slug>.md:
- Web Pages (
adapters/url_adapter.py): Fetches HTML, strips scripts/nav/styles, and formats semantic markdown. - PDF Documents (
adapters/pdf_adapter.py): Extracts multi-page text usingpypdfor built-in stream decoding fallback. - Tabular Data (
adapters/csv_adapter.py): Converts CSV files and raw tables into GitHub Flavored Markdown tables. - GitHub Issues/PRs (
adapters/github_issues_adapter.py): Pulls titles, descriptions, labels, and discussion threads viaghCLI or JSON exports. - Automatic Intake Router:
python scripts/intake.py <source>automatically selects the right adapter.
6. π Living Source Freshness & Volatility Classes
Knowledge decays at different rates. Every ingested source document specifies an explicit Volatility Class:
- High Volatility (30-day cycle): Microservice APIs, schemas, pricing tables, active product specs.
- Medium Volatility (90-day cycle): System architecture, integration workflows, team processes.
- Low Volatility (365-day cycle): Invariant math, RFC protocols, foundational design principles.
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:
- Prior raw snapshots are archived to
raw/archive/<slug>-<timestamp>.md. - A 3-way delta evaluation compares the prior source vs. the updated source against existing wiki pages.
- Reference-Counted Attribution: If an old assertion is removed from this source but backed by another active source, it remains cited. If no sources back it, it is safely moved to
### Deprecated / Historical Claimsrather than silently erased.
8. πΈ Git-Backed Semantic Snapshots & Instant Rollback
Perform batch operations and experimental ingests with complete safety:
- Snapshot:
python scripts/snapshot.py <name> [description]creates a lightweight Git tag (snapshot-<name>) and records an entry inwiki/meta/snapshots.md. - Rollback:
python scripts/rollback.py <name>performs a semantic rollback of thewiki/directory while preserving uncommitted work safety.
9. π‘οΈ Strict Deterministic Linter (scripts/lint-wiki.py)
Run python scripts/lint-wiki.py --strict to validate:
- Index synchronization across all 7 catalogs
- Graph manifest integrity and isolated orphan node detection
- Semantic index freshness and keyword mapping
- Multi-LLM instruction adapter synchronization
- Broken markdown links and archive link violations
- Claim provenance footnotes across all
## Key Facts - Source staleness based on volatility cycles
π 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:
- Normalize and read the source into
raw/<slug>.md. - Present key takeaways and outline pages to create or update.
- Check for contradictions against existing wiki notes.
- Write a source summary in
wiki/sources/<slug>.mdwith its Volatility Class. - Create or update entity and concept pages with explicit
## Relationshipsand provenance footnotes. - Rebuild all indexes, graph manifests, and semantic indexes via
python scripts/build-index.py. - 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:
- Consult
wiki/semantic-index.jsonorscripts/build-semantic-index.py --query "..."to locate exact candidate files in milliseconds without scanning the whole repository. - Traverse typed edges in
wiki/graph.jsonto follow related entities. - Synthesize an answer with explicit file and source citations.
- 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
raw/is immutable: Never edit or delete files inraw/. It serves as the untampered source of truth for claim citations and delta reingestion.wiki/log.mdis append-only: Never modify or truncate historical log entries.- Index-first routing: LLMs must check
wiki/semantic-index.jsonorwiki/index.mdbefore loading or creating notes. - Zero-contradiction guarantee: Any conflict between new sources and existing wiki pages must be explicitly surfaced to the user before committing.
- Deterministic indexing: LLMs never edit
index.md,graph.json, orsemantic-index.jsonmanually; they are compiled deterministically by scripts.
π€ Contributing & Community
Contributions are warmly welcomed! Please check out CONTRIBUTING.md and our Code of Conduct.
- Found a bug or edge case? Open a Bug Report.
- Have an idea for a source adapter or optimization? Submit a Feature Request.
- Join the conversation in GitHub Discussions.
π 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.