Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Standard RAG re-discovers knowledge from scratch on every query. This skill is different:
.claude/skills/mini-context-graph/SKILL.md| Model | Eval pass | Runs |
|---|---|---|
| gemini-3.6-flash | 100% | 13 |
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 6% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 18% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 33% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 60% | 0% |
Standard RAG re-discovers knowledge from scratch on every query. This skill is different:
> The LLM writes; the Python tools handle all bookkeeping.
| 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 |
A complete runnable version of this workflow is in scripts/template_agent_workflow.py — copy and adapt it.
pythonfrom scripts.contextgraph import ContextGraphSkill from scripts.tools import wiki_store skill = ContextGraphSkill() # ===== INGEST WITH FULL RAG + WIKI ===== # 1. Read references/ingestion.md and references/ontology.md first # 2. Extract entities and relations (LLM reasoning step) entities = [ {"name": "memory leak", "type": "issue", "supporting_text": "memory leaks cause crashes"}, {"name": "system crash", "type": "issue", "supporting_text": "system crashes due to memory leaks"}, ] relations = [ {"source": "memory leak", "target": "system crash", "type": "causes", "confidence": 1.0, "supporting_text": "System crashes due to memory leaks."}, ] result = skill.ingest_with_content( doc_id="doc_001", title="System Crash Analysis", source="/docs/incident_report.pdf", raw_content="System crashes due to memory leaks. Memory leaks occur when objects are not released.", entities=entities, relations=relations, ) # result = {"doc_id": "doc_001", "chunk_count": 1, "nodes_added": 2, "edges_added": 1} # 3. Write a wiki summary page for this document wiki_store.write_page( category="summary", title="System Crash Analysis Summary", content="""--- title: System Crash Analysis source_document: doc_001 tags: [summary, incident] --- # System Crash Analysis **Source:** incident_report.pdf ## Key Claims - [[memory-leak]] causes [[system-crash]] (confidence: 1.0) ## Entities - [[memory-leak]] (issue) - [[system-crash]] (issue) """, summary="Incident report: memory leaks cause system crashes.", ) # ===== QUERY WITH EVIDENCE ===== result = skill.query_with_evidence("Why does the system crash?") # Returns: {"query": ..., "subgraph": ..., "supporting_documents": [...], "evidence_chain": ...} # ===== WIKI SEARCH (read wiki before answering) ===== pages = wiki_store.search_wiki("memory leak") # Returns: [{slug, category, path, snippet}, ...]
When a user provides a new document:
references/ingestion.md — entity/relation extraction rules.references/ontology.md — type normalization rules.skill.ingest_with_content(...) — stores raw content + chunks + graph nodes + provenance.wiki_store.write_page(category="summary", ...).wiki_store.write_page(category="entity", ...).When a user asks a question:
wiki_store.search_wiki(query) to find relevant pages. Read them.skill.query_with_evidence(query).supporting_documents.Periodically health-check the wiki:
pythonfrom scripts.tools import wiki_store issues = wiki_store.lint_wiki() # Returns: {orphan_pages, missing_pages, broken_wikilinks, isolated_pages}
Ask the LLM to review and fix: broken links, orphan pages, stale claims, missing cross-references. See references/lint.md for full lint workflow.
supporting_text for every entity and relation — this enables provenance| Method | Purpose | When to Use | |--------|---------|-------------| | skill.ingest_with_content(doc_id, title, source, raw_content, entities, relations) | Full RAG ingest: raw docs + graph + provenance | Every new document | | skill.add_node(name, node_type) | Add single entity (no provenance) | Quick additions without a source doc | | skill.add_edge(source_name, target_name, relation, confidence) | Add single relation | Quick additions without a source doc | | skill.query(query) | Graph-only retrieval → subgraph | Structural queries | | skill.query_with_evidence(query) | Graph + provenance → subgraph + source chunks | Queries requiring citations | | wiki_store.write_page(category, title, content, summary) | Write/update a wiki page | After every ingest; after answering queries | | wiki_store.read_page(category, title) | Read a wiki page | Before answering; for cross-referencing | | wiki_store.search_wiki(query) | Keyword search across wiki | Fast path before graph traversal | | wiki_store.list_pages(category) | List all wiki pages | Getting an overview | | wiki_store.get_log(last_n) | Read recent operations | Understanding wiki history | | wiki_store.lint_wiki() | Health check | Periodic maintenance | | documents_store.list_documents() | List all ingested raw sources | Audit / provenance checking | | documents_store.search_chunks(query) | Chunk-level search | Finding specific evidence |
> "The wiki is a persistent, compounding artifact. The cross-references are already there. The synthesis already reflects everything you've read." — Karpathy
| Layer | What Happens | Who Owns It | |-------|-----------|-------------| | LLM Reasoning | Extraction, synthesis, writing wiki pages | Agent (.md guidance files) | | Wiki Persistence | Index, log, file I/O | wiki_store.py | | Graph Persistence | Dedup, index, BFS traverse | graph_store.py, retrieval_engine.py | | Raw Source Storage | Immutable docs + chunks + provenance | documents_store.py |
The human curates sources and asks questions. The LLM writes the wiki, extracts the graph, and answers with citations. Python handles all bookkeeping.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 28,200 | 22,129 | -22% | 1 | 1 | 0% | 5,472 | 7,137 | +30% | 0 | 0 | — |
case-02 | fail→fail | 9,740 | 11,279 | +16% | 1 | 1 | 0% | 1,401 | 2,384 | +70% | 0 | 0 | — |
case-03 | fail→fail | 27,467 | 18,210 | -34% | 1 | 1 | 0% | 4,926 | 2,953 | -40% | 0 | 0 | — |
case-04 | fail→pass | 14,145 | 4,787 | -66% | 1 | 1 | 0% | 2,621 | 2,770 | +6% | 0 | 0 | — |
case-05 | fail→pass | 21,571 | 4,146 | -81% | 1 | 1 | 0% | 2,205 | 2,611 | +18% | 0 | 0 | — |
case-06 | fail→pass | 11,946 | 2,739 | -77% | 1 | 1 | 0% | 1,828 | 2,440 | +33% | 0 | 0 | — |
case-07 | fail→pass | 9,836 | 2,653 | -73% | 1 | 1 | 0% | 1,497 | 2,390 | +60% | 0 | 0 | — |
case-08 | pass→pass | 11,043 | 3,148 | -71% | 1 | 1 | 0% | 1,814 | 2,523 | +39% | 0 | 0 | — |
case-09 | fail→pass | 6,890 | 1,949 | -72% | 1 | 1 | 0% | 916 | 2,265 | +147% | 0 | 0 | — |
case-10 | fail→pass | 9,018 | 1,988 | -78% | 1 | 1 | 0% | 1,316 | 2,253 | +71% | 0 | 0 | — |
case-11 | fail→pass | 20,589 | 3,617 | -82% | 1 | 1 | 0% | 3,060 | 2,596 | -15% | 0 | 0 | — |
case-12 | pass→pass | 7,787 | 2,556 | -67% | 1 | 1 | 0% | 1,520 | 2,472 | +63% | 0 | 0 | — |
case-13 | fail→pass | 7,189 | 2,252 | -69% | 1 | 1 | 0% | 1,193 | 2,313 | +94% | 0 | 0 | — |
case-14 | pass→pass | 10,328 | 3,563 | -66% | 1 | 1 | 0% | 1,692 | 2,612 | +54% | 0 | 0 | — |
case-15 | fail→pass | 11,616 | 2,744 | -76% | 1 | 1 | 0% | 1,826 | 2,389 | +31% | 0 | 0 | — |
case-16 | fail→pass | 9,040 | 2,814 | -69% | 1 | 1 | 0% | 1,324 | 2,383 | +80% | 0 | 0 | — |
case-17 | fail→pass | 9,840 | 5,844 | -41% | 1 | 1 | 0% | 1,411 | 3,008 | +113% | 0 | 0 | — |
case-18 | fail→pass | 8,869 | 4,171 | -53% | 1 | 1 | 0% | 1,330 | 2,599 | +95% | 0 | 0 | — |
case-19 | fail→pass | 20,227 | 2,651 | -87% | 1 | 1 | 0% | 3,448 | 2,391 | -31% | 0 | 0 | — |
case-20 | fail→pass | 8,469 | 2,417 | -71% | 1 | 1 | 0% | 1,422 | 2,341 | +65% | 0 | 0 | — |
case-21 | pass→pass | 14,236 | 9,536 | -33% | 1 | 1 | 0% | 2,171 | 3,843 | +77% | 0 | 0 | — |
case-22 | pass→pass | 10,778 | 5,783 | -46% | 1 | 1 | 0% | 2,042 | 3,029 | +48% | 0 | 0 | — |
case-23 | pass→pass | 13,375 | 8,246 | -38% | 1 | 1 | 0% | 2,421 | 3,401 | +40% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted, and 21 counted toward the lift figure. The other 2 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +65 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +77% |
Other measured skills in the registry, with their headline benchmark lift.