# RAG Chunking Strategy Advisor

> Given a document type and retrieval goal, recommends the optimal chunking strategy for a RAG pipeline to minimize retrieval failures.

- **Type:** Skill
- **Install:** `agentstack add skill-notysoty-openagentskills-rag-chunking-advisor`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Notysoty](https://agentstack.voostack.com/s/notysoty)
- **Installs:** 0
- **Category:** [AI & ML](https://agentstack.voostack.com/c/ai-and-ml)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Notysoty](https://github.com/Notysoty)
- **Source:** https://github.com/Notysoty/openagentskills/tree/main/skills/rag-chunking-advisor

## Install

```sh
agentstack add skill-notysoty-openagentskills-rag-chunking-advisor
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# RAG Chunking Strategy Advisor

## What this skill does

This skill analyzes your document types, content structure, and retrieval goals to recommend the right chunking strategy for your RAG pipeline. Poor chunking is the #1 cause of RAG failures — chunks too large lose precision, chunks too small lose context. This skill picks the right strategy and explains exactly how to implement it.

## How to use

### Claude Code / Cline

Copy this file to `.agents/skills/rag-chunking-advisor/SKILL.md` in your project root.

Then ask:
- *"Use the RAG Chunking Strategy Advisor to help me chunk our legal contract PDFs."*
- *"What chunking strategy should I use for markdown documentation with code blocks?"*

Provide:
- Document type (PDFs, markdown, HTML, code, emails, etc.)
- Typical document length
- What users will search for (questions, keywords, concepts)
- Your embedding model if known

### Cursor / Codex

Paste the instructions below along with your document type and retrieval use case.

## The Prompt / Instructions for the Agent

When asked to advise on RAG chunking, follow these steps:

### Step 1 — Identify document characteristics

Ask or infer:
- **Document type**: structured (tables, headers) vs. unstructured (prose) vs. code
- **Length**: short ( "Use the RAG Chunking Advisor. I'm building a support chatbot. Documents are markdown product docs, 5–30 pages each, with H2 and H3 headers. Users ask specific how-to questions."

**Output:**
> **Recommended strategy: Header-based chunking**
>
> Split on H2 headers as primary boundaries, H3 as secondary. Each chunk = one section, with its full heading path prepended (`Product > Installation > macOS Setup`).
>
> Config:
> ```python
> from langchain.text_splitter import MarkdownHeaderTextSplitter
> splitter = MarkdownHeaderTextSplitter(
>     headers_to_split_on=[("##", "section"), ("###", "subsection")]
> )
> ```
>
> Add metadata: `{"source": filename, "section": heading_path, "doc_type": "product_docs"}`
>
> If sections exceed 800 tokens, apply a secondary recursive split with `chunk_size=600, overlap=60`.
>
> Validate: run your top 20 support questions against the index and confirm the relevant section appears in top-3.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Notysoty](https://github.com/Notysoty)
- **Source:** [Notysoty/openagentskills](https://github.com/Notysoty/openagentskills)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-notysoty-openagentskills-rag-chunking-advisor
- Seller: https://agentstack.voostack.com/s/notysoty
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
