How to enable the Vector Knowledge Base
The Vector Knowledge Base is an extension module of this product. It provides vector retrieval and semantic search capabilities for worksheets. You can enable it as needed.
⚠️ Note: The Vector Knowledge Base feature requires a "Super Search" license. Without this license, you still cannot create a knowledge base after deployment.
Environment Requirements
Before enabling this feature, make sure the server meets the following requirements (dedicated deployment is strongly recommended):
Milvus standalone mode includes three components:
Milvus,MinIO, andetcd. Total memory usage is about 6-8 GB. Do not enable this feature on servers with less than 8 GB available memory.
| Component | Minimum Requirement | Recommended |
|---|---|---|
| Docker | 20.10.16 or later | - |
| CPU | 4 cores (supports SSE4.2 / AVX) | 4+ cores |
| Available Memory | 8 GB | 16 GB+ |
| Disk | SATA SSD | NVMe SSD |
Deploy Milvus
Milvus can be deployed on a dedicated server or merged into the HAP deployment, depending on server resources and operations requirements.
Option 1: Milvus Dedicated Server Deployment
Use this option when you have a dedicated server or want to maintain the vector database separately from the HAP main service.
Install Docker and Docker Compose
-
Install Docker
- Linux amd64
- Linux arm64
Install Docker by referring to the official Linux installation guide or the Docker installation section in the deployment example.
Install Docker by referring to the official Linux installation guide or the Docker installation section in the deployment example.
-
Download the Docker Compose binary
- Linux amd64
- Linux arm64
wget https://pdpublic.mingdao.com/private-deployment/offline/common/docker-compose-linux-x86_64wget https://pdpublic.mingdao.com/private-deployment/offline/common/arm64/docker-compose-linux-aarch64 -
Move the binary to the executable path
- Linux amd64
- Linux arm64
mv docker-compose-linux-x86_64 /usr/local/bin/docker-composemv docker-compose-linux-aarch64 /usr/local/bin/docker-compose -
Add executable permission
chmod +x /usr/local/bin/docker-compose
Deploy Milvus
-
Pull images (Offline package download)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-etcd:v3.5.25
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-milvus:v2.6.14 -
Create data directories
Define the Milvus deployment path. The following example uses
/data/mingdao/script.mkdir -p /data/mingdao/scriptCreate the required data mount directories under the deployment path.
cd /data/mingdao/script
mkdir -p ./volume/data/milvus/{etcd,minio,data} -
Create
milvus.yamlunder the deployment pathversion: "3.5"
services:
etcd:
container_name: milvus-etcd
restart: always
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-etcd:v3.5.25
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ./volume/data/milvus/etcd:/etcd
command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
minio:
container_name: milvus-minio
restart: always
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- ./volume/data/milvus/minio:/minio_data
command: minio server /minio_data --console-address ":9001"
milvus:
container_name: milvus-standalone
restart: always
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-milvus:v2.6.14
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
MINIO_ACCESS_KEY_ID: minioadmin
MINIO_SECRET_ACCESS_KEY: minioadmin
MINIO_BUCKET_NAME: mdmilvus
COMMON_SECURITY_AUTHORIZATIONENABLED: "true"
MQ_TYPE: woodpecker
volumes:
- ./volume/data/milvus/data:/var/lib/milvus
ports:
- 19530:19530
depends_on:
- etcd
- minioReuse an existing MinIO service (optional)
If a MinIO service already exists in this product deployment, Milvus can reuse it without deploying another MinIO service:
- Remove the
minioservice definition fromdocker-compose.yaml - Remove
- miniofromdepends_onin themilvusservice - Update the following environment variables in the
milvusservice:MINIO_ADDRESS: change it to the existing MinIO service address, for example192.168.1.100:9000MINIO_ACCESS_KEY_ID: change it to the existing MinIO Access KeyMINIO_SECRET_ACCESS_KEY: change it to the existing MinIO Secret KeyMINIO_BUCKET_NAME: it is recommended to keepmdmilvus; Milvus will create it automatically
- Remove the
-
Start services
docker-compose -f milvus.yaml up -dTo stop the Milvus service later, run:
docker-compose -f milvus.yaml down -
Change the default Milvus password (required)
Default Milvus account:
- Username:
root - Password:
Milvus
You must change the default password after the first startup. When running the following command, replace
your_passwordwith the actual password and keep it safe.docker exec -it milvus-standalone bash
TOKEN=$(echo -n 'root:Milvus' | base64 -w0)
curl -s -X POST 'http://localhost:19530/v2/vectordb/users/update_password' \
-H 'Content-Type: application/json' \
-H "Authorization: Basic $TOKEN" \
-d '{"userName": "root", "password": "Milvus", "newPassword": "your_password"}'A response of
{"code":0,"data":{}}indicates success. - Username:
Option 2: Merge Milvus into HAP Deployment
This option deploys Milvus-related components on the same server as HAP. Make sure the server has enough free resources. If you use this option, the minimum recommended server specification is 16C 64G, and the data disk must be an SSD.
Deploy Milvus
-
Pull images (Offline package download)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-etcd:v3.5.25
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-milvus:v2.6.14 -
Create data mount directories
mkdir -p /data/mingdao/script/volume/data/milvus/{etcd,minio,data} -
Run the following command and check whether the output contains a line with the keyword
start miniodocker logs $(docker ps | grep mingdaoyun-sc | awk '{print $1}') | grep minio- With output
- No output
Edit the HAP service
docker-compose.yamlfile. The default path is/data/mingdao/script/docker-compose.yaml. Add the following services:etcd:
container_name: milvus-etcd
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-etcd:v3.5.25
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ./volume/data/milvus/etcd:/etcd
command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
milvus:
container_name: milvus-standalone
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-milvus:v2.6.14
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: sc:9010
MINIO_ACCESS_KEY_ID: mdstorage
MINIO_SECRET_ACCESS_KEY: eBxExGQJNhGosgv5FQJiVNqH
MINIO_BUCKET_NAME: mdmilvus
COMMON_SECURITY_AUTHORIZATIONENABLED: "true"
MQ_TYPE: woodpecker
volumes:
- ./volume/data/milvus/data:/var/lib/milvus
depends_on:
- etcdEdit the HAP service
docker-compose.yamlfile. The default path is/data/mingdao/script/docker-compose.yaml. Add the following services:etcd:
container_name: milvus-etcd
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-etcd:v3.5.25
environment:
- ETCD_AUTO_COMPACTION_MODE=revision
- ETCD_AUTO_COMPACTION_RETENTION=1000
- ETCD_QUOTA_BACKEND_BYTES=4294967296
- ETCD_SNAPSHOT_COUNT=50000
volumes:
- ./volume/data/milvus/etcd:/etcd
command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
minio:
container_name: milvus-minio
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-minio:RELEASE.2025-04-22T22-12-26Z
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- ./volume/data/milvus/minio:/minio_data
command: minio server /minio_data --console-address ":9001"
milvus:
container_name: milvus-standalone
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-milvus:v2.6.14
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
MINIO_ACCESS_KEY_ID: minioadmin
MINIO_SECRET_ACCESS_KEY: minioadmin
MINIO_BUCKET_NAME: mdmilvus
COMMON_SECURITY_AUTHORIZATIONENABLED: "true"
MQ_TYPE: woodpecker
volumes:
- ./volume/data/milvus/data:/var/lib/milvus
depends_on:
- etcd
- minio -
Restart HAP services
bash ./service.sh restartall -
Change the default Milvus password (required)
Default Milvus account:
- Username:
root - Password:
Milvus
You must change the default password after the first startup. When running the following command, replace
your_passwordwith the actual password and keep it safe.docker exec -it milvus-standalone bash
TOKEN=$(echo -n 'root:Milvus' | base64 -w0)
curl -s -X POST 'http://localhost:19530/v2/vectordb/users/update_password' \
-H 'Content-Type: application/json' \
-H "Authorization: Basic $TOKEN" \
-d '{"userName": "root", "password": "Milvus", "newPassword": "your_password"}'A response of
{"code":0,"data":{}}indicates success. - Username:
Integrate with the HAP Main Service
After completing either Milvus deployment option, integrate the RAG service with the HAP main service.
-
Pull the RAG service image on the HAP server (Offline package download)
docker pull registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-rag:1.0.0 -
Add the RAG service
Append the following to the HAP main service
docker-compose.yaml:rag:
image: registry.cn-hangzhou.aliyuncs.com/mdpublic/mingdaoyun-rag:1.0.0
environment:
<<: *app-environment -
Add environment variables
Add the following environment variables under the
appservice in the HAP main servicedocker-compose.yaml. Select the configuration based on the Milvus deployment option:- Milvus Dedicated Server Deployment
- Merge Milvus into HAP Deployment
app:
environment:
ENV_RAG_ENABLE: "true"
ENV_MILVUS_URL: "http://{Milvus internal IP}:19530"
ENV_MILVUS_DATABASE: "default"
ENV_MILVUS_USERNAME: "root"
ENV_MILVUS_PASSWORD: "your_password"app:
environment:
ENV_RAG_ENABLE: "true"
ENV_MILVUS_URL: "http://milvus:19530"
ENV_MILVUS_DATABASE: "default"
ENV_MILVUS_USERNAME: "root"
ENV_MILVUS_PASSWORD: "your_password"Change the
ENV_MILVUS_PASSWORDenvironment variable to the custom Milvus password configured earlier. -
Run
bash ./service.sh restartallin the manager root directory to restart services, and wait until the command completes.