tree: b74bbf3dd144d5a0fee5d8ee48d478d37f6c573c
  1. i18n/
  2. go.mod
  3. go.sum
  4. info.yaml
  5. milvus.go
  6. README.md
  7. sync.go
vector-search-milvus/README.md

Apache Answer Plugin: Milvus Vector Search

This plugin enables semantic/vector search in Apache Answer using Milvus.

Prerequisites

  • Milvus 2.x instance (self-hosted or Zilliz Cloud)
  • An OpenAI-compatible embedding API (e.g., OpenAI, Azure OpenAI, or any compatible provider)

Installation

Build Apache Answer with this plugin:

./answer build --with github.com/apache/answer-plugins/vector-search-milvus

Configuration

After enabling the plugin in the Admin UI (Admin > Plugins > Vector Search), configure the following fields:

FieldDescriptionExample
Milvus EndpointMilvus gRPC endpointlocalhost:19530
Embedding API HostOpenAI-compatible API base URLhttps://api.openai.com
Embedding API KeyAPI key for the embedding servicesk-...
Embedding ModelModel name for generating embeddingstext-embedding-3-small
Embedding Levelquestion embeds question + all answers + comments together; answer embeds each answer separatelyquestion
Similarity ThresholdMinimum cosine similarity score (0-1). Default 0 means no filtering0.5

How It Works

  • Embedding dimensions are auto-detected from the configured model. No manual dimension configuration is needed.
  • On first configuration, the plugin creates a collection answer_vector_embeddings with VarChar fields and a FloatVector field.
  • An IvfFlat index with cosine metric is created on the embedding field.
  • If the embedding model changes and produces different dimensions, the collection is automatically dropped and recreated.
  • Upsert is implemented via delete-by-expression + insert (Milvus v2 pattern).
  • A full sync of all questions/answers is triggered when the plugin starts.

Running Milvus Locally

Using Docker Compose:

# Download the docker-compose file
wget https://github.com/milvus-io/milvus/releases/download/v2.4.0/milvus-standalone-docker-compose.yml -O docker-compose.yml

# Start Milvus
docker compose up -d

The default gRPC endpoint will be localhost:19530.

License

Apache License 2.0