百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

spheni

> 编程语言
开源

专注于内存效率的轻量级向量搜索库

187 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

专注于内存效率的轻量级向量搜索库

Spheni

A lightweight vector search library focused on memory-efficient approximate nearest neighbor search.

Index

  1. Overview
  2. Features
  3. Getting Started
  4. API Reference
  5. Benchmarks
  6. Roadmap
  7. References

Overview

The goal of Spheni is to be focused on memory efficiency rather than accuracy, and act a candidate generation system.

It implements inverted indexing and product quantization with residual encoding to reduce memory usage while supporting fast similarity search.

With Cohere 1M Embeddings, the current benchmark reports up to 213.9x compression (13.69 MB index at M=8) and up to 94.20% Recall@10-in-100 (M=64, nprobe=32), with the baseline at 80.1x compression and 83.25% Recall@10-in-100 (M=32, nprobe=32).

Features

  • Indexes: Flat, IVF, FlatPQ, IVF-PQ
  • Metrics: Cosine similarity, L2 distance
  • Operations: train, add, search

Getting Started

Build

Requirements:

  • CMake >= 3.15
  • A C++20 compiler (GCC/Clang)

Quick build

bash
chmod +x build.sh
./build.sh

After building, this repository produces build/libspheni.a. You only need the public header (include/spheni.h) and the static library (libspheni.a) to consume Spheni in another project.

Usage

bash
g++ -std=c++20 -O3 main.cpp -I /path/to/spheni/include /path/to/libspheni.a -o main

Example

Check out examples/ folder for more.

…

API Reference

Detailed public API documentation is available in docs/api-reference.md.

Benchmarks

Current Benchmark Report (single-core run, 200 queries, Recall@k-in-100).
Legacy Report is also available.

Roadmap

  • Implement save/load for seralized data
  • Implement multithreading with OpenMP wherever applicable
  • Implement OPQ (tough for me)
  • SIMD vectorizations

References

Papers

  1. FAISS: ArXiv Paper
  2. Near Neighbor Search in Large Metric Spaces
  3. The Binary Vector as the Basis of an Inverted Index File
  4. Product Quantization for Nearest Neighbour Search

Blogs

  1. A Bhayani - Product Quantization
  2. W Lin - Building a high recall vector database serving 1 billion embeddings from a single machine

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C++approximate-nearest-neighbor-searchinverted-indexproduct-quantization

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言