faiss

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

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

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 too slow with brute-force approaches, and many vector databases add unwanted overhead when you only need pure similarity search without metadata filtering. ## Core Features & Use Cases - Multiple Index Types: Choose from Flat (exact), IVF (clustered approximate), HNSW (graph-based), and PQ (memory-compressed) indices to balance speed, memory, and accuracy. - GPU Acceleration: Move indices to single or multiple GPUs for 10-100x faster search on large datasets. - Framework Integration: Works with LangChain and LlamaIndex vector stores for RAG pipelines. - Use Case: Build a semantic search engine over 10 million document embeddings by training an IVFPQ index, saving it to disk, and serving sub-millisecond k-NN queries. ## Quick Start Use the faiss skill to create an index for my embedding vectors and find the 5 nearest neighbors of 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 perform similarity search on vectors with FAISS?

Create an index such as faiss.IndexFlatL2(d) with your vector dimension, add 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 with fast approximate search, HNSW for 1M-10M with best quality, and IVF+PQ for over 10M vectors needing low memory.

FAISS vs Chroma or Pinecone for vector search?

FAISS provides pure similarity search without metadata filtering, ideal for high-performance offline or batch workloads. Choose Chroma or Pinecone when you need metadata filtering or full database features.

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, achieving 10-100x speedup over CPU.

How do I use cosine similarity with FAISS?

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

Why does my FAISS IVF index return poor results?

IVF indices require training on representative data via index.train(vectors) before adding vectors. Also increase index.nprobe to search more clusters, trading speed for higher recall.