Giter VIP home page Giter VIP logo

Comments (9)

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

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?

from langchain-java.

odysseaspenta avatar odysseaspenta commented on August 9, 2024

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.

from langchain-java.

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

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

from langchain-java.

krishnakiran avatar krishnakiran commented on August 9, 2024

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

from langchain-java.

michael19960921 avatar michael19960921 commented on August 9, 2024

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

from langchain-java.

odysseaspenta avatar odysseaspenta commented on August 9, 2024

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.

from langchain-java.

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

@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

from langchain-java.

michael19960921 avatar michael19960921 commented on August 9, 2024

@HamaWhiteGG thanks

from langchain-java.

krishnakiran avatar krishnakiran commented on August 9, 2024

@HamaWhiteGG Thanks

from langchain-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.