Skip to main content
FAISS (Facebook AI Similarity Search) is a library for efficient similarity search and clustering of dense vectors. This guide demonstrates how to use Archil disks to store and share FAISS indices across multiple servers, enabling scalable vector search for AI applications like recommendation systems, semantic search, and similarity matching.

Create an Archil disk

First, follow the Archil Getting Started Guide to create an Archil disk that you want to use for storing your FAISS indices and embeddings.
The --shared flag enables multiple servers to access the same vector indices simultaneously.

Install dependencies

Create a Python virtual environment and install FAISS with dependencies:

Set up directory structure

Create directories for organizing your vector search data:

Understanding FAISS index types

FAISS offers several index types, each optimized for different use cases. Choosing the right index depends on your dataset size, memory constraints, accuracy requirements, and search speed needs.
IndexFlatL2 and IndexFlatIP provide exact search results by comparing the query against every vector in the database.When to use: Small to medium datasets (< 1M vectors), when you need 100% accuracyCharacteristics:
  • Memory usage: 4 bytes × dimension × number of vectors
  • Search time: Linear with dataset size
  • Accuracy: Perfect (exact results)
  • Training required: No
Pros: Perfect accuracy, simple to use, no training required Cons: Slow for large datasets, high memory usage

Build a vector search system

Create a Python script for your FAISS-based vector search:

Load sample data

Create a script to load and index a larger dataset:

Multi-server search service

Create a simple search service that multiple servers can run:

Performance optimization

Index types comparison

Monitoring and maintenance

Monitor your FAISS indices on Archil:

Advanced features

Batch processing

Index merging

Benefits of FAISS with Archil

  • Shared indices: Multiple servers access the same vector indices without duplication
  • Fast loading: Indices load quickly from Archil’s high-speed cache
  • Scalable storage: Store large vector databases that exceed local disk capacity
  • Multi-model support: Share different embedding models across your infrastructure
  • Cost efficient: Eliminate the need to replicate large indices across servers

Next steps

  • Explore GPU acceleration with faiss-gpu
  • Implement real-time index updates
  • Add index compression techniques
  • Integrate with production search systems
  • Scale to billion-vector datasets
This setup provides a robust foundation for building production vector search systems with FAISS and Archil’s shared storage capabilities.