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:

  1. Severe Context Dilution: Ingesting 10 chunks (8,000+ tokens) buries the single relevant sentence under pages of unrelated documentation.
  2. Context Attention Degradation: Models perform worse when provided with excess background noise that contradicts or distracts from the core instruction.
  3. 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.


High-$K$ Noise Ingestion vs. Pruned High-Confidence Retrieval

Installs
1
GitHub Stars
2
First Seen
Oct 24, 2026