⚡AgentSkills
🤖 AI Engineering · RAG Pipelines

Design a chunking strategy for retrieval

Choose chunk sizes, overlaps, and structure-aware splits so retrieved context actually helps the model answer.

foundation~25 minAI EngineersML EngineersLLM App Developers

Steps

  1. 1Profile source documents: length distribution, headings, tables, code blocks
  2. 2Pick structural splitter first (headings/paragraphs) over fixed character cuts
  3. 3Set chunk size from your model's effective context budget minus prompt overhead
  4. 4Add 10-20% overlap so facts spanning boundaries survive retrieval
  5. 5Attach metadata per chunk: source title, section path, date, permissions
  6. 6Build 20 golden questions and measure retrieval hit-rate before scaling up

Common Pitfalls

  • ▲Fixed-size chunks that slice tables and lists into meaningless fragments
  • ▲Chunks larger than half the context window, starving the actual answer space
  • ▲No overlap, causing answers that cite half a sentence cut at a boundary

Success Signals

  • ✓Recall@5 above 85% on golden set
  • ✓Median chunks-per-answer under 6

Commands

Install with skills CLI
$ npx skills add aniruddhaadak80/skills --skill rag-pipelines-chunking-strategy
Install globally
$ npx skills add aniruddhaadak80/skills --skill rag-pipelines-chunking-strategy -g

Tags

#rag#embeddings#retrieval#ai-engineering#rag-pipelines

Related skills

Combine BM25-style lexical search with dense embeddings and fuse results so both rare terms and paraphrases are found.

🤖 AI Engineering·~35m

Score groundedness, relevance, and completeness with judge prompts plus deterministic checks wired into CI.

🤖 AI Engineering·~45m