How feliziris/early-io-hnsw works
Faiss is a C++ library, with Python/NumPy and C interfaces, for dense-vector similarity search and clustering. A typical workflow is to train or configure an index, add identified vectors, then search with L2 or dot-product similarity; index families trade search speed, quality, and memory, and may store compressed vectors or graph structures. The README documents CPU and optional GPU search, while the source index identifies additional tuning, persistence, and distributed-search capabilities. Several subsystem links below are dashed because their implementation call paths were not sampled.
Main entry points: Index.cpp Index interface · GpuIndex.h GPU indexes · search_server.py Distributed search · class_wrappers.py Python wrappers
Components 22
Language interfaces
- Python wrappers
faiss/python/class_wrappers.py - C API
c_api/IndexIVF_c.h
Index families
- Index interface
faiss/Index.cpp - Exact flat indexes
faiss/IndexFlat.cpp - IVF indexes
faiss/IndexIVF.cpp - Graph indexes
faiss/IndexHNSW.cpp - Binary indexes
faiss/IndexBinary.cpp - Quantized indexes
faiss/IndexPQ.cpp - Vector transforms
faiss/VectorTransform.cpp - Index factory
faiss/index_factory.cpp
Search internals
- Inverted lists
faiss/invlists/InvertedLists.cpp - Distance kernels
faiss/utils/distances.cpp - Result selection
faiss/impl/ResultHandler.h - CPU search
faiss/Index.cpp
Execution platforms
- GPU indexes
faiss/gpu/GpuIndex.h - GPU resources
faiss/gpu/StandardGpuResources.cpp
Operations and extensions
- Clustering
faiss/Clustering.cpp - Index persistence
faiss/impl/index_write.cpp - Parameter tuning
faiss/AutoTune.cpp - RPC transport
contrib/rpc.py - Distributed search
benchs/distributed_ondisk/search_server.py
Other components
- Application
Connections 22
- Application → Python wrappers: uses API
README.md - Application → C API: uses API
README.md - Python wrappers → Index interface: exposes indexes
README.md - C API → Index interface: exposes indexes
c_api/IndexIVF_c.h - Index factory → Index interface: creates indexes
README.md - Index interface → Exact flat indexes: supports exact search
README.md - Index interface → IVF indexes: supports approximate search
README.md - Index interface → Graph indexes: supports graph search
README.md - Index interface → Binary indexes: supports binary search
README.md - Index interface → Quantized indexes: supports compressed search
README.md - Vector transforms → Index interface: wraps indexes
- Clustering → Index interface: trains indexes
README.md - IVF indexes → Inverted lists: stores postings
- CPU search → Distance kernels: computes distances
README.md - CPU search → Result selection: selects neighbors
faiss/impl/ResultHandler.h - CPU search → Index interface: searches indexes
README.md - GPU indexes → GPU resources: uses resources
faiss/gpu/StandardGpuResources.cpp - GPU indexes → Index interface: accelerates search
README.md - Index persistence → Index interface: serializes indexes
- Parameter tuning → Index interface: tunes parameters
README.md - Distributed search → RPC transport: serves requests
benchs/distributed_ondisk/search_server.py - Distributed search → Inverted lists: combines postings