Class MilvusVectorStore

java.lang.Object
com.google.genkit.plugins.milvus.MilvusVectorStore

public final class MilvusVectorStore extends Object
Milvus vector store backed by the Milvus v2 REST API.

Indexes documents into a Milvus collection (quick-setup mode: auto id, a vector field, dynamic text and metadata fields) and retrieves the nearest neighbors of a query embedding.

  • Constructor Details

    • MilvusVectorStore

      public MilvusVectorStore(String baseUrl, String token, MilvusCollectionConfig config, Embedder embedder)
      Creates a new store.
      Parameters:
      baseUrl - the Milvus server base URL (e.g. http://localhost:19530)
      token - the Milvus auth token, or null when the server requires none
      config - the collection configuration
      embedder - the embedder used to vectorize documents and queries
  • Method Details

    • retrieve

      public RetrieverResponse retrieve(ActionContext context, RetrieverRequest request)
      Retrieves documents similar to the query.
      Parameters:
      context - the action context
      request - the retriever request
      Returns:
      the retriever response with matching documents
    • index

      public IndexerResponse index(ActionContext context, IndexerRequest request)
      Indexes documents into the collection, generating an embedding for each.
      Parameters:
      context - the action context
      request - the indexer request
      Returns:
      the indexer response