top-k-vector-pruning
Installation
SKILL.md
Top-K Vector Retrieval Pruning Protocol (Cosine Threshold Guard)
Overview
In default Retrieval-Augmented Generation (RAG) pipelines, queries automatically retrieve Top-$K=10$ to $20$ document chunks to ensure high recall.
High-$K$ retrieval creates severe system failures:
- Severe Context Dilution: Ingesting 10 chunks (8,000+ tokens) buries the single relevant sentence under pages of unrelated documentation.
- Context Attention Degradation: Models perform worse when provided with excess background noise that contradicts or distracts from the core instruction.
- Exploding Input Token Costs: Paying $0.024 per query across thousands of searches drains enterprise budgets.
The Top-$K$ Vector Retrieval Pruning Protocol combines strict cosine similarity thresholding ($\text{Score} \ge 0.78$) with cross-encoder reranking to keep strictly the Top-$K=2$ or $3$ highest-confidence chunks.