faiss

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

2|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill faiss-shubh2310-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/Shubh2310-developer/ENGUNITYCORE/tree/main/.claude/skills/rag-faiss
Command: npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill faiss-shubh2310-developer

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 embedding vectors is too slow with brute-force approaches, and choosing the wrong index type wastes memory or sacrifices accuracy. This Skill provides guidance and code patterns for building, training, tuning, and persisting FAISS indexes for fast k-NN retrieval. ## Core Features & Use Cases - Index Type Selection: Covers Flat (exact), IVF (clustered approximate), HNSW (graph-based), and PQ (memory-compressed) indexes with guidance on when to use each based on dataset size. - GPU Acceleration: Shows how to move indexes to single or multiple GPUs for 10-100x speedups on large datasets. - Framework Integration: Includes LangChain and LlamaIndex integration patterns for RAG pipelines, plus index save/load for persistence. - Use Case: You are building a semantic search feature 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 with the appropriate index type for your dataset size.

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 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 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 fastest for raw vector retrieval. Choose Chroma or Pinecone when you need metadata filtering, and Weaviate when you need full database capabilities.

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. GPU execution is typically 10-100x faster than CPU for large datasets.

How do I use FAISS for cosine similarity search?

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

Why does my FAISS IVF index return poor search results?

IVF indexes require training on representative data via index.train() before adding vectors, and results depend on nprobe. Low nprobe values search fewer clusters, so increase nprobe toward nlist to improve recall at the cost of speed.