faiss

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

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Clay-HHK/claude-skills --skill faiss-clay-hhk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/Clay-HHK/claude-skills/tree/main/faiss
Command: npx skills add https://github.com/Clay-HHK/claude-skills --skill faiss-clay-hhk

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 computationally expensive with naive approaches, and this Skill provides guidance for building fast, memory-efficient similarity search indexes with FAISS. ## Core Features & Use Cases - Index Type Selection: Covers Flat, IVF, HNSW, and Product Quantization indexes with guidance on choosing based on dataset size, accuracy, and memory constraints. - GPU Acceleration: Shows how to move indexes to single or multiple GPUs for 10-100x faster search on large datasets. - Framework Integration: Includes LangChain and LlamaIndex integration patterns for RAG pipelines, plus index save/load for persistence. - Use Case: When building a semantic search system over 5 million document embeddings, use this Skill to create an HNSW index, tune efSearch for the right speed/accuracy balance, and persist the trained index to disk. ## Quick Start Ask the AI to create a FAISS index for your embedding vectors and run a k-nearest-neighbor search on a sample query.

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 get the k nearest neighbors with distances. Larger datasets benefit from IVF or HNSW indexes.

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 the best quality, and IVF+PQ for over 10M vectors when memory is limited.

FAISS vs Chroma or Pinecone for vector search?▼

FAISS is a pure similarity search library without metadata filtering or database features, making it ideal for high-performance offline or embedded search. Choose Chroma or Pinecone when you need metadata filtering, managed storage, or full database capabilities.

Does FAISS support GPU acceleration?▼

Yes, install faiss-gpu and use faiss.index_cpu_to_gpu(res, 0, index) to move an index to a GPU, or faiss.index_cpu_to_all_gpus(index) for multi-GPU. GPU execution typically delivers 10-100x speedup over CPU.

How do I use cosine similarity with FAISS?▼

Use faiss.IndexFlatIP(d) for inner product search and normalize your vectors with faiss.normalize_L2() before adding and querying. Inner product on L2-normalized vectors is equivalent to cosine similarity.

Why does my FAISS IVF index return poor results?▼

IVF indexes require training on representative data via index.train() before adding vectors, and results depend on the nprobe parameter. Increase nprobe to search more clusters, trading speed for higher recall.