LLM RAG Retrieval Internals

Use when the user asks to build a RAG pipeline over documentation, tune HNSW (M, efSearch) or IVF-PQ (nprobe), hybrid dense + BM25 search, reciprocal rank fusion, cross-encoder reranking, Self-RAG or DSPy. Produces index choice and parameters, a hybrid+rerank pipeline and recall evals. Not for query rewriting and RAG prompts (use prompt-rag-query-design).

45 stars 6 forksAI, LLMs & Agents

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add j4flmao/agent-skills --skill llm-rag-retrieval-internals
Manual install
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p ~/.claude/skills
cp -r /tmp/agent-skills/skills/ai/llm-engineering/rag-architecture ~/.claude/skills/llm-rag-retrieval-internals

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# RAG Retrieval Internals

## Purpose
Retrieval quality caps RAG quality: the generator cannot use a passage that was never retrieved. This skill explains how approximate nearest neighbour (ANN) indexes trade recall for speed and memory, how to tune them, and how to build the repo-standard pipeline: hybrid retrieval (dense + BM25), fusion, cross-encoder reranking, and measured end-to-end evaluation.

## Agent Protocol

### Trigger
"HNSW", "IVF", "product quantization", "efSearch", "nprobe", "ANN recall", "hybrid search", "reciprocal rank fusion", "reranker", "Self-RAG", "DSPy".

### Input Context
- Corpus size (vectors), embedding dimension, update rate.
- Latency SLO, memory budget, required recall@k.
- Current pipeline and failure examples (missed passages, wrong answers).

### Output Artifact
Index choice and parameters, hybrid/rerank pipeline, evaluation plan with retrieval and answer metrics.

### Response Format
```
Corpus: {N} vectors × {d} dims  Memory budget: {GB}
Index: {HNSW|IVF-Flat|IVF-PQ|flat} params: {M, efConstruction, efSearch | nlist, nprobe, m, nbits}
Hybrid: dense top-{k1} + BM25 top-{k2} -> RRF(k=60) -> rerank top-{n}
Metrics: recall@{k} vs exact, nDCG@{n}, answer faithfulness
```

### Completion Criteria
- [ ] ANN recall measured against exact (flat) search on a sample.
- [ ] Hybrid retrieval and reranking in place (repo rule).
- [ ] Chunking is structure-aware or parent-child, not blind fixed-size (repo rule).
Read the full skill on GitHub

Details

Skill name
llm-rag-retrieval-internals
Path
skills/ai/llm-engineering/rag-architecture/SKILL.md
License
MIT
Repo updated
17 November 2026

FAQ

What does the LLM RAG Retrieval Internals skill do?

Use when the user asks to build a RAG pipeline over documentation, tune HNSW (M, efSearch) or IVF-PQ (nprobe), hybrid dense + BM25 search, reciprocal rank fusion, cross-encoder reranking, Self-RAG or DSPy. Produces index choice and parameters, a hybrid+rerank pipeline and recall evals. Not for query rewriting and RAG prompts (use prompt-rag-query-design).

How do I install the LLM RAG Retrieval Internals skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add j4flmao/agent-skills --skill llm-rag-retrieval-internals. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is LLM RAG Retrieval Internals popular?

It lives in j4flmao/agent-skills, which has 45 GitHub stars and 6 forks.

Related skills

Agent Observability

45

j4flmao/agent-skills

Use when the user asks about agent observability, tracing agent reasoning, debugging an agent loop, OpenTelemetry GenAI spans for LLM calls, LLM cost tracking per agent, agent audit logs or hallucination/eval monitoring in production. Produces instrumentation config, trace schema, dashboards, alerts and cost attribution. Not for generic service tracing without LLMs (use devops-opentelemetry).

DevOps & Cloud

AI Agent Architectures

45

j4flmao/agent-skills

Use when the user asks to build an AI agent, design an agent that calls tools and keeps memory, write an agent system prompt or pick an agent framework (Claude Agent SDK, OpenAI Agents SDK, LangGraph). Produces an architecture brief covering loop, tools, memory, guardrails and evals, routing depth to child skills. Not for workflow patterns (use ai-agentic-workflows).

AI, LLMs & Agents

AI Agent Core Loop

45

j4flmao/agent-skills

Use when the user asks about the agent loop, ReAct vs plan-and-solve, re-planning, Reflexion, an agent stuck in a loop, max iterations or termination conditions. Produces a loop spec or patch with state, success predicate, caps and no-progress detection. Not for overall agent design (use ai-agent-architectures) or tool schemas (use tool-calling-principles).

AI, LLMs & Agents

Multi Agent Topology

45

j4flmao/agent-skills

Use when the user asks whether to use multiple agents, supervisor-worker, agent hierarchy, pipeline of agents, handoffs or a critic/debate setup. Produces a topology diagram, role table with least-privilege tools, typed edge contracts and round caps. Not for framework runtime and checkpointing (use ai-multi-agent-systems) or R&D swarms (use swarm-architectures).

AI, LLMs & Agents

LLM Model Quantization

45

j4flmao/agent-skills

Use when the user asks to quantize a model, GGUF, Q4_K_M, llama-quantize, GPTQ, AWQ, NF4, bitsandbytes, INT8/FP8 weights or a model too big for the GPU. Produces format choice per engine, quantization commands, memory estimate and an eval gate. Not for NVFP4/FP8 kernel-level tuning (use extreme-quantization-mastery) or QLoRA training (use llm-finetuning).

AI, LLMs & Agents

Neuromorphic Computing

45

j4flmao/agent-skills

Use this skill when the user says 'neuromorphic', 'spiking neural network', 'SNN', 'LIF neuron', 'Loihi', 'SpiNNaker', 'event camera', 'surrogate gradient', 'snnTorch', 'Lava framework', 'memristor in-memory computing'. Explains event-driven spiking computation, neuron models, training methods (surrogate gradients, ANN-to-SNN conversion), hardware platforms, and when neuromorphic approaches are worth prototyping. Do NOT use for: conventional GPU deep learning (ml/deep-learning), edge inference on MCUs with standard networks (embedded-systems/edge-ai), or quantum hardware (quantum-computing/*).

AI, LLMs & Agents

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.