From 01bc7a40d44c3c6169ee885e8b50290406f97c1f Mon Sep 17 00:00:00 2001 From: nagi-17 <265831467+nagi-17@users.noreply.github.com> Date: Mon, 19 Oct 2026 23:27:35 +0530 Subject: [PATCH 1/2] feat(proto): add collection management RPCs --- crates/grpc/proto/vector-db.proto | 42 ++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/crates/grpc/proto/vector-db.proto b/crates/grpc/proto/vector-db.proto index 0b5dfe1..4c47704 100644 --- a/crates/grpc/proto/vector-db.proto +++ b/crates/grpc/proto/vector-db.proto @@ -22,13 +22,19 @@ service VectorDB { rpc SearchPoints(SearchRequest) returns (SearchResponse) {} rpc InsertVectorsBatch(InsertVectorsBatchRequest) returns (InsertVectorsBatchResponse) {} -rpc SearchPointsBatch(SearchPointsBatchRequest) returns (SearchPointsBatchResponse) {} + rpc SearchPointsBatch(SearchPointsBatchRequest) returns (SearchPointsBatchResponse) {} + + rpc CreateCollection(CreateCollectionRequest) returns (CollectionInfo) {} + rpc GetCollection(CollectionName) returns (CollectionInfo) {} + rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse) {} + rpc DeleteCollection(CollectionName) returns (google.protobuf.Empty) {} } message InsertVectorRequest { DenseVector vector = 1; Payload payload = 2; + string collection = 3; } @@ -37,6 +43,7 @@ message SearchRequest { Similarity similarity = 2; uint64 limit = 3; uint64 ef = 4; + string collection = 5; } @@ -56,6 +63,7 @@ message Point { message PointID { UUID id = 1; + string collection = 2; } enum Similarity{ @@ -77,6 +85,7 @@ message Payload { message InsertVectorsBatchRequest { repeated InsertVectorRequest vectors = 1; + string collection = 2; } message InsertVectorsBatchResponse { @@ -85,8 +94,39 @@ message InsertVectorsBatchResponse { message SearchPointsBatchRequest { repeated SearchRequest queries = 1; + string collection = 2; } message SearchPointsBatchResponse { repeated SearchResponse results = 1; } + +enum IndexType { + Flat = 0; + KDTree = 1; + HNSW = 2; +} + +message CreateCollectionRequest { + string name = 1; + uint64 dimension = 2; + Similarity similarity = 3; + IndexType index_type = 4; +} + +message CollectionInfo { + string name = 1; + uint64 dimension = 2; + Similarity similarity = 3; + IndexType index_type = 4; +} + +message CollectionName { + string name = 1; +} + +message ListCollectionsRequest {} + +message ListCollectionsResponse { + repeated CollectionInfo collections = 1; +} \ No newline at end of file From a3a8a051c76c3434e680be4be2c0772ca6ec802e Mon Sep 17 00:00:00 2001 From: nagi-17 <265831467+nagi-17@users.noreply.github.com> Date: Thu, 22 Oct 2026 16:50:23 +0530 Subject: [PATCH 2/2] fix(proto): remove redundant message --- crates/grpc/proto/vector-db.proto | 42 +++++++++++++------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/crates/grpc/proto/vector-db.proto b/crates/grpc/proto/vector-db.proto index 4c47704..81fa711 100644 --- a/crates/grpc/proto/vector-db.proto +++ b/crates/grpc/proto/vector-db.proto @@ -8,15 +8,19 @@ message UUID { string value = 1; } +message CollectionID { + string name = 1; +} + service VectorDB { //Insert a vector with a payload and return the assigned PointID rpc InsertVector(InsertVectorRequest) returns (PointID) {} - //Delete a vector by its PointID - rpc DeletePoint(PointID) returns (google.protobuf.Empty) {} + //Delete a vector by its PointID and CollectionID + rpc DeletePoint(PointReference) returns (google.protobuf.Empty) {} - //Get a vector and its payload by PointID - rpc GetPoint(PointID) returns (Point) {} + //Get a vector and its payload by PointID and CollectionID + rpc GetPoint(PointReference) returns (Point) {} //Search for the k nearest vectors to a target vector given a distance function rpc SearchPoints(SearchRequest) returns (SearchResponse) {} @@ -24,26 +28,30 @@ service VectorDB { rpc InsertVectorsBatch(InsertVectorsBatchRequest) returns (InsertVectorsBatchResponse) {} rpc SearchPointsBatch(SearchPointsBatchRequest) returns (SearchPointsBatchResponse) {} - rpc CreateCollection(CreateCollectionRequest) returns (CollectionInfo) {} - rpc GetCollection(CollectionName) returns (CollectionInfo) {} + rpc CreateCollection(CollectionInfo) returns (CollectionInfo) {} + rpc GetCollection(CollectionID) returns (CollectionInfo) {} rpc ListCollections(ListCollectionsRequest) returns (ListCollectionsResponse) {} - rpc DeleteCollection(CollectionName) returns (google.protobuf.Empty) {} + rpc DeleteCollection(CollectionID) returns (google.protobuf.Empty) {} } message InsertVectorRequest { DenseVector vector = 1; Payload payload = 2; - string collection = 3; + CollectionID collection_id = 3; } +message PointReference { + PointID id = 1; + CollectionID collection_id = 2; +} message SearchRequest { DenseVector query_vector = 1; Similarity similarity = 2; uint64 limit = 3; uint64 ef = 4; - string collection = 5; + CollectionID collection_id = 5; } @@ -63,7 +71,6 @@ message Point { message PointID { UUID id = 1; - string collection = 2; } enum Similarity{ @@ -85,7 +92,6 @@ message Payload { message InsertVectorsBatchRequest { repeated InsertVectorRequest vectors = 1; - string collection = 2; } message InsertVectorsBatchResponse { @@ -94,7 +100,6 @@ message InsertVectorsBatchResponse { message SearchPointsBatchRequest { repeated SearchRequest queries = 1; - string collection = 2; } message SearchPointsBatchResponse { @@ -107,24 +112,13 @@ enum IndexType { HNSW = 2; } -message CreateCollectionRequest { - string name = 1; - uint64 dimension = 2; - Similarity similarity = 3; - IndexType index_type = 4; -} - message CollectionInfo { - string name = 1; + CollectionID collection_id = 1; uint64 dimension = 2; Similarity similarity = 3; IndexType index_type = 4; } -message CollectionName { - string name = 1; -} - message ListCollectionsRequest {} message ListCollectionsResponse {