knowledge-retrieval-rag
Skill4 starsChanged 5 months agoApache-2.0View on GitHub
Use when implementing retrieval-augmented generation, RAG features, RAG pipelines, document-grounded coding agents, semantic search, citation-backed answers, repository/document knowledge lookup, evaluation gates, or release evaluation for RAG.
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
- krag-evaluation-governanceSkill
- krag-ingestion-graph-constructionSkill
- krag-retrieval-answeringSkill
- 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
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
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 16
Use this skill when an agent needs facts from external documents, code repositories, wikis, tickets, logs, APIs, or other knowledge stores …
- Distinctive: line 37
Prefer hybrid retrieval for coding agents:
- Distinctive: line 48
Add retrieval tests with known questions and expected source files.
- Distinctive: line 52
Do not answer from memory when repository evidence is required.
- Distinctive: line 53
Do not mix authorised and unauthorised content in one context.
- Distinctive: line 54
Do not cite chunks that do not support the claim.
- Distinctive: line 55
Do not use raw PDFs or binary files directly if the agent cannot parse them reliably.
≈ “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.
Files
Knowledge Retrieval (RAG)
When to use
Use this skill when an agent needs facts from external documents, code repositories, wikis, tickets, logs, APIs, or other knowledge stores before answering or modifying code.
For GraphRAG, Neo4j-native retrieval, text-to-Cypher, provenance-first graph ingestion, or KG-backed answer generation, pair this skill with skills/knowledge-graph-rag/SKILL.md.
Objective
Ground agent answers and changes in retrievable, permission-aware source evidence with inspectable citations.
Procedure
- Ingest documents or code into clean text.
- Split content into meaningful chunks that preserve context.
- Store metadata: source path, section, timestamp, owner, commit, permissions and content type.
- Index chunks using embeddings and, where useful, keyword search.
- Retrieve relevant chunks for the user query.
- Rerank or filter results for relevance, freshness and permissions.
- Generate an answer grounded only in retrieved evidence.
- Cite sources or file paths so claims are inspectable.
Retrieval strategy
Prefer hybrid retrieval for coding agents:
- keyword/BM25 for exact symbols, filenames, errors and API names;
- vector search for semantic questions and conceptual similarity;
- structural search for AST symbols, imports, tests and dependency graphs;
- reranking for final context selection.
Implementation guidance
Chunk code differently from prose. Keep functions, classes, configuration blocks and tests intact where possible. Preserve import context and neighbouring comments.
Add retrieval tests with known questions and expected source files. Measure recall before tuning generation prompts.
Guardrails
- Do not answer from memory when repository evidence is required.
- Do not mix authorised and unauthorised content in one context.
- Do not cite chunks that do not support the claim.
- Do not use raw PDFs or binary files directly if the agent cannot parse them reliably; convert to agent-readable text first.
Related skills
knowledge-graph-rag— graph-native retrieval when Neo4j appliescontext-engineering— assemble retrieval context efficientlyguardrails-safety-patterns— validate retrieved and generated content
References
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks (Lewis et al.)
- OWASP Top 10 for LLM Applications
Verification
- Sources are parsed into clean text.
- Chunking preserves useful context.
- Metadata and permissions are retained.
- Retrieval quality is tested.
- Generated output cites supporting sources.
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.

