krag-retrieval-answering
Skill4 starsChanged 5 months agoApache-2.0View on GitHub
Implement KRAG retrieval, graph traversal, query planning, hybrid search, answer synthesis, citations, and abstention. Use when building or debugging graph/vector/keyword retrieval and enterprise question answering.
In this repository114 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- accessibility-wcagSkill
- agentic-ux-patternsSkill
- ai-model-governanceSkill
- api-design-and-lifecycleSkill
- apply-laws-of-aiSkill
- bdd-practiceSkill
- browser-testing-with-devtoolsSkill
- business-capability-modelingSkill
- business-information-concept-modelingSkill
- capability-maturity-assessmentSkill
- cdc-and-source-to-stream-ingestionSkill
- ci-cd-and-automationSkill
- cloud-platform-architectureSkill
- code-review-and-qualitySkill
- cognitive-bias-reviewSkill
- conceptual-data-modelingSkill
- context-engineeringSkill
- data-contract-designSkill
- data-governance-and-qualitySkill
- data-integration-and-interoperabilitySkill
- data-lifecycle-and-retention-managementSkill
- data-lineage-and-provenanceSkill
- data-product-dashboard-designSkill
- data-product-designSkill
- data-security-and-privacy-architectureSkill
- ddd-practiceSkill
- deprecation-and-migrationSkill
- design-system-practiceSkill
- documentation-and-adrsSkill
- dora-four-keysSkill
- dry-principleSkill
- eip-integration-validationSkill
- evaluation-and-monitoringSkill
- event-driven-architectureSkill
- event-governance-and-lineageSkill
- event-modelingSkill
- event-streaming-platform-designSkill
- exception-handling-and-recoverySkill
- finops-practiceSkill
- frontend-state-and-interaction-designSkill
- git-workflow-and-versioningSkill
- goal-setting-and-monitoringSkill
- guardrails-safety-patternsSkill
- human-in-the-loopSkill
- idea-refinementSkill
- incident-response-and-postmortemsSkill
- incremental-implementationSkill
- infrastructure-as-codeSkill
- integration-message-constructionSkill
- inter-agent-communication-a2aSkill
- kiss-principleSkill
- knowledge-graph-ragSkill
- knowledge-retrieval-ragSkill
- krag-evaluation-governanceSkill
- krag-ingestion-graph-constructionSkill
- krag-system-designSkill
- lakehouse-and-medallion-architectureSkill
- learning-and-adaptationSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
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
- Distinctive: line 14
Use when building or debugging the query planner, graph traversal, hybrid ranking, answer synthesis, citation formatting or abstention …
- Distinctive: line 34
Relationship traversal: follow typed paths between entities, controls, obligations, systems, teams, outcomes, risks, or processes.
- Distinctive: line 40
Use the smallest sufficient strategy:
- Distinctive: line 45
Hybrid: when recall matters or when the user asks a broad enterprise question.
- Distinctive: line 46
Iterative retrieval: when first-pass evidence is incomplete, contradictory, or too generic.
- Distinctive: line 68
Never invent relationships to close a reasoning gap.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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.
Files
KRAG Retrieval and Answering
When to use
Use when building or debugging the query planner, graph traversal, hybrid ranking, answer synthesis, citation formatting or abstention logic of a KRAG system.
Objective
Answer questions using graph structure plus grounded evidence, not unverified model memory.
Procedure
- Classify the question (lookup, semantic discovery, traversal, impact analysis, synthesis).
- Select the smallest sufficient retrieval strategy (graph, vector, keyword, hybrid, iterative).
- Plan and execute bounded, read-only graph queries where applicable.
- Rank candidates using semantic, graph proximity, authority, recency, and confidence signals.
- Synthesise an answer with citations, uncertainty, and abstention when evidence is weak.
Retrieval planner
Classify the question before querying:
- Entity lookup: find canonical entity and known attributes.
- Semantic discovery: retrieve relevant evidence by embedding and keyword search.
- Relationship traversal: follow typed paths between entities, controls, obligations, systems, teams, outcomes, risks, or processes.
- Impact analysis: expand from a changed entity across dependency, ownership, control, obligation, data-flow, and outcome relationships.
- Global synthesis: summarise communities, themes, or cross-document patterns.
Strategy selection
Use the smallest sufficient strategy:
- Graph-first for known entities, dependency paths, ownership, lineage, obligations, controls, and impact questions.
- Vector-first for vague, natural-language, or exploratory questions.
- Keyword-first for exact IDs, policy clauses, regulation names, control IDs, and error codes.
- Hybrid when recall matters or when the user asks a broad enterprise question.
- Iterative retrieval when first-pass evidence is incomplete, contradictory, or too generic.
Ranking signals
Combine:
- semantic similarity
- exact match strength
- graph distance and path type
- source authority
- evidence confidence
- recency/version
- entity resolution confidence
- policy or ontology priority
Answer synthesis rules
- Separate facts, inferences, and recommendations.
- Cite source evidence for every material claim.
- Explain graph paths used for impact or traceability questions.
- State uncertainty where evidence is incomplete, weak, stale, or conflicting.
- Abstain or ask for missing source data when the graph cannot support the answer.
- Never invent relationships to close a reasoning gap.
Enterprise impact template
For questions such as “What customer outcomes, controls, teams and regulatory obligations are affected if we retire this platform?” retrieve:
- target platform and aliases
- upstream/downstream systems and data flows
- supported products, journeys, services, and customer outcomes
- owning, operating, support, risk, and compliance teams
- linked controls, risks, policies, regulations, and obligations
- current evidence, confidence, gaps, and unresolved dependencies
Output format
Return retrieval plan, queries/pseudocode, evidence set, answer, citations, uncertainty, and follow-up data gaps.
Related skills
knowledge-graph-rag— Neo4j-native graph retrieval implementationknowledge-retrieval-rag— generic document-grounded retrieval disciplinekrag-system-design— architecture and retrieval role designkrag-evaluation-governance— retrieval and answer quality gates
References
Verification
- Retrieval strategy selection is explicit and bounded.
- Answers separate facts, inferences and recommendations.
- Every material claim is grounded in cited evidence or abstained.
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
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.

