Closed krishnakiran closed 1 year ago
I could take a crack at writing and contributing this integration if it would help. I was already looking into this and possibly OpenSearch as well for storing vectors.
I need your contribution. You can fork the repository and then submit a pull request to the dev branch.
Yes. Milvus works. I would like to store the vector data in my local machine.
@HamaWhiteGG When will Milvus be able to support vector databases?
I am making good progress on this but I will probably need a couple of more weeks. I don't have a lot of time to work on it.
@krishnakiran @odysseaspenta @michael19960921 I have supported Milvus, and you can see MilvusExample.
public static void main(String[] args) {
var filePath = "docs/extras/modules/state_of_the_union.txt";
var loader = new TextLoader(filePath);
var documents = loader.load();
var textSplitter = CharacterTextSplitter.builder().chunkSize(1000).chunkOverlap(0).build();
var docs = textSplitter.splitDocuments(documents);
var embeddings = OpenAIEmbeddings.builder().requestTimeout(60).build().init();
ConnectParam connectParam = ConnectParam.newBuilder()
.withHost("127.0.0.1")
.withPort(19530)
.build();
Milvus milvus = Milvus.builder()
.embeddingFunction(embeddings)
.connectParam(connectParam)
.collectionName("LangChainCollection_1")
.build().init();
milvus.fromDocuments(docs, embeddings);
var query = "What did the president say about Ketanji Brown Jackson";
docs = milvus.similaritySearch(query);
var pageContent = docs.get(0).getPageContent();
println(pageContent);
var llm = OpenAI.builder().temperature(0).requestTimeout(30).build().init();
var qa = RetrievalQa.fromChainType(llm, STUFF, milvus.asRetriever());
var result = qa.run(query);
println(result);
}
See the following documentation for how to run a Milvus install_standalone-docker
@HamaWhiteGG thanks
@HamaWhiteGG Thanks
ChromaDB, I couldn't find the Java SDK. What do you think about Milvus? It can be installed locally with Docker and provides a Java SDK. Can it meet your requirements?