# Rag and model tuning

> Rag and model tuning is an open-source agent skill for knowledge and memory. Guides choosing between retrieval and fine-tuning, then building RAG pipelines or tuning. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/ajyadav013/claude-kit/tree/main/skills/rag-and-model-tuning
- **Repository:** https://github.com/ajyadav013/claude-kit
- **GitHub stars:** 13
- **License:** MIT
- **Skill name:** rag-and-model-tuning
- **Collection:** https://github.com/ajyadav013/claude-kit
- **Categories:** [knowledge and memory](https://ai-powered.com/categories/knowledge-and-memory), [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm)
- **Listing updated:** 2026-12-03

## About

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.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Instructions only, no scripts](https://github.com/ajyadav013/claude-kit/tree/HEAD/skills/rag-and-model-tuning)
- [License: MIT](https://github.com/ajyadav013/claude-kit/tree/HEAD/skills/rag-and-model-tuning)

## Features

- **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

## Install

### Claude Code

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

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

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

```sh
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.

### Codex

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

```sh
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.

### Cursor

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

```sh
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.

### Gemini CLI

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

```sh
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.

### VS Code

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

```sh
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.

### Other agents

Get the folder:

```sh
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.

## 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.

## Alternatives

- [Rag eval](https://ai-powered.com/skills/rag-eval): Rag eval is an open-source agent skill for knowledge and memory.
- [Rag reranker](https://ai-powered.com/skills/rag-reranker): Rag reranker is an open-source agent skill for knowledge and memory.
- [Qdrant search strategies](https://ai-powered.com/skills/qdrant-search-strategies): Qdrant search strategies is an open-source agent skill for knowledge and memory.
- [Qdrant search quality diagnosis](https://ai-powered.com/skills/qdrant-search-quality-diagnosis-qdrant): Qdrant search quality diagnosis is an open-source agent skill for knowledge and memory.
- [Qdrant search strategies](https://ai-powered.com/skills/qdrant-search-strategies-qdrant): Qdrant search strategies is an open-source agent skill for knowledge and memory.
- [Qdrant search quality](https://ai-powered.com/skills/qdrant-search-quality-qdrant): Qdrant search quality is an open-source agent skill for knowledge and memory.
- [Finetuning](https://ai-powered.com/skills/finetuning): Finetuning is an open-source agent skill for ai models and llm tooling.
- [Qdrant hybrid search](https://ai-powered.com/skills/qdrant-hybrid-search): Qdrant hybrid search is an open-source agent skill for knowledge and memory.

---
Source: https://ai-powered.com/skills/rag-and-model-tuning-ajyadav013
