faiss

Implements billion-scale vector similarity search using FAISS index types and GPU acceleration.

Updated Jun 7, 2026
One-click install
npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill faiss-chensihakniroth
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/Chensihakniroth/ANAKOT-AGENT/tree/main/optional-skills/mlops/faiss
Command: npx skills add https://github.com/Chensihakniroth/ANAKOT-AGENT --skill faiss-chensihakniroth

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires faiss-cpu, faiss-gpu, numpy, and includes references (resource) components.

What problem does it solve? Performing nearest-neighbor search over millions or billions of dense embedding vectors is too slow with brute-force methods, and many vector databases add unnecessary overhead when you only need pure similarity search without metadata filtering. ## Core Features & Use Cases - Multiple Index Types: Choose from Flat (exact), IVF (clustered approximate), HNSW (graph-based), and PQ (memory-compressed) indices to balance speed, accuracy, and memory. - GPU Acceleration: Move indices to single or multiple GPUs for 10-100x faster search on large datasets. - Framework Integration: Works with LangChain and LlamaIndex for RAG pipelines, with save/load support for trained indices. - Use Case: Build a semantic search engine over 10 million document embeddings by training an IVFPQ index, saving it to disk, and serving low-latency k-NN queries. ## Quick Start Use the faiss skill to create an HNSW index over my embedding vectors and find the 5 nearest neighbors for a query vector.

Frequently Asked Questions about faiss

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I perform similarity search on vectors with FAISS?▼

Create an index such as faiss.IndexFlatL2(d) for your vector dimension, add your float32 vectors with index.add(), then call index.search(query, k) to retrieve the k nearest neighbors with distances and indices.

Which FAISS index type should I use for my dataset size?▼

Use Flat for under 10K vectors with exact results, IVF for 10K-1M vectors with fast approximate search, HNSW for 1M-10M vectors with best quality, and IVF+PQ for over 10M vectors needing low memory.

FAISS vs Chroma or Pinecone for vector search?▼

FAISS is best for pure high-performance similarity search without metadata filtering, supporting billions of vectors and GPU acceleration. Choose Chroma or Pinecone when you need metadata filtering or full database features.

Does FAISS support GPU acceleration?▼

Yes, install faiss-gpu and use faiss.index_cpu_to_gpu(res, 0, index) for a single GPU or faiss.index_cpu_to_all_gpus(index) for multi-GPU setups, achieving 10-100x speedups over CPU.

How do I get cosine similarity with FAISS?▼

Use faiss.IndexFlatIP(d) for inner product search and normalize vectors first with faiss.normalize_L2(vectors). Normalized inner product is equivalent to cosine similarity for text embeddings and recommendations.

When should I not use FAISS?▼

Avoid FAISS when you need metadata filtering, full database features like updates and transactions, or managed cloud hosting. In those cases use Weaviate, Chroma, or Pinecone instead.