Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can the project support Vector stores that i can run and store locally? e.g: ChromaDB. #38

Closed
krishnakiran opened this issue Jul 13, 2023 · 9 comments
Labels
enhancement New feature or request

Comments

@krishnakiran
Copy link

No description provided.

@HamaWhiteGG
Copy link
Owner

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?

@odysseaspenta
Copy link

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.

@HamaWhiteGG
Copy link
Owner

I need your contribution. You can fork the repository and then submit a pull request to the dev branch.

@krishnakiran
Copy link
Author

Yes. Milvus works. I would like to store the vector data in my local machine.

@michael19960921
Copy link

@HamaWhiteGG When will Milvus be able to support vector databases?

@odysseaspenta
Copy link

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.

HamaWhiteGG added a commit that referenced this issue Aug 4, 2023
@HamaWhiteGG HamaWhiteGG added the enhancement New feature or request label Aug 4, 2023
@HamaWhiteGG
Copy link
Owner

HamaWhiteGG commented Aug 4, 2023

@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

@michael19960921
Copy link

@HamaWhiteGG thanks

HamaWhiteGG added a commit that referenced this issue Aug 5, 2023
@krishnakiran
Copy link
Author

@HamaWhiteGG Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants