All skills
github avatar

/mini-context-graph

@4214189 official
by githubgithub/awesome-copilot40k stars
5,040

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.

Use this Skill: https://skilld.dev/gh/github/awesome-copilot/mini-context-graph

This session only. Nothing lands on disk.

referencesontology.md

≈810 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Ontology Instructions

This file defines the rules for maintaining and evolving the dynamic ontology used by the Context Graph.


Core Principle

The ontology is NOT fixed. Types and relations emerge from documents as they are ingested. However, the ontology must remain compact, consistent, and reusable.


Entity Type Rules

Normalization

When assigning an entity type, apply these transformations:

  1. Convert to lowercase
  2. Strip leading/trailing whitespace
  3. Replace underscores and hyphens with spaces
  4. Merge synonymous types using the mapping table below

Synonym Mapping (Entity Types)

Variant Canonical Type
component, module, class, function component
bug, defect, fault, error, failure issue
server, host, machine, node infrastructure
user, person, operator, admin, actor actor
app, application, service, program, software software
database, datastore, db, storage storage
api, endpoint, interface, connection interface
event, incident, occurrence, trigger event
concept, idea, principle, theory concept
process, thread, task, job, workflow process

Adding New Types

If an entity does not match any existing type:

  • Create a new type if it is genuinely distinct
  • Keep the label short (1–3 words, lowercase)
  • Consider whether an existing type is close enough before creating a new one

Constraint

  • Maximum ~50 distinct entity types across the entire ontology
  • If the limit is approached, merge similar types rather than creating new ones

Relation Type Rules

Normalization

When assigning a relation type:

  1. Convert to lowercase
  2. Strip whitespace
  3. Use verb phrases in present tense (e.g., "causes", "contains", "uses")
  4. Merge synonyms using the mapping table below

Synonym Mapping (Relation Types)

Variant Canonical Relation
triggers, leads to, results in, produces causes
is part of, belongs to, lives in, sits in contains
depends on, requires, needs depends on
uses, calls, invokes, consumes uses
affects, impacts, influences affects
creates, instantiates, spawns creates
connects to, links to, references connects to
inherits from, extends, subclasses extends
reads from, queries, fetches reads from
writes to, stores in, persists to writes to

Adding New Relations

  • Only add new relation types if no existing type accurately describes the relationship
  • Prefer canonical relations over creating new ones

Ontology Update Protocol

When processing extracted entities/relations from ingestion.md:

  1. For each entity type:

    • Run through the synonym mapping
    • Call ontology_store.normalize_type(type_name) to get the canonical form
    • Call ontology_store.add_type(canonical_type) to register it
  2. For each relation type:

    • Run through the synonym mapping
    • Call ontology_store.normalize_relation(relation_name) to get the canonical form
    • Call ontology_store.add_relation(canonical_relation) to register it
  3. Use the canonical type/relation names when creating nodes and edges in the graph.

Source: SKILL.md on GitHub

No alerts15d3 checks · Risk SAFE
  • Gen Agent Trust Hub15d

    The skill is safe to use but contains a potential vulnerability to indirect prompt injection due to its design of processing untrusted document content without strict boundary markers.

  • Socket15d

    No alerts

  • Snyk15d

    Risk: LOW · No issues

Signed by skilld at 4214189. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
  • Python
  • knowledge-graph
  • rag
  • wiki
  • persistence
  • entity-extraction
  • provenance
  • llm

README badge

README badge for github/awesome-copilot/mini-context-graph

Builds a persistent knowledge base that combines markdown wiki pages with a structured entity-relation graph, extracting entities and relations from ingested documents once and storing them with full provenance. On query, it searches the wiki first for fast answers, then traverses the graph with confidence thresholds and depth limits to retrieve evidence-backed subgraphs without re-deriving knowledge from scratch.

Generated from the current SKILL.md.

Does this skill re-ingest documents on every query?
No. Documents are ingested once — entities, relations, and wiki pages are extracted and stored persistently. Queries traverse the stored graph and wiki without re-deriving knowledge from source text.
What happens if I ingest a document that contradicts existing graph data?
The skill stores both versions with provenance links. The SKILL.md requires flagging contradictions in wiki pages when new data conflicts with old claims, so the LLM can reconcile them during synthesis.
Can I query without writing to the wiki?
Yes. `skill.query_with_evidence()` and `skill.query()` retrieve from the graph without modifying it. However, the workflow pattern expects the LLM to write wiki pages after ingesting or answering valuable queries.
What's the maximum graph depth for a query?
Traversal depth is capped at 2 hops (configurable MAX_GRAPH_DEPTH). Only edges with confidence >= 0.6 are traversed, and results are limited to 50 nodes maximum.
Do I need to provide supporting text for every entity and relation?
Yes. Every entity and relation must include `supporting_text` from the source document. This enables provenance tracking and prevents hallucinated graph nodes.

Generated from the current SKILL.md. These answers refresh after source changes.