You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SimpleVectorStore now saves store to file with JSON string format. But logic to convert store to JSON string is private and not exposed.
I have a requirement to save smallSimpleVectorStore into a database table column as a JSON string, instead of storing it into a file. So, I create a new class, and copy JSON format logic from SimpleVectorStore.
Current Behavior
Currently, here is what I'm doing:
classMySimpleVectorStoreextendsSimpleVectorStore {
publicStringtoJSONString() {
// copy what getVectorDbAsJson() from SimpleVectorStore
}
publicvoidfromJSONString(StringjsonString) {
// copy logic from load(File file), with ObjectMapper.readValue(jsonString, typeRef) instead of file.
}
}
This approach has multiple issues:
Recreating mutable internal states for parent class SimpleVectorStore
Duplicated code logic
Context
Propose to expose JSON string related feature out of SimpleVectorStore. Something like:
classSimpleVectorStore {
publicStringtoJSONString() {
returnthis.getVectorDbAsJson();
}
publicvoidfromJSONString(StringjsonString) {
// very similar to save(File) method// may consider refactor save(File) feature together with this one.
}
}
To have this design:
The serialized JSON string format, shared with today's file content format. So it's compatibility related concerns should be discussed there.
The proposed design, will open up creative ways to persistent and transfer small VectorStores:
as JSON string and save into database if VectorStore is small
as a binary or string value stored in Redis
persist via socket
Alternative aproaches:
First save to file and then read from file to database
The text was updated successfully, but these errors were encountered:
SimpleVectorStore
now saves store to file with JSON string format. But logic to convert store to JSON string is private and not exposed.I have a requirement to save small
SimpleVectorStore
into a database table column as a JSON string, instead of storing it into a file. So, I create a new class, and copy JSON format logic from SimpleVectorStore.Current Behavior
Currently, here is what I'm doing:
This approach has multiple issues:
Context
Propose to expose JSON string related feature out of SimpleVectorStore. Something like:
To have this design:
The proposed design, will open up creative ways to persistent and transfer small VectorStores:
Alternative aproaches:
The text was updated successfully, but these errors were encountered: