Releases: Abhigyan126/Vector-Store
Releases · Abhigyan126/Vector-Store
Vector-Store
Vector-Store
A lightweight, disk-persistent vector storage and search service using KD-Trees. Built with Rust and Actix-web, providing efficient nearest neighbor search capabilities with automatic memory management.
Features
- 🚀 Fast nearest neighbor search using KD-Trees
- 💾 Disk persistence for large datasets
- 🔄 LRU-based memory management
- 🌲 Multiple independent trees support
- 🔌 RESTful API interface
- ⚙️ Configurable memory limits
Configuration
Create a .env file in the project root:
HOST=127.0.0.1
PORT=8080
MAX_MEMORY_MB=1024
BIN_DIRECTORY=binAPI Reference
Insert Vector
Adds a vector to a specified tree.
POST /insert?tree_name={tree_name}
Content-Type: application/json
# Request Body: Array of numbers representing the vector
[0.5, 0.3, 0.8]
# Response: 200 OK
"Point inserted into KD-Tree and saved to disk"Find Nearest Neighbors
Finds the n-nearest neighbors for a given vector.
POST /nearesttop?tree_name={tree_name}&n={number_of_neighbors}
Content-Type: application/json
# Request Body: Array of numbers representing the query vector
[0.5, 0.3, 0.8]
# Response: 200 OK
[
[0.51, 0.31, 0.79],
[0.49, 0.32, 0.81]
]Get Status
Retrieves the current status of all trees.
GET /status
# Response: 200 OK
{
"active_trees": 1,
"trees": [
{
"tree_name": "example_tree",
"num_records": 1000,
"in_memory": true,
"last_accessed": 60
}
]
}Error Codes
200: Success400: Invalid request404: Tree/points not found500: Internal server error