Varbase AI VDB: Milvus
The Varbase AI VDB: Milvus recipe connects the site to a Milvus vector database for AI search. Milvus can run inside the same DDEV project, on Zilliz Cloud, or on a server of your own.
It is one of two vector database recipes for Varbase AI Search Base. Apply one of them, not both.
Recipe Type
Varbase AI
Drupal.org Project
https://www.drupal.org/project/varbase_ai_vdb_milvus
What It Adds
Installs Key, AI, AI Search and the Milvus VDB Provider.
Creates a
milvus_api_keykey that reads theMILVUS_API_KEYenvironment variable.Points the provider at the Milvus server and port from the recipe inputs.
It does not create a search index. That is the job of Varbase AI Search Base.
Install-Time Inputs
server
MILVUS_SERVER, otherwise http://milvus
The Milvus address, with the scheme and without the port.
port
MILVUS_PORT, otherwise 19530
The REST port. Zilliz Cloud uses 443.
api_key
empty
The key that holds the token. Leave it empty for the local DDEV Milvus. Use milvus_api_key for a remote server.
Before You Apply
Apply Varbase AI Base first.
Have a Milvus 2.6 server. For local work, the recipe ships a DDEV service file.
Installation
Add the recipe with Composer, then apply it with Drush:
For a local Milvus in DDEV, add the service before applying the recipe:
This recipe does not change the site's default vector database. Make Milvus the default, so Varbase AI Search Base uses it:
Then create the varbase_ai_search database that Varbase AI Search Base uses:
Where Milvus Runs
MILVUS_SERVER
http://milvus (the default)
https://<cluster>.zillizcloud.com
https://milvus.example.com
MILVUS_PORT
19530 (the default)
443
19530, or 443 behind TLS
MILVUS_API_KEY
Not set
The Zilliz API token
root:<password>
api_key input
Empty (the default)
milvus_api_key
milvus_api_key
For a remote server, set the three variables in the environment of the web server, never in configuration. In DDEV, use web_environment in .ddev/config.local.yaml. Then apply with the key:
On a remote server, create the varbase_ai_search database the same way as in DDEV, at <server>:<port>/v2/vectordb/databases/create, with -H "Authorization: Bearer $MILVUS_API_KEY" when the server has authorization.
Zilliz Cloud: create a cluster, and copy its public endpoint and API token from the Zilliz console. Zilliz Cloud serverless has no database name to choose; enter any name, such as default.
Your own server: the DDEV service file is a working starting point. Before it faces anything else, turn on authorization (COMMON_SECURITY_AUTHORIZATIONENABLED: "true") and change the default root password. Publish only the REST port, behind a TLS reverse proxy that allows only the site's addresses.
Different Milvus per Environment
The recipe stores the server and port in configuration, which moves between environments. To use the DDEV Milvus locally and a remote one on the live site, read them from the environment in settings.php, which wins over stored configuration:
Known Limitations
Clearing a search index drops the collection from the default Milvus database, not from
varbase_ai_search, so old vectors can stay.A DDEV project that switches to the single-container Milvus service file starts with an empty Milvus. Create the
varbase_ai_searchdatabase again, then index the content again.
Last updated