agentleFS
ufukyuksel-devufukyuksel-dev/SUPER_COMPUTER_AI/skills/ai-engineering/rag-engineering/SKILL.md

rag-engineering

Skill0 starsChanged 47 days agoMITView on GitHub

Use when building or debugging retrieval-augmented generation — chunking, embedding choice, vector store, hybrid search, reranking, RAG-specific evaluation and failure modes. Do NOT use for general context budgeting/prompt structure (planned skill context-engineering; when unavailable, state the boundary).

6 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use security-review.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • SentrySkill

    security-review

    Finds exploitable application security vulnerabilities in code changes. Use for Warden security scans, appsec review, OWASP-style checks, authentication or authorization bugs, injection, XSS, SSRF, path traversal, secrets, unsafe crypto, webhook verification, open redirects, or sensitive data exposure.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

6 rules. 0 are common, 5 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep base-model selection separate.

    line 14
  2. Distinctive:

    Read the RAG failure-mode catalog before diagnosing or approving the design.

    line 33
  3. Very specific:

    If vector-store access is unavailable, state the boundary.

    line 43
  4. Distinctive:

    If authorization metadata is unavailable, stop the confidential retrieval path.

    line 44
  5. Distinctive:

    If corpus content cannot leave its boundary, select local tools or work on redacted/synthetic structure.

    line 45
  6. Distinctive:

    If no labeled evaluation queries exist, create a bounded annotation task and run only smoke diagnostics.

    line 46

“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “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

RAG Engineering

Boundaries

  • Own corpus ingestion, chunking, embedding choice, index/store design, lexical/dense/hybrid retrieval, metadata filters, reranking, provenance, and RAG-specific evaluation and diagnosis.
  • Enforce authorization and tenant/document visibility before retrieval and again before content fetch. Never use prompt instructions or post-generation filtering as access control.
  • For general prompt layout, conversation memory, context budgeting, and compaction, see skill context-engineering.
  • For current embedding, vector-store, reranker, license, API, and data-egress facts, see skill ai-research. Never select a changing external capability from memory.
  • Keep base-model selection separate; RAG need does not determine the concrete generation model.

Decision Workflow

  1. Define the question types, corpus, source authority, languages/modalities, confidentiality, tenant/role model, freshness/versioning, citation requirement, latency/cost envelope, and allowed data egress.
  2. Build ingestion with source identity, parser/version, content hash, permissions, timestamps, document version, lineage, deletion propagation, deduplication, and failure quarantine.
  3. Define chunking hypotheses from document structure and question granularity. Preserve headings, page/section anchors, parent-child relationships, tables/code where relevant, and stable provenance.
  4. Select embeddings from workload evidence: language/modality, domain, length, retrieval metric, privacy/egress, license, runtime, and cost. For current metadata, see skill ai-research.
  5. Select the store/index by required filters, authorization isolation, update/delete consistency, hybrid support, scale, backup, audit, and egress constraints. Do not treat a vector-store brand as an architecture answer.
  6. Apply query normalization or transformation only with measurable benefit. Retrieve through authorization-scoped dense, lexical, or hybrid paths; apply metadata/version filters before candidates can cross the trust boundary.
  7. Rerank only authorized candidates. Define top-k, score/abstention thresholds, diversity, freshness, and no-answer behavior from evaluation rather than intuition.
  8. Assemble generation context with stable source IDs and versioned citations. Require the answer to distinguish supported statements, uncertainty, and no-evidence cases.
  9. Evaluate separate stages and slices:
    • ingestion coverage, freshness, deletion, version, and ACL correctness;
    • retrieval recall@k, precision@k, MRR/nDCG where appropriate, answer-bearing chunk rate, and filter leakage;
    • reranking lift versus latency/cost;
    • grounded answer quality, citation correctness/completeness, hallucination/abstention, and unauthorized disclosure.
  10. Diagnose by classifying the failure as ingestion, chunking, embedding/query, filter, retrieval, reranking, context assembly, or generation. Change one hypothesis at a time and retain slice-level evidence.

Read the RAG failure-mode catalog before diagnosing or approving the design.

Required Output

Return the data/egress and authorization boundary, ingestion and versioning contract, chunk/embedding/store decision records, retrieval/reranking pipeline, provenance/citation contract, RAG evaluation dataset and gates, diagnostic evidence, rejected alternatives, and all UNVERIFIED production-path claims.

Tool Requirements & Degradation

  • Require corpus/parser inspection, permission metadata, index/store access, retrieval traces, query/result logging with redaction, a controlled evaluation corpus, and an end-to-end runner.
  • For current service/model/store facts and licenses, see skill ai-research. Keep confidential text out of external tools unless egress is explicitly allowed.
  • If vector-store access is unavailable, state the boundary; use existing retrieval logs or a small local controlled corpus to test deterministic hypotheses. Label index statistics, production filtering, scale, and retrieval behavior UNVERIFIED.
  • If authorization metadata is unavailable, stop the confidential retrieval path. Do not substitute prompt instructions or test with cross-tenant data.
  • If corpus content cannot leave its boundary, select local tools or work on redacted/synthetic structure; do not weaken the egress requirement without human approval.
  • If no labeled evaluation queries exist, create a bounded annotation task and run only smoke diagnostics; do not claim RAG quality.

Failure Modes

  • Filtering authorization after retrieval or generation, or omitting tenant/role scope from cache and index operations.
  • Treating duplicate or stale document versions as harmless and citing an obsolete copy.
  • Choosing chunk size, top-k, embedding, or reranker by convention without workload evidence.
  • Optimizing semantic similarity while retrieved chunks remain answer-irrelevant.
  • Debugging every failure by rewriting the prompt or changing the base model first.
  • Evaluating only final answer fluency while ignoring retrieval, citation, abstention, freshness, and leakage.
  • Inventing production index statistics or claiming the store path was tested while access was unavailable.
  • Sending confidential chunks to an external embedding, reranking, generation, or logging service outside the allowed egress boundary.

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.