From da8fd31776753ad6c16c80ff6b90e3a66f10189f Mon Sep 17 00:00:00 2001 From: Adesh Gupta Date: Thu, 18 Dec 2025 21:37:45 +0000 Subject: [PATCH] Fix clippy and cleanup --- .env => .env.example | 0 Dockerfile | 6 ------ crates/api/src/lib.rs | 8 ++------ crates/storage/src/in_memory.rs | 8 ++------ crates/storage/src/lib.rs | 8 +++----- crates/storage/src/rocks_db.rs | 8 ++------ docker-compose.yml | 6 ------ tasks.md | 29 ----------------------------- 8 files changed, 9 insertions(+), 64 deletions(-) rename .env => .env.example (100%) delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml delete mode 100644 tasks.md diff --git a/.env b/.env.example similarity index 100% rename from .env rename to .env.example diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index a95a936..0000000 --- a/Dockerfile +++ /dev/null @@ -1,6 +0,0 @@ -FROM ubuntu:18.04 - -RUN apt-get update -y -RUN apt-get install zlib1g-dev libbz2-dev libsnappy-dev git -y -RUN git clone https://github.com/facebook/rocksdb.git -RUN cd rocksdb; USE_RTTI=1 CFLAGS=-fPIC make static_lib; INSTALL_PATH=/usr make install make install; cd .. diff --git a/crates/api/src/lib.rs b/crates/api/src/lib.rs index 85966ca..f190682 100644 --- a/crates/api/src/lib.rs +++ b/crates/api/src/lib.rs @@ -8,7 +8,7 @@ use std::sync::{Arc, RwLock}; use index::flat::FlatIndex; use index::{IndexType, VectorIndex}; use storage::rocks_db::RocksDbStorage; -use storage::{StorageEngine, StorageType}; +use storage::{StorageEngine, StorageType, VectorPage}; use uuid::Uuid; @@ -101,11 +101,7 @@ impl VectorDb { Ok(vectors) } - pub fn list( - &self, - offset: PointId, - limit: usize, - ) -> Result, PointId)>, DbError> { + pub fn list(&self, offset: PointId, limit: usize) -> Result, DbError> { self.storage.list_vectors(offset, limit) } diff --git a/crates/storage/src/in_memory.rs b/crates/storage/src/in_memory.rs index cc6a716..5190082 100644 --- a/crates/storage/src/in_memory.rs +++ b/crates/storage/src/in_memory.rs @@ -1,4 +1,4 @@ -use crate::StorageEngine; +use crate::{StorageEngine, VectorPage}; use defs::{DbError, DenseVector, Payload, PointId}; pub struct MemoryStorage { @@ -38,11 +38,7 @@ impl StorageEngine for MemoryStorage { fn get_vector(&self, _id: PointId) -> Result, DbError> { Ok(None) } - fn list_vectors( - &self, - _offset: PointId, - _limit: usize, - ) -> Result, PointId)>, DbError> { + fn list_vectors(&self, _offset: PointId, _limit: usize) -> Result, DbError> { Ok(None) } } diff --git a/crates/storage/src/lib.rs b/crates/storage/src/lib.rs index 8924b0b..47ed2c7 100644 --- a/crates/storage/src/lib.rs +++ b/crates/storage/src/lib.rs @@ -4,6 +4,8 @@ use std::sync::Arc; use crate::rocks_db::RocksDbStorage; +pub type VectorPage = (Vec<(PointId, DenseVector)>, PointId); + pub trait StorageEngine: Send + Sync { fn insert_point( &self, @@ -15,11 +17,7 @@ pub trait StorageEngine: Send + Sync { fn get_payload(&self, id: PointId) -> Result, DbError>; fn delete_point(&self, id: PointId) -> Result<(), DbError>; fn contains_point(&self, id: PointId) -> Result; - fn list_vectors( - &self, - offset: PointId, - limit: usize, - ) -> Result, PointId)>, DbError>; + fn list_vectors(&self, offset: PointId, limit: usize) -> Result, DbError>; } pub mod in_memory; diff --git a/crates/storage/src/rocks_db.rs b/crates/storage/src/rocks_db.rs index a86ad79..dbdad6e 100644 --- a/crates/storage/src/rocks_db.rs +++ b/crates/storage/src/rocks_db.rs @@ -1,6 +1,6 @@ // Rewrite needed -use crate::StorageEngine; +use crate::{StorageEngine, VectorPage}; use bincode::{deserialize, serialize}; use defs::{DbError, DenseVector, Payload, Point, PointId}; use rocksdb::{Error, Options, DB}; @@ -122,11 +122,7 @@ impl StorageEngine for RocksDbStorage { Ok(value.vector) } - fn list_vectors( - &self, - offset: PointId, - limit: usize, - ) -> Result, PointId)>, DbError> { + fn list_vectors(&self, offset: PointId, limit: usize) -> Result, DbError> { if limit < 1 { return Ok(None); } diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 414140c..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,6 +0,0 @@ -version: '3.4' -services: - t2v-transformers: - image: semitechnologies/transformers-inference:distilbert-base-uncased-1.1.0 - ports: - - "8000:8080" \ No newline at end of file diff --git a/tasks.md b/tasks.md deleted file mode 100644 index 2382ed3..0000000 --- a/tasks.md +++ /dev/null @@ -1,29 +0,0 @@ -- [ ] Frontend - - [ ] Finalize framework - - [ ] Define screens (concrete wireframes) - - [ ] Develop them -- [ ] Refactor Code - - [ ] Change the directory structure - - [ ] Code architecture - - [ ] Define proper types - - [ ] Define proper traits - - [ ] Make it run end to end (this includes) - - [ ] From the CLI/API/SDK - - [ ] Call the external vectorizer s.mdervice - - [ ] Pass embeddings through the processes/services via protobufs - - [ ] Data should be stored in rocksdb (embedding and original data) -- [ ] Additional Tasks - - [ ] Implement better indexing algorithms - - [ ] Endpoints - - [ ] gRPC - - [ ] REST - - [ ] PCA - - [ ] Final Design and implementation - - - -### Short term tasks -- [ ] Implement Storage Engine trait for RocksdbStorage and also implement RocksdbStorage -- [ ] KD Tree refactor according to new architechure -- [ ] Write a mock API for the project (will be volatile) -- [ ] Implement in memory - LSM tree, ACID