cluster-quantized-knn

Community

Fast approximate KNN via cluster quantization.

Authorthistleknot
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill reduces expensive pairwise distance computations for KNN scoring by approximating distances using precomputed cluster centroid relationships plus per-point intra-cluster offsets.

Core Features & Use Cases

  • Cluster-Quantized O(1) Distance Scoring: Approximates dist(i, j) with centroid-to-centroid distance plus intra-cluster distances for i and j.
  • Precomputation Protocol: Builds centroids, intra distances, and a centroid distance matrix once to make runtime lookups fast.
  • Two-Path Routing for Correctness: Uses an approximate distance for unfiltered walk-mode traversal and switches to exact distance when filtering breaks cluster validity.
  • Walk Mode Scorers: Supports MMR-style diversity reranking and stochastic density-walk selection for exploration.

Quick Start

Use the cluster-quantized-knn skill to precompute centroid and intra-cluster distance tables from your labeled embedding corpus, then route unfiltered queries through the O(1) approximate distance while routing filter-then-rank queries through exact distances over the filtered survivor set.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: cluster-quantized-knn
Download link: https://github.com/thistleknot/skills/archive/main.zip#cluster-quantized-knn

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.