faiss

Build FAISS indexes and run k-nearest-neighbor queries over dense embeddings.

Updated May 2, 2026
One-click install
npx skills add https://github.com/qcmuu/AI-Research-Skills --skill faiss-qcmuu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/qcmuu/AI-Research-Skills/tree/main/15-rag/faiss
Command: npx skills add https://github.com/qcmuu/AI-Research-Skills --skill faiss-qcmuu

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill solves the need for fast similarity search over large collections of dense vectors by providing practical guidance to build and tune FAISS indexes.

Core Features & Use Cases

  • High-performance k-NN retrieval: Build exact (Flat) or approximate (IVF, HNSW) indexes to find nearest neighbors for embedding-based queries.
  • Scalability and efficiency: Use GPU acceleration and quantization (PQ/IVFPQ) to scale to millions/billions of vectors under tight latency and memory constraints.
  • Production-ready integration: Support saving/loading indexes and working with common RAG tooling via LangChain and LlamaIndex workflows.

Use case example: When your RAG system needs to retrieve relevant passages from a large embedding corpus with low latency, choose an IVF or HNSW index for strong recall, or choose IVF+PQ for memory-efficient deployment at very large scale.

Quick Start

Use the faiss skill to create a nearest-neighbor index for your embedding dimension by installing faiss-cpu or faiss-gpu and running a sample search with IndexFlatL2 or IndexFlatIP using float32 vectors.

Frequently Asked Questions about faiss

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

FAQPage Schema
How do I build a vector similarity search index for RAG retrieval?

Build a vector similarity search index by selecting a FAISS index type like Flat, IVF, or HNSW, then training and adding float32 dense embeddings to run k-nearest-neighbor queries for fast RAG retrieval.

What's the best way to scale billion-scale vector search under memory constraints?

Scale billion-scale vector search by using IVFPQ indexes with product quantization and GPU acceleration, reducing memory footprint while maintaining low-latency approximate nearest neighbor retrieval.

Does FAISS work with LangChain and LlamaIndex workflows?

FAISS works with LangChain and LlamaIndex workflows by saving and loading indexes to support production-ready integration for embedding-based retrieval in RAG applications.

When should I use HNSW vs IVF for approximate nearest neighbor search?

Use HNSW for strong recall with graph-based search, or IVF for cluster-based retrieval where you can tune nprobe parameters; both provide approximate nearest neighbor search over dense embeddings.

Why does my FAISS search return incorrect similarity results?

Incorrect similarity results often occur when vector dtypes are not float32 or embeddings are not normalized for the selected similarity metric, causing inaccurate nearest neighbor calculations.

Can I use GPU acceleration for k-NN queries in production services?

Use GPU acceleration for k-NN queries by installing faiss-gpu alongside numpy, enabling low-latency production services for large-scale dense vector similarity search and clustering.