SPTAG (Space Partition Tree And Graph) is a high-performance open-source vector search and indexing library developed and open-sourced by Microsoft Research and Microsoft Bing. Engineered to power web-scale semantic search, billion-scale embedding indexing, and low-latency vector retrieval across distributed clusters, SPTAG combines hierarchical space partitioning trees with optimized relative neighborhood graph algorithms (BKT and KDT algorithms).
The library excels at low-latency vector retrieval across massive datasets, supporting both in-memory serving and memory-efficient SSD-resident index architectures through its SPANN (Space-Partitioned Approximate Nearest Neighbors) subsystem. SPANN partitions billions of vectors into hierarchical clusters, storing only centroid index structures in RAM while streaming raw vector postings from NVMe SSDs, slashing DRAM hardware costs by up to 90% without compromising top-k recall.
Unlike static batch-built vector libraries, SPTAG natively supports dynamic real-time online mutations—including continuous vector insertions, deletions, and metadata updates—without requiring complete index rebuilds or service interruptions. It scales linearly across multi-core CPU architectures using lock-free read paths and batch mutation buffers designed for high-concurrency production environments.
Distributed 100% free and open-source under the MIT license with over 5,000 GitHub stars, SPTAG provides comprehensive C++, Python, and C# (.NET) SDKs alongside multi-threaded client-server distributed serving binaries. Battle-tested within Microsoft's global infrastructure, it delivers industrial-grade scalability for enterprise RAG, search engines, and multi-modal recommendation systems.
