Technology · Datastore

FAISS

FAISS is a reference and a bake-off participant in my vector work; my own GPU store builds deterministic indexes and reports their health.

Python index builds from PostgreSQLInference Fabric · FAFOHiveCPU and GPU indexes
One index type per set
HNSW graphmillions of answer embeddings
Inverted filehundreds of thousands of cluster centroids, searched cell by cell
Flat, exactthe small candidate set, every vector compared
  • 3index families, each chosen for the set it held
  • 7Bdense model in FP8 whose answers the pipeline searched
  • 1bulk update per build writes index positions back

Searching for the gaps in what a model knew

Inference Fabric grew out of a research pipeline I ran first, and FAISS was the vector engine in both. The pipeline interrogated a model through vLLM, embedded the answers with an embedding model, grouped them into concept clusters of question-and-answer units, and searched for gaps in what the model knew. FAISS ran the batch nearest-neighbour search that found those gaps, rebuilt the GPU indexes after each restructuring pass, and fed the centroid updates.

The knowledge base reached hundreds of thousands of clusters and millions of units. I picked the index type per set, because the centroids, the answer embeddings and the candidates differ by orders of magnitude in size and in how exact the search needs to be. The builder pulls vectors out of PostgreSQL with the binary COPY protocol and parses the vector type's binary layout itself, which keeps a multi-million-vector load to a single sequential transfer.

Binary COPY · one sequential stream
HNSW graph
inverted file
flat

set sizes illustrative

An index service, and where its cost sat

When the fabric needed an index service, I wrote the FAISS index manager as a function on my execution substrate. I staged vectors in an unlogged table, because the staging data is discarded after every build and gains nothing from write-ahead logging, and index positions go back to PostgreSQL through set-based stored procedures.

That design showed me where the cost sat: every vector made a round trip through SQL and a Python process. I replaced the FAISS path in the fabric once I decided vectors should stay on the GPU and out of SQL, and I kept the FAISS-computed distances that the health kernels still use.

First generation · one build
  • Materialise vectors from database viewsSQL
  • Stage them for the buildunlogged table
  • Build the index familiesPython subprocess
  • Write index ids and offsets backstored procedures
  • The staging tabledropped
Second generation · vectors stay on the GPU
Vector Shard Manager
first-party search indexes tied to their relational source
Kept from FAISSNeighbour distancesread by several of the CUDA cluster-health kernels

FAISS carried a research pipeline to millions of vectors; when the fabric needed GPU-resident storage with its own guarantees, I built that and kept the one FAISS output that still paid for itself. I used FAISS as a library and did not modify it.

I use a library where it solves the problem at hand and replace it when the architecture outgrows it.

Index maintenance as an agent tool

FAFOHive gives agents the index manager as an MCP (Model Context Protocol) tool, beside the other maintenance jobs for the same knowledge base.

Indexcount, build or validate a family, CPU or GPU
←
Admissiona candidate joins an existing cluster, or does not
Healthclusters scored in tiers
→
Rebalancean overloaded cluster split, after a dry run
The index tool submits jobs to the index manager and reports their state; the work happens behind it.