faiss
Facebook's library for efficient similarity search and clustering of dense vectors. Supports billions of vectors, GPU acceleration, and various index types (Flat, IVF, HNSW). Use for fast k-NN search, large-scale vector retrieval, or when you need pure similarity search without metadata. Best for hi
By orchestra-research · 851 installs
npx skills add orchestra-research/ai-research-skills --skill faiss
Source repository · Upstream listing
FAISS Efficient Similarity Search
Facebook AI's library for billion scale vector similarity search.
When to use FAISS
Use FAISS when:
Need fast similarity search on large vector datasets (millions/billions)
GPU acceleration required
Pure vector similarity (no metadata filtering needed)
High throughput, low latency critical
Offline/batch processing of embeddings
Metrics :
31,700+ GitHub stars
Meta/Facebook AI Research
Handles billions of vectors
C++ with Python bindings
Use alternatives instead :
Chroma/Pinecone : Need metadata filtering
Weaviate : Need full database features
Annoy : Simpler, fewer features
Quick start
Installation
Basic usage
Index types
1. Flat (exact search)
2. IVF (inverted file) Fast approximate
3. HNSW (Hierarchical NSW) Best quality/speed
4. Product Quantization Memory efficient
Save and load
GPU acceleration
LangChain integration
LlamaIndex integration
Best practices
1. Choose right index type Flat for <10K, IVF for 10K 1M, HNSW for quality
2. Normalize for cosine Use IndexFlatIP with normalized vectors
3. Use GPU for large datasets 10 100× faster
4. Save trained indices Training is expensive
5. Tune nprobe/ef search Balance speed/accuracy
6. Monitor memory PQ for large datasets
7. Batch queries Better GPU utilization
Performance
Index Type Build Time Search Time Memory Accuracy
Flat Fast Slow High 100%
IVF Medium Fast Medium 95 99%
HNSW Slow Fastest High 99%
PQ Medium Fast Low 90 95%
Resources
GitHub : https://github.com/facebookresearch/faiss ⭐ 31,700+
Wiki : https://github.com/facebookresearch/faiss/wiki
License : MIT