-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #173 from eraft-io/feature_20230610_vector
Feature 20230610 vector
- Loading branch information
Showing
21 changed files
with
2,923 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
## vdb-server RESP protocol for vector design | ||
|
||
### 1.Create a Vecset | ||
|
||
- Syntax | ||
``` | ||
VECSET ADD vecset_name vecset_size | ||
``` | ||
- Return | ||
vecset id | ||
|
||
### 2.Get a Vecset | ||
|
||
- Syntax | ||
``` | ||
VECSET GET vecset_name | ||
``` | ||
- Return | ||
|
||
Bulk string reply: | ||
|
||
``` | ||
vecset_size | ||
vec_count | ||
vecdata_disk_size | ||
vecdata_mem_size | ||
c_time | ||
``` | ||
|
||
### 3.Add Vecs to Vecset | ||
|
||
- Syntax | ||
``` | ||
VEC ADD vecset_name vector_data vector_label [vector_data vector_label ...] | ||
``` | ||
|
||
- Return | ||
The status of the add operation. | ||
|
||
### 4.Search from a vecset | ||
|
||
-Syntax | ||
``` | ||
VEC SEARCH vecset_name vector_data DESC count | ||
``` | ||
- Return | ||
|
||
search result vector data similar with | ||
vector_data. | ||
|
||
``` | ||
vec_id score vec_label [vec_id score vec_label ...] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
## sys_catalog | ||
|
||
key encode | ||
``` | ||
------------------------------------------------------------------- | ||
| 'S' | 'Y' | 'S' | '_' | 'C' | 'A' | 'T' | 'A' | 'L' | 'O' | 'G' | | ||
------------------------------------------------------------------- | ||
``` | ||
value encode | ||
``` | ||
-------------------------------- | ||
| SysCatalog protobuf message | | ||
-------------------------------- | ||
``` | ||
|
||
- SysCatalog message | ||
``` | ||
{ | ||
uint64 vecset_count | ||
uint64 max_vecset_id | ||
uint64 mem_used | ||
uint64 disk_used | ||
map<string, uint64> vecset_name2id | ||
} | ||
``` | ||
|
||
## vecset | ||
|
||
``` | ||
key encode | ||
--------------------------------------------------- | ||
| 'V' | 'E' | 'C' | 'S' | 'E' | 'T' | ID(uint64) | | ||
--------------------------------------------------- | ||
value encode | ||
---------------------------- | ||
| Vecset protobuf message | | ||
---------------------------- | ||
``` | ||
|
||
- Vecset protobuf message | ||
|
||
``` | ||
{ | ||
uint64_t id | ||
bytes name | ||
uint64_t vec_count | ||
uint64_t max_vec_id | ||
uint64_t used_disk_capacity | ||
uint64_t used_mem_capacity | ||
uint64_t c_time | ||
uint64_t m_time | ||
} | ||
``` | ||
|
||
## vec | ||
|
||
``` | ||
key encode | ||
---------------------------------------------------------------------------- | ||
| 'V' | 'E' | 'C' | 'T' | 'O' | 'R' | VECSET_ID(uint64) | VEC_ID(uint64) | | ||
---------------------------------------------------------------------------- | ||
value encode | ||
------------------------ | ||
| Vec protobuf message | | ||
------------------------ | ||
``` | ||
|
||
- Vec protobuf message | ||
|
||
``` | ||
{ | ||
uint64_t id | ||
uint64_t dim | ||
repeated double vdata | ||
bytes vlabel | ||
uint64_t c_time | ||
uint64_t m_time | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
https://colab.research.google.com/drive/1OLdDYk-TzVNhpyL3pAONtkHnKGI-GUsU?usp=sharing#scrollTo=420dPmKH8sTi | ||
|
||
https://medium.com/swlh/fine-grained-image-similarity-detection-using-facebook-ai-similarity-search-faiss-b357da4f1644 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.