Skip to content

todos in vector DB indexing #9

Description

@ramsterr
  1. Better Vector DB Indexing (For Speed)
    If you are doing exact cosine similarity (brute-force k-NN), it will be too slow as your DB grows. You need Approximate Nearest Neighbor (ANN) algorithms.

HNSW (Hierarchical Navigable Small World): The current gold standard for speed. It builds a multi-layer graph. Searches start at the top (sparse, fast) and zoom down (dense, accurate). It offers O(log N) search time.

Product Quantization (PQ): If you have billions of vectors and RAM is an issue. PQ compresses vectors by chopping them into sub-vectors and replacing them with cluster IDs. You lose a tiny bit of accuracy but save massive amounts of memory and gain speed.

Matryoshka Embeddings: Use models (like OpenAI's text-embedding-3-large) that support Matryoshka Representation Learning. This allows you to store a truncated version of the vector (e.g., first 256 dimensions instead of 3072) for ultra-fast initial filtering, and keep the full vector for the final re-ranking

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions