agentleFS
mmccallammccalla/coding-agent-skill-library/skills/krag-system-design/SKILL.md

krag-system-design

Skill4 starsChanged 5 months agoApache-2.0View on GitHub

Design compact, production-sensible Knowledge Graph-Augmented Retrieval systems. Use when defining KRAG or GraphRAG architecture, graph role, retrieval strategy, provenance model, backlog, or technical design tasks.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 9 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use when designing the end-to-end architecture, graph role, provenance model, retrieval role or implementation slices for a KRAG or …

    line 13
  2. Distinctive:

    Evidence model: every answerable claim must trace to source spans, tables, records, or authoritative systems.

    line 36
  3. Distinctive:

    Use this minimal component model unless the repository already has one:

    line 40
  4. Distinctive:

    Evaluator: test retrieval, grounding, graph quality, answer quality, latency, cost, safety, and drift.

    line 48
  5. Distinctive:

    Do not create triples without source evidence.

    line 52
  6. Distinctive:

    Do not store only chunks when document structure, claims, tables, sections, or entities are needed.

    line 53
  7. Distinctive:

    Do not let LLM-generated graph writes bypass schema validation.

    line 54
  8. Distinctive:

    Do not conflate ontology classes, instance entities, concepts, claims, and evidence spans.

    line 55
  9. Distinctive:

    Do not answer from graph neighbourhood alone.

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

KRAG System Design

When to use

Use when designing the end-to-end architecture, graph role, provenance model, retrieval role or implementation slices for a KRAG or GraphRAG system.

Objective

Design a Knowledge Graph-Augmented Retrieval system where the graph materially improves retrieval, reasoning, provenance, navigation, governance, or explainability.

Procedure

  1. Classify the primary question class and intended graph role.
  2. Choose storage, reasoning, and evidence models explicitly.
  3. Outline the reference architecture from ingestion through evaluation.
  4. State non-negotiable invariants for evidence, schema, and writes.
  5. Define retrieval strategy, ranking signals, and abstention rules.
  6. Produce architecture summary, schema outline, evaluation gates, and thin-slice backlog.

Core decisions

Make these explicit before designing:

  1. Question class: lookup, semantic search, relationship traversal, impact analysis, regulatory traceability, root-cause analysis, summarisation, or cross-document reasoning.
  2. Graph role: resource catalogue, semantic index, evidence graph, domain graph, control graph, lineage graph, or operational twin.
  3. Storage pattern: property graph, RDF/OWL, hybrid, graph-native vector index, or external vector store.
  4. Reasoning level: deterministic traversal/rules, LLM-assisted inference, probabilistic ranking, or external ontology reasoning.
  5. Evidence model: every answerable claim must trace to source spans, tables, records, or authoritative systems.

Reference architecture

Use this minimal component model unless the repository already has one:

  • Ingestion: parse source, preserve structure, create evidence anchors, extract candidate entities/relations/claims.
  • Normalisation: canonicalise identifiers, deduplicate entities, map to ontology/schema, score confidence.
  • Graph store: persist resources, evidence, entities, concepts, relationships, provenance, versions, and constraints.
  • Retrieval planner: classify question, select graph/vector/keyword/hybrid strategy, generate safe graph queries.
  • Ranker: combine semantic similarity, graph proximity, source authority, recency, and confidence.
  • Answerer: synthesise grounded response with citations, uncertainty, and abstention when support is weak.
  • Evaluator: test retrieval, grounding, graph quality, answer quality, latency, cost, safety, and drift.

Non-negotiable invariants

  • Do not create triples without source evidence.
  • Do not store only chunks when document structure, claims, tables, sections, or entities are needed.
  • Do not let LLM-generated graph writes bypass schema validation.
  • Do not conflate ontology classes, instance entities, concepts, claims, and evidence spans.
  • Do not answer from graph neighbourhood alone; require supporting evidence or explicit rule-derived facts.

Output format

Return:

  1. Architecture summary.
  2. Graph schema outline.
  3. Retrieval strategy.
  4. Evaluation gates.
  5. Key trade-offs and risks.
  6. Implementation backlog in thin vertical slices.

Related skills

  • knowledge-graph-rag — Neo4j-native KG-backed retrieval implementation guidance
  • ontology-and-knowledge-graph-modeling — ontology and semantic graph design
  • krag-ingestion-graph-construction — ingestion and evidence graph construction
  • krag-retrieval-answering — retrieval planning, ranking and answer synthesis
  • krag-evaluation-governance — KRAG-specific evaluation and governance

References

Verification

  • Architecture, graph role and retrieval strategy are explicit.
  • Evidence and provenance invariants are stated.
  • Evaluation gates and implementation slices are defined.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.