vector-db-from-scratch

skyzhApache-2.0活跃维护

用 Rust 和 DataFusion 从零实现向量数据库,边写代码边学 HNSW、IVF 等近似最近邻检索原理,适合系统编程练手。

Learn vector search with Rust and DataFusion; the C++/BusTub track is deprecated.

暂无版本812star33fork同步于 2026-11-07 07:29 UTC

怎么上手

README 里没有找到可直接复制的安装命令

README 里没有找到可直接复制的安装命令,请到 README 或官方文档查看安装方式。

硬件要求按 README 说明

README 未说明

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用 Rust 和 DataFusion 从零实现内存向量数据库,理解向量检索如何变成数据库特性

用 Rust 和 DataFusion 从零实现向量数据库,边写代码边学 HNSW、IVF 等近似最近邻检索原理,适合系统编程练手。

核心能力

  • 基于 Arrow 构建内存表并编写安全的 DataFusion 优化器规则
  • 实现 IVFFlat、NSW、HNSW 与残差 IVF-PQ 四种索引
  • 提供建索引与对比查询计划的 SQL 命令
  • 在 SIFT1M 上统一评测召回率、构建时间与搜索延迟
  • 六天渐进式课程,每天配起始代码、测试与参考实现

容易踩的坑

C++/BusTub 版本已废弃且不再维护,应走 Rust 课程;需要具备基础 Rust,向量检索与 DataFusion 可零基础;仓库含 bustub-vectordb-starter 与 solution 子模块,需单独拉取且沿用各自上游许可

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Vector Database from Scratch — Build vector search, then use it from SQL

    Vector Database from Scratch

    Vector Database from Scratch is a hands-on course for systems and database engineers. Build a small in-memory vector database in Rust, compare approximate results with exact search, and use the resulting indexes from SQL through DataFusion.

    Read the course

    What You Will Build

    By the end of the course, your vector database will include:

    • an Arrow-backed in-memory table and a safe DataFusion optimizer rule;
    • IVFFlat, NSW, HNSW, and residual IVF-PQ indexes;
    • SQL commands for creating indexes and comparing query plans; and
    • a shared benchmark for recall, build time, and search latency on SIFT1M.

    The course focuses on the boundary where vector-search algorithms become database features. It covers the algorithms, evaluation contracts, query planning, and execution path instead of hiding them behind an HTTP API or ANN library.

    Course Structure

    The guided Rust course has six days. Each day adds one database or indexing capability, with starter code, focused tests, and a completed reference. The book contains the setup, checkpoint commands, SQL walkthroughs, and benchmark instructions.

    You need basic Rust, but you do not need prior knowledge of vector search or DataFusion.

    The original C++/BusTub edition remains online for existing readers, but it is deprecated and unmaintained.

    Community

    Join skyzh's Discord server to study with the Vector Database from Scratch community.

    Join skyzh's Discord Server

    License

    The code in this repository is licensed under the Apache License 2.0. The book, including its Markdown and figures, is licensed under CC BY-NC-SA 4.0.

    The bustub-vectordb-starter and bustub-vectordb-solution git submodules retain their own upstream license terms.