Skip to content
Skill

Rag and model tuning

Guides choosing between retrieval and fine-tuning, then building RAG pipelines or tuning

Rag and model tuning is an open-source agent skill for knowledge and memory. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
None
Platforms
Claude Code, Codex, Cursor
GitHub stars
13
Last commit
License
MIT
Listing updated

Similar skills

About Rag and model tuning

This skill helps an agent decide whether a missing piece of knowledge belongs in retrieval at inference time or in model weights through fine-tuning or distillation. It walks through the trade-offs on freshness, attribution, per-user access control and cost, and suggests stopping early on cheaper rungs of the adaptation ladder when they are good enough.

When retrieval is the choice, the skill lays out a full pipeline covering ingestion, structural chunking, hybrid vector and keyword search with rank fusion, reranking with explicit thresholds, deterministic context packing and tenant-scoped filtering. It also covers evaluation, splitting quality into retrieval and generation axes with metrics such as faithfulness, context precision and recall, plus cost and tail-latency tracking.

When tuning is warranted, the guidance favors parameter-efficient methods like LoRA, notes how they interact with retrieval, and describes distillation approaches that curate successful episodes and score results on cost per success. The skill ships reference digests of the underlying articles and papers and contains no scripts; it is guidance the agent applies while designing or reviewing a system.

When your agent uses it

Choose between retrieving knowledge at inference time and training it into weights, then build either well — chunking, hybrid search, rank fusion, reranking, retrieval evals, LoRA, distillation. Use when a model lacks knowledge your product needs.

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 12 files (102 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the claude-kit plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add ajyadav013/claude-kit
/plugin install claude-kit@claude-kit

Or copy only this skill to ~/.claude/skills/rag-and-model-tuning:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/rag-and-model-tuning &&
cp -R "$tmp/skills/rag-and-model-tuning" ~/.claude/skills/rag-and-model-tuning &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/rag-and-model-tuning inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/rag-and-model-tuning to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/rag-and-model-tuning &&
cp -R "$tmp/skills/rag-and-model-tuning" ~/.agents/skills/rag-and-model-tuning &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/rag-and-model-tuning inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/rag-and-model-tuning to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/rag-and-model-tuning &&
cp -R "$tmp/skills/rag-and-model-tuning" ~/.cursor/skills/rag-and-model-tuning &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/rag-and-model-tuning inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/ajyadav013/claude-kit.git --path skills/rag-and-model-tuning

Or copy the folder to ~/.gemini/skills/rag-and-model-tuning yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/rag-and-model-tuning:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/ajyadav013/claude-kit.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/rag-and-model-tuning &&
cp -R "$tmp/skills/rag-and-model-tuning" ~/.copilot/skills/rag-and-model-tuning &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/rag-and-model-tuning inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/ajyadav013/claude-kit.git

Then copy claude-kit/skills/rag-and-model-tuning into your agent's skills folder as rag-and-model-tuning. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Retrieve or tune decision
A comparison of retrieval and fine-tuning across freshness, attribution, access control and cost, with guidance to walk the adaptation ladder from the bottom up.
Chunking and hybrid search
Structure-based chunking strategies plus combined vector and keyword search, with rank fusion options for merging results.
Reranking and refusal rules
Criteria for adding or removing a cross-encoder reranker and a minimum relevance threshold that lets the system decline.
Tenant-safe retrieval
Guidance to filter by tenant or access rules inside the query on both search engines and to fail closed when tenant context is missing.
RAG evaluation metrics
A split of quality into retrieval and generation metrics, including claim-based faithfulness checks and rank-sensitive measures alongside recall.
LoRA and distillation
Parameter-efficient tuning settings and curated distillation that scores models on cost per successful task.

Good for

  • Decide whether a chatbot's missing product knowledge should be retrieved or fine-tuned
  • Design a RAG pipeline with chunking, hybrid search and reranking
  • Debug a retrieval system that answers confidently with the wrong passage
  • Set up an evaluation harness that separates retrieval and generation failures
  • Plan a LoRA fine-tune to cut inference cost on a narrow, high-volume task

Rag and model tuning FAQ

When does Rag and model tuning trigger?

It applies when a model lacks knowledge a product needs, such as when deciding between retrieval and training, designing or debugging a RAG pipeline, or planning a fine-tune or distillation run.

Does Rag and model tuning include scripts or tools?

No scripts are included. It is a set of guidance documents with reference digests of the underlying sources.

Which AI clients does Rag and model tuning work with?

It follows the shared agent skills format, so it works across the supported clients. It is also distributed through the claude-kit Claude Code plugin marketplace.

Does Rag and model tuning change how fine-tuning affects retrieval?

It notes that combining tuning with retrieval can help smaller models but degrade some mid-size models, so the combination should be measured rather than assumed.

How do I install Rag and model tuning in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/rag-and-model-tuning to use it in all your projects, or to .claude/skills/rag-and-model-tuning in one project. Or install the claude-kit plugin, which includes it: /plugin marketplace add ajyadav013/claude-kit, then /plugin install claude-kit@claude-kit.

Does Rag and model tuning run scripts?

No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Rag and model tuning?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Rag and model tuning?

The closest alternatives to Rag and model tuning are Rag eval, Rag reranker, Qdrant search strategies, Qdrant search quality diagnosis and Qdrant search strategies.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from ajyadav013/claude-kit

  1. Guides an agent through pytest, async fixtures and security-regression tests for FastAPI

    • Open source
    • 13 GitHub stars
    • Developer tools
  2. Lets your agent inspect and debug live browser pages via Chrome DevTools MCP

    • Open source
    • 13 GitHub stars
    • Browser automation
  3. Runs concurrent load and stress tests against API endpoints to find latency and throughput

    • Open source
    • 13 GitHub stars
    • Developer tools
  4. Lets an agent click through a feature in a real browser and check how it behaves

    • Open source
    • 13 GitHub stars
    • Developer tools
  5. Runs quick health checks on backend, frontend and login to catch obvious breakage

    • Open source
    • 13 GitHub stars
    • Developer tools
  6. Guides an agent through red-green-refactor, bug reproduction tests and test pyramid

    • Open source
    • 13 GitHub stars
    • Developer tools