Expand description
Advanced HNSW optimizations.
§Heuristic Neighbor Selection (Malkov §4.2)
Instead of keeping the M closest neighbors, selects neighbors that provide good graph connectivity by preferring diverse directions over raw proximity.
§Time-Decay Edge Weights
Edge weights decay exponentially with age: w(e, t) = w0 * exp(-λ * age).
During search, decayed weights penalize stale connections.
§Backup Neighbors
Each node maintains a secondary neighbor list used when primary neighbors are removed (e.g., node expiration in streaming scenarios).
§Index Persistence
Serialize/deserialize the HNSW graph for crash recovery and snapshots.
Structs§
- Backup
Neighbors - Backup neighbor storage for handling node expiration.
- Serialized
Graph - Serialized HNSW graph for persistence.
Traits§
- Node
Vectors - Select neighbors using the heuristic from Malkov & Yashunin (2018) §4.2.
Functions§
- decay_
adjusted_ distance - Apply time-decay to a distance score.
- select_
neighbors_ heuristic - Select neighbors using the heuristic from Malkov & Yashunin (2018) §4.2.
- serialize_
graph - Serialize an HNSW graph to a portable format.
- time_
decay_ weight - Time-decay weight for an edge.