faiss

Implements billion-scale vector similarity search using FAISS indices with GPU acceleration.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/loteiron/ZeusAgent --skill faiss-loteiron
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/loteiron/ZeusAgent/tree/main/optional-skills/mlops/faiss
Command: npx skills add https://github.com/loteiron/ZeusAgent --skill faiss-loteiron

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Searching for nearest neighbors across millions or billions of embedding vectors is too slow with brute-force methods, and this Skill provides guidance for building fast approximate similarity search indexes with FAISS. ## Core Features & Use Cases - Index Selection Guidance: Choose between Flat, IVF, HNSW, and Product Quantization index types based on dataset size, memory limits, and accuracy requirements. - GPU Acceleration: Move indexes to single or multiple GPUs for 10-100x faster search on large vector datasets. - Framework Integration: Connect FAISS indexes with LangChain and LlamaIndex vector stores for RAG pipelines. - Use Case: Build a retrieval-augmented generation system that stores one million document embeddings in an HNSW index, then retrieves the five most relevant chunks for each user query in milliseconds. ## Quick Start Use the faiss skill to create an index for my embedding vectors and find the five 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 build a FAISS index for similarity search in Python?▼

Create an index with faiss.IndexFlatL2(d) for exact search, add float32 vectors with index.add(vectors), then call index.search(query, k) to retrieve the k nearest neighbors. For larger datasets, use IndexIVFFlat or IndexHNSWFlat for approximate search.

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

Use Flat for under 10K vectors with 100% accuracy, IVF for 10K-1M vectors with fast approximate search, HNSW for 1M-10M vectors with the best quality-speed trade-off, and IVF+PQ for over 10M vectors when memory is limited.

FAISS vs Chroma or Pinecone for vector search?▼

FAISS is best for pure vector similarity at billion scale with GPU acceleration and no metadata filtering. Choose Chroma or Pinecone when you need metadata filtering, and Weaviate when you need full database features.

Does FAISS support GPU acceleration?▼

Yes, install faiss-gpu and use faiss.index_cpu_to_gpu(res, 0, index_cpu) to move an index to a single GPU, or faiss.index_cpu_to_all_gpus for multi-GPU. GPU search is typically 10-100x faster than CPU.

How do I use FAISS for cosine similarity search?▼

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

Why does my FAISS IVF index return poor search results?▼

IVF indexes require training with index.train(vectors) before adding data, and low nprobe values reduce recall. Increase index.nprobe toward nlist for higher accuracy at the cost of search speed.