Skip to content

Epic 2 - Shard Routing and Partitioning #7

@rmax

Description

@rmax

Parent

Goal

Improve vector partitioning to reduce query fan-out and improve latency.

Detailed tasks

  • 2.1 Implement vector clustering
    • Use k-means clustering to partition vectors.
    • Train centroids on a sample subset.
    • Store centroid metadata.
  • 2.2 Centroid routing logic
    • Compute nearest centroids at query time.
    • Route the query to the top-N shards.
  • 2.3 Shard metadata format
    • Ensure each shard includes:
      • centroid_id
      • vector_count
      • index_type
      • file_location
  • 2.4 Query fan-out policy
    • Implement configurable parameters for:
      • candidate_centroids
      • candidate_shards
      • max_vectors_per_shard
  • 2.5 Partition evaluation harness
    • Add the CLI command shardlake evaluate-partitioning.
    • Report:
      • shard size distribution
      • routing accuracy
      • recall impact
      • shard hotness

Definition of done

  • Shards are assigned by a repeatable clustering strategy.
  • Query routing targets the most relevant shards instead of broadcasting everywhere.
  • Partition quality can be measured through a dedicated evaluation command.

Child issue breakdown

Dependency summary

Dependency graph

#38   #39
  \   /
   #40
   /   \\
#41   #42

Metadata

Metadata

Assignees

Labels

epicTop-level epic issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions