vecdb
v1.7
매우 간단한 벡터 임베딩 데이터베이스는 검색중인 항목과 유사한 항목을 찾을 수있는 해시 테이블이라고 말할 수 있습니다.
저는 데이터베이스 애호가이며, 이것은 제작에 사용될 수있는 재미 있고 학습 프로젝트를위한 것입니다.).
추신 : 여가 시간에 여가 시간에 바퀴를 다시 발명하는 것을 좋아합니다. 왜냐하면 그것은 자유 시간이기 때문입니다!
{key => value}모델을 사용하고 있습니다.
key항목을 나타내는 고유 한 값이어야합니다.value벡터 자체 (플로트 목록) 여야합니다.
기본적으로
vecdb현재 작업 디렉토리에서config.yml검색합니다. 그러나 자신의 사용자 정의 파일 경로를 제공하여--config /path/to/config.yml플래그를 사용하여이를 재정의 할 수 있습니다.
# http server related configs
server :
# the address to listen on in the form of '[host]:port'
listen : " 0.0.0.0:3000 "
# storage related configs
store :
# the driver you want to use
# currently vecdb supports "bolt" which is based on boltdb the in process embedded the database
driver : " bolt "
# the arguments required by the driver
# for bolt, it requires a key called `database` points to the path you want to store the data in.
args :
database : " ./vec.db "
# embeddings related configs
embedder :
# whether to enable the embedder and all endpoints using it or not
enabled : true
# the driver you want to use, currently vecdb supports gemini
driver : gemini
# the arguments required by the driver
# currently gemini driver requires `api_key` and `text_embedding_model`
args :
# by default vecdb will replace anything between ${..} with the actual value from the ENV var
api_key : " ${GEMINI_API_KEY} "
text_embedding_model : " text-embedding-004 "POST /v1/vectors/write 로 보내십시오.POST /v1/vectors/search 에 보내고 코사인 유사성으로 주문한 모든 유사한 벡터의 키/ID를 내려 오는 순서로 나열하려고합니다.POST /v1/embeddings/text/write 에 텍스트를 보내고 vecdb 구성된 임베더 (현재 Gemini)를 사용하여 벡터를 빌드하고 저장하기를 원합니다.POST /v1/embeddings/text/search 으로 보내십시오. vecdb 벡터를 구축하고 내림차순으로 코사인 유사성으로 주문한 유사한 벡터 키를 검색하려고합니다. {
"bucket" : "BUCKET_NAME" , // consider it a collection or a table
"key" : "product-id-1" , // should be unique and represents a valid value in your main data store (example: the row id in your mysql/postgres ... etc)
"vector" : [ 1.929292 , 0.3848484 , - 1.9383838383 , ... ] // the vector you want to store
} {
"bucket" : "BUCKET_NAME" , // consider it a collection or a table
"vector" : [ 1.929292 , 0.3848484 , - 1.9383838383 , ... ] , // you will get a list ordered by cosine-similarity in descending order
"min_cosine_similarity" : 0.0 , // the more you increase, the fewer data you will get
"max_result_count" : 10 // max vectors to return (vecdb will first order by cosine similarity then apply the limit)
}
embedder.enabledtrue로 설정 한 경우.
{
"bucket" : "BUCKET_NAME" , // consider it a collection or a table
"key" : "product-id-1" , // should be unique and represents a valid value in your main data store (example: the row id in your mysql/postgres ... etc)
"content" : "This is some text representing the product" // this will be converted to a vector using the configured embedder
}
embedder.enabledtrue로 설정 한 경우.
{
"bucket" : "BUCKET_NAME" , // consider it a collection or a table
"content" : "A Product Text" , // you will get a list ordered by cosine-similarity in descending order
"min_cosine_similarity" : 0.0 , // the more you increase, the fewer data you will get
"max_result_count" : 10 // max vectors to return (vecdb will first order by cosine similarity then apply the limit)
}