llm-wiki-starter
AGENTS.md1 starsChanged 8 months agoMITView on GitHub
A persistent, compounding knowledge base maintained by LLMs. Based on the LLM Wiki pattern by Andrej Karpathy (2026). This is an LLM Wiki — a structured, interlinked collection of markdown files that serves as persistent memory across sessions. Instead of starting from scratch each conversation, the LLM reads this wiki to recall context, entities, concepts, and prior work. The wiki sits between raw source documents and the LLM. It is a compounding artifact: cross-references are already built, contradictions flagged, knowledge…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,736 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- llm-wiki-analyze-familiesSkill
- llm-wiki-ingest-allSkill
- llm-wiki-ingest-thisSkill
- llm-wiki-lintSkill
- llm-wiki-readSkill
- llm-wiki-refreshSkill
- llm-wikiSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
33 rules. About 0 are common, 17 are distinctive, and 16 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈17
Distinctive · estimate
This author's own choices. Worth a look.
16
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 68
Every wiki page uses this frontmatter structure:
- Very specific: line 92
Use [[page-name]] to link between wiki pages.
- Distinctive: line 104
When the user provides a new source document or asks to ingest content:
- Distinctive: line 119
When the user asks a question:
- Distinctive: line 126
Read summaries only if needed: after the durable pages
- Very specific: line 186
Read the generated summaries in wiki/summaries/chat-*.md
- Distinctive: line 189
Create/update entity and concept pages as needed
- Very specific: line 190
Update index.md with new pages
- Distinctive: line 191
Add cross-references between related pages
- Very specific: line 195
Use python3 tools/analyze-product-families.py when chat names, folder names, or versioned workspaces may be hiding one broader product …
- Very specific: line 206
Use ./refresh-memory when you want a one-command refresh cycle:
- Distinctive: line 234
When asked "what do we know about X" or "review the wiki":
- Very specific: line 236
Read index.md for overview
- Very specific: line 237
Read log.md for recent activity
- Very specific: line 238
Read the most relevant entities/, concepts/, and queries/ pages before opening summaries
- Distinctive: line 243
When a new chat starts in this repository:
- Distinctive: line 245
Read this file (AGENTS.md)
- Distinctive: line 249
If the project name is noisy or ambiguous, use normalization/query pages to map it to a canonical entity first
- Distinctive: line 250
Treat workspace names, branch-like folder names, and version folders as heuristic signals only, not proof that the work belongs to a …
- Very specific: line 251
Only after that, open wiki/summaries/ or sources/ as needed
- Very specific: line 261
Entities: use the most common name: openai.md, andrej-karpathy.md
- Very specific: line 262
Concepts: use descriptive names: attention-mechanism.md, rag-vs-wiki.md
- Very specific: line 263
Queries: use question format: how-does-attention-work.md
- Very specific: line 288
Sources are immutable: Never edit files in sources/.
- Distinctive: line 289
Wiki pages are living documents: Update them freely as new information arrives.
- Distinctive: line 291
Cite sources: Every claim in the wiki should trace back to a source.
- Distinctive: line 292
Flag uncertainty: If something is unclear or contradictory, say so explicitly.
- Distinctive: line 300
When starting a new conversation with this wiki:
- Distinctive: line 302
Read this file (AGENTS.md) to understand the system
- Very specific: line 303
Read index.md to know what's in the wiki
- Very specific: line 305
Check if there are un-ingested chats: run python3 tools/ingest-chats.py list to see recent sessions
- Distinctive: line 306
If relevant new chats exist, offer to ingest them
- Very specific: line 310
Auto-context loading: When the user asks a question, always check index.md first.
≈ “Common” is an estimate: at least 1 in 5 of the 16,597 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
LLM Wiki — Schema & Operating Instructions
A persistent, compounding knowledge base maintained by LLMs. Based on the LLM Wiki pattern by Andrej Karpathy (2026).
What This Is
This is an LLM Wiki — a structured, interlinked collection of markdown files that serves as persistent memory across sessions. Instead of starting from scratch each conversation, the LLM reads this wiki to recall context, entities, concepts, and prior work.
The wiki sits between raw source documents and the LLM. It is a compounding artifact: cross-references are already built, contradictions flagged, knowledge organized.
Three-Layer Architecture
Layer 1: sources/ — Raw, immutable source documents (articles, papers, data, images)
Layer 2: wiki/ — LLM-generated markdown (summaries, entity pages, concept pages, queries)
Layer 3: AGENTS.md — This file. Schema, conventions, workflows.Directory Structure
llm wiki/
├── AGENTS.md # This file — schema & operating instructions
├── INSTRUCTIONS.md # Universal version for any LLM/IDE
├── index.md # Content catalog organized by category
├── log.md # Append-only chronological record
├── README.md # Setup guide for humans
│
├── sources/ # Layer 1: Raw immutable source documents
│ ├── *.md # Articles, papers converted to markdown
│ ├── *.pdf # Original PDFs
│ ├── *.png / *.jpg # Images, diagrams
│ └── *.csv / *.json # Data files
│
├── wiki/ # Layer 2: LLM-generated content
│ ├── entities/ # Pages about people, orgs, tools, projects
│ │ └── *.md
│ ├── concepts/ # Pages about ideas, patterns, techniques
│ │ └── *.md
│ ├── summaries/ # Source document summaries
│ │ └── *.md
│ └── queries/ # Answered questions filed as wiki pages
│ └── *.md
│
├── tools/ # Automation scripts
│ ├── ingest-chats.py # Chat history ingestion (Python)
│ ├── refresh-memory.py # Incremental memory refresh + index rebuild
│ └── wiki-ingest-chats.sh # Shell wrapper for chat ingestion
│
├── .cursorrules # Schema for Cursor IDE
├── .clinerules # Schema for Cline
├── .github/
│ └── copilot-instructions.md # Schema for GitHub Copilot
└── .windsurfrules # Schema for Windsurf IDEPage Format
Every wiki page uses this frontmatter structure:
---
title: "Page Title"
type: entity | concept | summary | query
created: YYYY-MM-DD
updated: YYYY-MM-DD
sources: ["source-file.md"] # Which sources informed this page
tags: [tag1, tag2]
status: active | stale | draft
---
# Page Title
Page content in markdown. Use [[wiki-links]] to cross-reference other pages.
## See Also
- [[Related Page 1]]
- [[Related Page 2]]Wiki-Link Convention
Use [[page-name]] to link between wiki pages. The page-name is the filename without .md extension and without the directory prefix. When referencing, include the path hint:
[[entities/andrej-karpathy]]— link to an entity page[[concepts/rag-vs-wiki]]— link to a concept page[[summaries/source-article-name]]— link to a summary
Core Operations
1. INGEST — Process a New Source
When the user provides a new source document or asks to ingest content:
- Save the raw source to
sources/(if not already there) - Read the source thoroughly
- Create a summary in
wiki/summaries/with key takeaways, claims, and data - Create or update entity pages in
wiki/entities/for people, orgs, tools mentioned - Create or update concept pages in
wiki/concepts/for ideas, patterns, techniques - Update cross-references — add
[[wiki-links]]between related pages - Update
index.md— add new pages to the catalog under appropriate categories - Append to
log.md— record the ingest with timestamp
A single source may touch 10-15 wiki pages. This is normal and expected.
2. QUERY — Answer a Question
When the user asks a question:
- Read
index.mdto find relevant wiki pages - Route by page type first:
wiki/entities/for projects, products, companies, tools, and peoplewiki/concepts/for recurring patterns, architecture, workflows, and failure modeswiki/queries/for prior syntheses, normalization rules, and durable question pages
- Read summaries only if needed after the durable pages
- Read raw sources only if needed for exact detail, ambiguity resolution, or citation depth
- Synthesize an answer with citations to wiki pages and original sources
- Optionally file the answer as a new page in
wiki/queries/if it has lasting value - Append to
log.md— record the query
When the project identity is unclear, treat chat names, folder names, version suffixes, and higher-level workspace directories as hints rather than hard boundaries. Infer the canonical product from the content itself: repeated feature vocabulary, shared bugs, deployment targets, app surfaces, brand language, and explicit references to older versions or sibling workspaces.
3. LINT — Health Check
Periodically (or when asked), audit the wiki for:
- Contradictions between pages — flag and resolve
- Stale claims — mark pages that may be outdated
- Orphan pages — pages with no incoming links
- Missing cross-references — pages that should link to each other but don't
- Data gaps — topics mentioned but not yet covered
- Index drift — pages that exist but aren't in
index.md
Record lint results in log.md.
4. INGEST-CHATS — Process IDE Chat History
Ingest conversations from IDE chat histories into the wiki. This extracts knowledge from past sessions so it persists across conversations.
Trigger phrases: "Ingest chats", "Absorb chats", "Process chat history", "Засосать чаты"
Using the built-in tool:
# List all available chats across all IDEs
python3 tools/ingest-chats.py list
# Refresh memory incrementally (discover -> ingest new/updated -> rebuild index)
./refresh-memory
# Ingest ALL chats from all IDEs
python3 tools/ingest-chats.py ingest --all
# Ingest only current project's chats
python3 tools/ingest-chats.py ingest --current
# Ingest specific project
python3 tools/ingest-chats.py ingest --project "project-name"
# Ingest one specific chat file
python3 tools/ingest-chats.py ingest --chat /path/to/file.jsonl
# Filter by IDE
python3 tools/ingest-chats.py ingest --all --ide codexWhat it does:
- Finds conversation files from IDE storage (Codex, Cursor, Windsurf, Continue, Cline)
- Extracts all user and assistant messages
- Saves raw transcript to
sources/chats/(immutable) - Creates a summary page in
wiki/summaries/with key topics and initial request - Updates
log.mdwith the ingestion record
After running the tool, the LLM should:
- Read the generated summaries in
wiki/summaries/chat-*.md - Extract key decisions, patterns, entities, and concepts
- Normalize product identity across renamed folders, versioned workspaces, and higher-level directory changes before deciding that two chats belong to different products
- Create/update entity and concept pages as needed
- Update
index.mdwith new pages - Add cross-references between related pages
4b. ANALYZE-PRODUCT-FAMILIES — Find Cross-Folder Product Families
Use python3 tools/analyze-product-families.py when chat names, folder names, or versioned workspaces may be hiding one broader product family.
What it does:
- Reads the shared alias registry in
tools/product-aliases.json - Scores likely cross-folder and cross-version family overlaps from summary content
- Writes a candidate report into
wiki/queries/ - Rebuilds
index.md - Appends the run to
log.md
4a. REFRESH-MEMORY — Incremental Memory Refresh
Use ./refresh-memory when you want a one-command refresh cycle:
- Discover available chat sessions
- Ingest only new or updated conversations
- Rebuild
index.md - Append a refresh record to
log.md
Examples:
./refresh-memory
./refresh-memory --ide codex
./refresh-memory --current
./refresh-memory --project "my-project"Supported IDE chat storage locations:
| IDE | Storage Path | Format |
| Codex | ~/.Codex/sessions/**/*.jsonl | JSONL |
| Cursor | ~/Library/Application Support/Cursor/User/workspaceStorage/ | SQLite |
| Windsurf | ~/Library/Application Support/Windsurf/User/workspaceStorage/ | SQLite |
| Continue | ~/.continue/sessions/ | JSON |
| Cline | VS Code globalStorage saoudrizwan.Codex-dev/ | JSON |
5. REVIEW — Summarize Wiki State
When asked "what do we know about X" or "review the wiki":
- Read
index.mdfor overview - Read
log.mdfor recent activity - Read the most relevant
entities/,concepts/, andqueries/pages before opening summaries - Provide a structured summary of wiki contents, recent changes, and gaps
6. SESSION START — Relevance Routing For New Chats
When a new chat starts in this repository:
- Read this file (
AGENTS.md) - Read
index.md - Read
log.md - Build a short candidate set of relevant pages in
wiki/entities/,wiki/concepts/, andwiki/queries/ - If the project name is noisy or ambiguous, use normalization/query pages to map it to a canonical entity first
- Treat workspace names, branch-like folder names, and version folders as heuristic signals only, not proof that the work belongs to a different product
- Only after that, open
wiki/summaries/orsources/as needed
This routing is mandatory for non-trivial questions. Do not answer from scratch if the wiki already contains relevant durable memory.
Naming Conventions
- Filenames: lowercase, hyphens for spaces:
andrej-karpathy.md,transformer-architecture.md - Summaries: match the source name:
sources/attention-paper.pdf→wiki/summaries/attention-paper.md - Entities: use the most common name:
openai.md,andrej-karpathy.md - Concepts: use descriptive names:
attention-mechanism.md,rag-vs-wiki.md - Queries: use question format:
how-does-attention-work.md
Log Format
log.md uses this format for parseability:
## [YYYY-MM-DD] INGEST | Source: filename.md
Summary of what was ingested and which wiki pages were created/updated.
Pages touched: [[page1]], [[page2]], [[page3]]
## [YYYY-MM-DD] QUERY | Question text
Brief answer summary. See [[queries/question-page]] for full answer.
## [YYYY-MM-DD] LINT | Health check
Findings: N contradictions, N stale pages, N orphans, N gaps.
Actions taken: ...Important Principles
- Sources are immutable. Never edit files in
sources/. They are the ground truth. - Wiki pages are living documents. Update them freely as new information arrives.
- Cross-reference aggressively. The value compounds through connections.
- Cite sources. Every claim in the wiki should trace back to a source.
- Flag uncertainty. If something is unclear or contradictory, say so explicitly.
- Compounding value. Good answers become new wiki pages. The wiki grows smarter over time.
- Human curates, LLM maintains. The human decides what to ingest and what questions matter. The LLM handles the bookkeeping.
On Every New Session
When starting a new conversation with this wiki:
- Read this file (
AGENTS.md) to understand the system - Read
index.mdto know what's in the wiki - Scan
log.mdfor recent activity - Check if there are un-ingested chats: run
python3 tools/ingest-chats.py listto see recent sessions - If relevant new chats exist, offer to ingest them
- Build a small relevance shortlist from
wiki/entities/,wiki/concepts/, andwiki/queries/ - You are now ready to ingest, query, or lint
Auto-context loading: When the user asks a question, always check index.md first. If the wiki has relevant pages, read durable memory pages before summaries, and summaries before raw sources. The wiki is your long-term memory — use it.
Tooling Integration
This wiki is designed to work with:
- Obsidian — for human browsing, graph view, and web clipper for ingesting articles
- Git — for version history (init a repo in this directory)
- Any LLM IDE — Codex, Cursor, Copilot, Windsurf, Cline, Aider, etc.
- qmd — optional hybrid BM25/vector search CLI for large wikis
- Marp — for generating slide decks from wiki content
- Dataview (Obsidian plugin) — for querying page frontmatter
Quick Reference
| Command | What to do |
| "Ingest this" | Run INGEST operation on provided source |
| "What do we know about X?" | Run QUERY operation |
| "Lint the wiki" | Run LINT operation |
| "Review the wiki" | Run REVIEW operation |
| "Add to sources" | Save file to sources/, don't process yet |
| "Update index" | Rebuild index.md from current wiki pages |
| "Refresh memory" | Run ./refresh-memory to ingest new/updated chats and rebuild the index |
| "Analyze product families" | Run python3 tools/analyze-product-families.py to review cross-folder and cross-version merge candidates |
| "Ingest chats" / "Засосать чаты" | Run INGEST-CHATS: process IDE conversation history |
| "Ingest all chats" | Run INGEST-CHATS with --all flag |
| "Ingest this chat" | Run INGEST-CHATS with --current flag |
| "List chats" | Run python3 tools/ingest-chats.py list |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

