SKILLEX

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:

  1. 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.
  2. Graph layer — Entities and relations are extracted once and stored as a navigable knowledge graph. BFS traversal answers structural queries without re-reading sources.
  3. 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

LayerWhereWhat the LLM doesWhat Python does
Raw Sourcesdata/documents.jsonReads (never modifies)Stores chunks + metadata
Wikiwiki/ (markdown)Writes/updates pagesManages index.md + log.md
Graphdata/graph.jsonExtracts entities + relationsPersists, deduplicates, traverses

---

⚡ Quick Start for Agents

skill.md