Implementing a VectorDB from scratch with Rust

Implementing a VectorDB from scratch with Rust

Archan Ganguly

5 месяцев назад

494 Просмотров

Short video on implementing a vector database from scratch using Rust and K-D tree and cosine similarity.

What is a K-D tree ? https://en.wikipedia.org/wiki/K-d_tree
Steps taken to build the vector db, code-named "gang_db":
1. Create struct for the vector having its coordinates
2. Create struct for the node of the K-D Tree
3. Create a K-D tree struct.
4. For simplicity, considered K=2
5. Constructed the k-d tree by alternating between the dimensions of the split axis, axis = depth % K, where k is the dimension.
6. Performed nearest neighbour search by traversing down the tree checking for cosine similarity for the query vector. Also, verifying the cosine value while unwinding the tree.

Github repo to be shared shortly along with a long form video
Ссылки и html тэги не поддерживаются


Комментарии: