faiss

Build and query FAISS vector indexes for k-NN retrieval on float32 embeddings.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/MarbleSodas/Mavis --skill faiss-marblesodas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: faiss
Source: https://github.com/MarbleSodas/Mavis/tree/main/optional-skills/mlops/faiss
Command: npx skills add https://github.com/MarbleSodas/Mavis --skill faiss-marblesodas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

FAISS solves slow similarity search over large sets of dense vectors by providing efficient indexing and retrieval for k-nearest-neighbor queries.

Core Features & Use Cases

  • High-performance vector search: Use exact (Flat) or approximate (IVF, HNSW, PQ) indexes to quickly retrieve nearest embeddings for tasks like semantic search and recommendation.
  • Large-scale and GPU acceleration: Scale to millions or billions of vectors and optionally accelerate indexing/search with GPUs.
  • Memory-efficient retrieval: Apply product quantization (PQ) and IVF+PQ to significantly reduce memory footprint when storing embeddings.

Quick Start

Install the FAISS CPU or GPU package with pip, then create an index (such as IndexFlatL2 or IndexHNSWFlat), add your float32 embeddings, and run a top-k nearest-neighbor search for your 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 vector similarity index for fast k-NN retrieval?

FAISS provides exact search via Flat indexes and approximate search using IVF, HNSW, and Product Quantization. Approximate indexes significantly improve query latency and reduce memory footprint for large-scale embedding datasets, while exact search guarantees perfect accuracy.

What's the best way to reduce memory footprint for large-scale vector search?

Apply Product Quantization (PQ) or IVF+PQ to significantly reduce memory footprint when storing millions of embeddings. These approximate search techniques compress dense float32 vectors, enabling memory-efficient retrieval without entirely sacrificing search accuracy.

Can I use GPU acceleration for semantic search and retrieval pipelines?

Yes, FAISS supports optional GPU acceleration for indexing and searching large-scale vector datasets. Installing the GPU package allows you to maximize throughput and speed up k-nearest-neighbor queries for millions or billions of dense vectors.

Does FAISS require index training before adding dense embeddings?

Yes, approximate indexes like IVF and IVF+PQ require index training before adding float32 vectors and querying. Exact search indexes like IndexFlatL2 do not require training, allowing you to directly add embeddings and immediately perform similarity searches.

When should I not use HNSW or IVF for nearest neighbor search?

Avoid using approximate HNSW or IVF indexes when you require perfect accuracy and have a small enough dataset to fit in memory. In these cases, exact Flat search is preferred, as approximate indexes trade slight accuracy for speed and memory efficiency.