refactor: remove 3,700+ LOC of unused HNSW implementations

Delete dead code island that was never instantiated in production:
- OptimizedHNSWIndex (430 LOC)
- PartitionedHNSWIndex (412 LOC)
- DistributedSearchSystem (635 LOC)
- ScaledHNSWSystem (744 LOC)
- HNSWIndexOptimized (585 LOC)
- brainy-backup.ts stale example (903 LOC)

Also upgrades entry point recovery from O(n) to O(1) using existing
highLevelNodes index structure.

Production uses only: HNSWIndex (memory) and TypeAwareHNSWIndex (persistent)
This commit is contained in:
David Snelling 2025-11-25 15:36:49 -08:00
parent 52eae67cb8
commit e3146ce11d
10 changed files with 47 additions and 3774 deletions

View file

@ -14,7 +14,6 @@
*/
import { HNSWIndex } from '../hnsw/hnswIndex.js'
import { HNSWIndexOptimized } from '../hnsw/hnswIndexOptimized.js'
import { TypeAwareHNSWIndex } from '../hnsw/typeAwareHNSWIndex.js'
import { MetadataIndexManager } from '../utils/metadataIndex.js'
import { Vector } from '../coreTypes.js'
@ -233,7 +232,7 @@ class QueryPlanner {
*/
export class TripleIntelligenceSystem {
private metadataIndex: MetadataIndexManager
private hnswIndex: HNSWIndex | HNSWIndexOptimized | TypeAwareHNSWIndex
private hnswIndex: HNSWIndex | TypeAwareHNSWIndex
private graphIndex: GraphAdjacencyIndex
private metrics: PerformanceMetrics
private planner: QueryPlanner
@ -242,7 +241,7 @@ export class TripleIntelligenceSystem {
constructor(
metadataIndex: MetadataIndexManager,
hnswIndex: HNSWIndex | HNSWIndexOptimized | TypeAwareHNSWIndex,
hnswIndex: HNSWIndex | TypeAwareHNSWIndex,
graphIndex: GraphAdjacencyIndex,
embedder: (text: string) => Promise<Vector>,
storage: any