Skip to content
Back to skills

Faiss

ASecurity

"Guides Researchers through Faiss installation, dense and binary

  • 247 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
developmentpythonc++bashapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill faiss --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Faiss?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Faiss
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-faiss/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-faiss)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: faiss
description: "Guides Researchers through Faiss installation, dense and binary
  similarity search, index training and composition, persistence and evaluation,
  and explicitly gated CPU/GPU interoperability workflows."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Faiss

Faiss is a C++ library with Python/NumPy bindings for efficient similarity
search and clustering of dense vectors. Use this skill when a task involves
nearest-neighbor search, vector indexing, clustering, quantization, binary
search, index files, or Faiss CPU/GPU integration.

## Start with the environment gate

1. Identify the distribution and backend required by the task. Use
   `faiss-cpu` for the CPU baseline. Use a documented CUDA/ROCm/Metal/cuVS/SVS
   package or source build only when the requested capability needs it.
2. Run the bundled read-only probe before making backend claims. The
   backend-specific checker is bundled with the accelerated route:

   ```bash
   python path/to/faiss/sub-skills/accelerated-and-interoperable/scripts/check_backend.py --json
   ```

   It reports the imported version, compile options, available GPU symbols,
   device count, optional module status, NumPy availability, and tool/runtime
   signals. A visible GPU does not turn a CPU build into a GPU build.
3. Normalize float inputs to contiguous `float32` arrays of shape `(n, d)`.
   Binary indexes instead use packed `uint8` rows with a bit dimension that is
   divisible by eight. Establish the metric and preprocessing before selecting
   an index.
4. Validate an approximate or compressed index against an exact Flat baseline
   on a bounded fixture before tuning recall, memory, or latency.

For public installation, prefer the documented Conda packages: `faiss-cpu` for
CPU, `faiss-gpu` for CUDA, and `faiss-gpu-cuvs` for the cuVS variant. A source
build uses CMake and can enable Python, CUDA/ROCm, C API, Metal, cuVS, or SVS
independently; do not enable extras merely because they exist.

## Route by task

- [Index selection and search](sub-skills/index-selection-and-search/SKILL.md)
  covers Flat, IVF, HNSW/graph search, metrics, factory strings, result
  contracts, `nprobe`, `efSearch`, range search, and CPU search tuning.
- [Training and compression](sub-skills/training-and-compression/SKILL.md)
  covers train/add/code lifecycles, IVF-PQ, PQ, SQ, residual/additive/RaBitQ,
  transforms, fast scan, reconstruction, and binary/Hamming indexes.
- [Composition and filtering](sub-skills/composition-and-filtering/SKILL.md)
  covers ID maps, selectors, per-search parameters, transforms, refinement,
  child ownership, direct maps, shards, replicas, and advanced IVF inspection.
- [Persistence and evaluation](sub-skills/persistence-and-evaluation/SKILL.md)
  covers byte/file serialization, cloning, mmap/on-disk storage, merge,
  clustering, exact ground truth, recall/precision, and operating points.
- [Accelerated and interoperable](sub-skills/accelerated-and-interoperable/SKILL.md)
  covers CUDA and multi-GPU transfer, cuVS/ROCm/Metal/SVS gates, C++/C APIs,
  Torch buffers, FFI, dynamic-library diagnosis, and RPC boundaries.

If a workflow spans branches, keep the core CPU baseline in the first relevant
route, then follow its explicit sibling link for composition, persistence,
compression, or backend-specific work. Do not treat a benchmark result as
validated until its data, metric, exact baseline, and backend are recorded.

## Minimal CPU check

```python
import numpy as np
import faiss

xb = np.ascontiguousarray(np.random.default_rng(0).random((100, 16), dtype="float32"))
index = faiss.IndexFlatL2(xb.shape[1])
index.add(xb)
D, I = index.search(xb[:2], 4)
assert D.shape == I.shape == (2, 4)
print(faiss.__version__, index.ntotal, faiss.get_compile_options())
```

Read [cross-cutting troubleshooting](references/troubleshooting.md) for
installation/import failures, dtype and shape errors, missing optional
backends, unsafe index files, and thread/runtime problems. Read
[repository provenance](references/repo-provenance.md) before deciding whether
this graph is stale for a changed Faiss checkout.

Files in this skill

  • SKILL.md4.1 KB
  • references/repo-provenance.md2 KB
  • references/repo-routing-metadata.json322 B
  • references/troubleshooting.md5.3 KB
  • sub-skills/accelerated-and-interoperable/SKILL.md4.7 KB
  • sub-skills/accelerated-and-interoperable/references/api-reference.md10.6 KB
  • sub-skills/accelerated-and-interoperable/references/troubleshooting.md8.3 KB
  • sub-skills/accelerated-and-interoperable/references/workflows.md9.2 KB
  • sub-skills/accelerated-and-interoperable/scripts/check_backend.py9 KB
  • sub-skills/composition-and-filtering/SKILL.md7 KB
  • sub-skills/composition-and-filtering/references/api-reference.md9.4 KB
  • sub-skills/composition-and-filtering/references/troubleshooting.md6.9 KB
  • sub-skills/composition-and-filtering/references/workflows.md7.7 KB
  • sub-skills/composition-and-filtering/scripts/smoke_composition.py7.1 KB
  • sub-skills/index-selection-and-search/SKILL.md2.3 KB
  • sub-skills/index-selection-and-search/references/api-reference.md8 KB
  • sub-skills/index-selection-and-search/references/troubleshooting.md6.5 KB
  • sub-skills/index-selection-and-search/references/workflows.md7.8 KB
  • sub-skills/index-selection-and-search/scripts/smoke_search.py7.3 KB
  • sub-skills/persistence-and-evaluation/SKILL.md3.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.