fizznix / mini-context-graph
mini-context-graph
A persistent, compounding knowledge base combining Karpathy's LLM Wiki pattern with a structured knowledge graph. Ingest documents once — the LLM writes wiki pages, extracts entities/relations into the graph, and stores raw content for evidence retrieval. Knowledge accumulates and cross-references; it is never re-derived from scratch.
The Core Idea
Standard RAG re-discovers knowledge from scratch on every query. This skill is different:
- Wiki layer — The LLM writes and maintains persistent markdown pages (summaries, entity pages, topic syntheses). Cross-references are already there. The wiki gets richer with every ingest.
- Graph layer — Entities and relations are extracted once and stored as a navigable knowledge graph. BFS traversal answers structural queries without re-reading sources.
- Raw source layer — Original documents are stored immutably with chunks. Provenance links tie every graph node and edge back to the exact text that supports it.
> The LLM writes; the Python tools handle all bookkeeping.
---
Three Layers
| Layer | Where | What the LLM does | What Python does |
|---|---|---|---|
| Raw Sources | data/documents.json | Reads (never modifies) | Stores chunks + metadata |
| Wiki | wiki/ (markdown) | Writes/updates pages | Manages index.md + log.md |
| Graph | data/graph.json | Extracts entities + relations | Persists, deduplicates, traverses |
---
⚡ Quick Start for Agents
skill.md