Slate-ANN in Rust: Disk-Backed Vector RAG with SCAN I/O & Int8

Slate-ANN (arXiv:2612.00002, github.com/microsoft/Slate-ANN) is a disk-backed approximate nearest-neighbor engine built from scratch in Rust around a storage-aware query cost model. By combining sequential block layout, an elevator (SCAN) I/O scheduler, graph-aware relabeling, int8/float16 disk vectors, and a PQ fetch gate, Slate-ANN reaches 0.968 recall on SIFT1M in 361.7 MB—nearly half the footprint of FAISS HNSW (~660 MB).
Slate-ANN in Rust: Disk-Backed Vector RAG with SCAN I/O & Int8: Slate-ANN (arXiv:2612.00002, github.com/microsoft/Slate-ANN) is a disk-backed approximate nearest-neighbor engine built from scratch in Rust around a storage-aware query cost model. By combining sequential block layout, an elevator (SCAN) I/O scheduler, graph-aware relabeling, int8/float16 disk vectors, and a PQ fetch gate, Slate-ANN reaches 0.968 recall on SIFT1M in 361.7 MB—nearly half the footprint of FAISS HNSW (~660 MB). Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- 45% Smaller Footprint than HNSW: Holds SIFT1M at 0.968–0.97 recall in 361.7 MB (~247 MB in-memory graph + ~132 MB streamed int8 disk vectors) versus ~660 MB for FAISS HNSW.
- Storage-Aware Cost Model: Explicitly optimizes TraversalCost + StorageAccessCost + DistanceComputationCost, avoiding the 4,000x cold-disk penalty of naive hop-minimizing graphs.
- Elevator (SCAN) I/O + Graph Relabeling: Reorders graph node IDs for locality and services disk vector reads sequentially along platter/NVMe block order.
- AVX2 SIMD + PQ Fetch Gate: Computes 128-d L2 distances in 12.99 ns (768-d in 83.96 ns) on Zen3 while filtering candidate disk fetches through a lightweight product-quantization gate.
import { createAgent } from '@smoke-monkey/harness';// Coding & Retrieval Agent querying a Rust Slate-ANN disk-backed vector MCP serviceconst agent = createAgent({agentId: 'slate-ann-rag-retriever',provider: 'openai-compatible',model: 'Qwen/Qwen3-32B',baseUrl: process.env.VLLM_BASE_URL || 'http://127.0.0.1:8000/v1',apiKey: process.env.VLLM_API_KEY || 'local-key',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},mcpServers: {slateVector: {command: './target/release/slate-ann-mcp',args: ['--index', './data/corpus.slate', '--quant', 'int8', '--ef-search', '256'],},},});async function main() {const result = await agent.run('Retrieve the top 10 architectural RFC chunks matching storage-coalesced ANN traversal and summarize trade-offs.');console.log('Slate-ANN RAG answer:', result.summary);}main().catch(console.error);
Watch: Related Video Guides
Vector Search & Approximate Nearest Neighbors (ANN) | FAISS (HNSW & IVF)
Scale Vector Search to Production: HNSW, IVF, PQ & DiskANN Explained
Why HNSW Hits a Memory Wall and Why Hop Count Fails on Disk
Mainstream RAG vector engines rely on in-memory HNSW graphs, assuming both adjacency lists and full-precision float32 embeddings reside in RAM. At 1 billion 128-dimensional vectors, that requires roughly 760 GB of RAM. Yet simply moving HNSW vectors onto disk collapses throughput: arXiv:2612.00002 measures an identical query workload running ~4,000x slower from cold disk than warm RAM despite identical graph hop counts, because random disk seeks are orders of magnitude slower than sequential transfers.
Slate-ANN (written in Rust) minimizes QueryCost = TraversalCost + StorageAccessCost + DistanceComputationCost instead of raw hop count alone.
| Engine / Mode (SIFT1M 128-d) | Memory / Total Footprint | Recall@10 | Modeled Cost ($/mo) | Storage Strategy |
|---|---|---|---|---|
| Slate-ANN (`int8`) | 361.7 MB (~247 MB RAM graph + 132 MB disk) | 0.968–0.97 | $1.24 | Sequential block + SCAN + PQ gate |
| FAISS HNSW | ~660 MB (all RAM) | 0.999 | $2.26 | Full RAM-resident graph & vectors |
| FAISS IVF-PQ | ~90 MB (all RAM) | 0.589 | $0.31 | Compressed RAM centroids |
| DiskANN | 1.98 GB SSD | ~0.95–0.99 | SSD-bound | Co-located 4 KB random SSD sectors |
Inside Slate-ANN: Relabeling, SCAN Scheduling, Narrow Types & PQ Gate
Slate-ANN stacks five complementary storage optimizations inside its Rust engine:
- Graph-Aware Relabeling: Assigns contiguous physical IDs to graph neighbors so traversal candidates cluster within nearby disk blocks.
- Sequential Block Layout & Elevator (SCAN) Scheduler: Batches pending vector fetches and sweeps storage offsets monotonically instead of issuing thrashing random seeks.
- Narrow On-Disk Vectors (`float16` / `int8`): Halves or quarters disk bandwidth per fetched candidate with negligible recall loss.
- Product-Quantization (PQ) Fetch Gate: Uses compact in-memory codes to skip disk I/O for low-probability neighbors.
- AVX2 SIMD Kernels: On AMD Zen3, Slate-ANN executes
L2distance in 12.99 ns (128-d), 35.94 ns (384-d), and 83.96 ns (768-d), reaching 0.9800 Recall@10 at 1,359 QPS in warm RAM (m=32, ef_search=256).
Right-Sizing Graph Degree (m) & Beam (ef_search)
In Slate-ANN benchmarks, m=32 with ef_search=256 delivers 0.9800 Recall@10 at 1,359 QPS, whereas m=8 caps at 0.8529 even at ef_search=512—allocate graph degree before widening search beams.
Building & Benchmarking Slate-ANN Locally in Rust
Clone the Microsoft Research repository, build with native AVX2 target flags, and benchmark int8 disk-backed recall versus RAM footprints:
# 1. Clone and compile Slate-ANN in release mode with native CPU SIMD
git clone https://github.com/microsoft/Slate-ANN.git
cd Slate-ANN
RUSTFLAGS="-C target-cpu=native" cargo build --release
# 2. Run cargo unit tests & vector distance microbenchmarks
cargo test --release
./target/release/slate-ann --helpIntegrate Slate-ANN as a zero-cloud local retrieval server for Smoke Monkey Canvas agent teams indexing monorepos, legal corpora, or millions of code chunks on a single workstation SSD.
Frequently Asked Questions
Q:How does Slate-ANN compare to FAISS HNSW and DiskANN?
On SIFT1M, Slate-ANN int8 achieves 0.968–0.97 recall in 361.7 MB (~247 MB RAM graph + ~132 MB int8 disk vectors), roughly half FAISS HNSW’s ~660 MB RAM footprint (0.999 recall) and far smaller than DiskANN’s 1.98 GB SSD footprint while avoiding FAISS IVF-PQ’s 0.589 recall ceiling.
Q:Why does Slate-ANN use an elevator (SCAN) I/O scheduler?
Random disk seeks can make an identical hop-count graph search run 4,000x slower from cold disk than warm RAM. SCAN scheduling orders reads sequentially across storage blocks to eliminate seek thrashing.
Q:What programming language is Slate-ANN written in?
Slate-ANN is implemented from scratch in Rust with AVX2 SIMD kernels for L2, inner-product, and cosine distances.
Q:Can Slate-ANN work on 384-d and 768-d RAG embeddings?
Yes. The paper benchmarks AVX2 SIMD distance kernels across 128-d (12.99 ns L2), 384-d (35.94 ns L2), and 768-d (83.96 ns L2) embedding dimensions.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.