Get Started#
This guide provides step-by-step instructions to quickly deploy and test the Vector Retriever microservice.
Prerequisites#
Before you begin, confirm the following:
System Requirements: Your system meets the minimum requirements.
Docker Installed: Install Docker if needed. See Get Docker.
Embedding Service Plan: Use the local Multimodal Embedding Serving (MME) overlay started by
setup.sh, or provide an externalEMBEDDINGS_ENDPOINT.
This guide assumes basic familiarity with Docker commands and terminal usage. If you are new to Docker, see Docker Documentation for an introduction.
Environment Variables#
The table below lists the core configuration knobs. setup.sh seeds defaults, but you can override them before sourcing the script.
Core variables:
Variable |
Required |
Default |
Description |
|---|---|---|---|
|
No |
|
Backend flavor: |
|
No |
|
VSS-style embedding endpoint name used by |
|
No |
value of |
Runtime embedding API endpoint consumed by the retriever service. |
|
Yes |
(empty) |
Embedding model name sent to embedding API. |
|
No |
|
Vector collection/index name. |
|
No |
|
Default |
|
No |
|
Maximum allowed |
|
No |
|
Host port published by Docker Compose. |
|
No |
|
Log level passed into the container as |
Available backend-specific variables (you only need to set the ones for your chosen backend):
Variable |
Required |
Default |
|---|---|---|
|
Yes for |
|
|
Yes for |
|
|
No |
|
|
No |
|
Variable |
Required |
Default |
|---|---|---|
|
Yes for |
|
|
No |
(empty) |
|
No |
(empty) |
|
No |
|
|
No |
|
Variable |
Required |
Default |
|---|---|---|
|
Yes for |
|
Variable |
Required |
Default |
|---|---|---|
|
No |
(empty) |
MME embedding backend (used by all overlays):
Variable |
Required |
Default |
|---|---|---|
|
Yes |
(empty) |
|
No |
|
|
No |
|
|
No |
|
|
No |
|
|
No |
|
|
No |
|
Set Environment Values#
Set the required environment variables before launching the service.
export RETRIEVER_BACKEND=vdms
export EMBEDDING_MODEL_NAME="CLIP/clip-vit-b-32"
# Optional when using an external embedding service instead of the local MME overlay:
# export EMBEDDINGS_ENDPOINT=http://<embedding-service-host>:<port>/embeddings
export RETRIEVER_BACKEND=milvus
export EMBEDDING_MODEL_NAME="CLIP/clip-vit-b-32"
# Optional when using an external embedding service instead of the local MME overlay:
# export EMBEDDINGS_ENDPOINT=http://<embedding-service-host>:<port>/embeddings
export RETRIEVER_BACKEND=pgvector
export EMBEDDING_MODEL_NAME="CLIP/clip-vit-b-32"
# Optional when using an external embedding service instead of the local MME overlay:
# export EMBEDDINGS_ENDPOINT=http://<embedding-service-host>:<port>/embeddings
export RETRIEVER_BACKEND=faiss
export EMBEDDING_MODEL_NAME="CLIP/clip-vit-b-32"
# Optional when using an external embedding service instead of the local MME overlay:
# export EMBEDDINGS_ENDPOINT=http://<embedding-service-host>:<port>/embeddings
Note: For valid
EMBEDDING_MODEL_NAMEvalues, see the Multi Modal Embedding (MME) supported models list: Supported Models.
RETRIEVER_BACKEND supports the following values: vdms, milvus, pgvector, and faiss.
setup.sh defaults EMBEDDINGS_ENDPOINT to the local MME overlay unless you override it.
Configure the registry#
export REGISTRY_URL=intel
export TAG=latest
Optional Environment Variables#
The microservice supports additional optional variables to tune filters, limits, backend connectivity, and logging.
Quick Configuration Examples:
# Default VDMS backend
export RETRIEVER_BACKEND=vdms
export VDMS_VDB_HOST=vdms-vector-db
export VDMS_VDB_PORT=55555
# Milvus backend
export RETRIEVER_BACKEND=milvus
export MILVUS_URI=http://milvus-server:19530
# PGVector backend
export RETRIEVER_BACKEND=pgvector
export PGVECTOR_CONNECTION_STRING=postgresql+psycopg://user:pass@host:5432/db
# FAISS backend (optional persisted local index)
export RETRIEVER_BACKEND=faiss
export FAISS_INDEX_PATH=./data/faiss_index
Key Environment Variables:
DEFAULT_TOP_K: Default top-k returned when request omits
top_k.MAX_TOP_K: Maximum top-k allowed by request validation.
VECTOR_RETRIEVER_HOST_PORT: Host port used to expose service (default
6008).VECTOR_RETRIEVER_LOG_LEVEL: Runtime logging level.
time_filter is applied to the created_at metadata field. For time filtering on any other field, use where with gt, gte, lt, lte, or between.
Set the environment variables#
Set the environment with default values by running the command below. Run this again whenever environment values change.
source setup.sh --nosetup
Start the Service#
Use setup.sh as the recommended default startup path. It validates required environment variables, renders .env, selects the backend compose overlay, and starts the stack.
You can build the Docker image or pull a prebuilt image from the configured registry and tag.
Start using RETRIEVER_BACKEND#
export RETRIEVER_BACKEND=vdms
source setup.sh
export RETRIEVER_BACKEND=milvus
source setup.sh
export RETRIEVER_BACKEND=pgvector
source setup.sh
export RETRIEVER_BACKEND=faiss
source setup.sh
Start with one-shot backend flags#
Each one-shot flag automatically sets RETRIEVER_BACKEND to the matching backend for the current shell before startup.
source setup.sh --up-with-vdms
source setup.sh --up-with-milvus
source setup.sh --up-with-pgvector
source setup.sh --up-with-faiss
When you use the backend overlay flow above, Docker starts:
vector-retrievermultimodal-embedding-servingLocal backend service for
vdms,milvus, orpgvector(FAISS is in-process and does not start a separate database container)
Use an external backend service#
If your vector database is already running outside this compose stack, set backend connection variables to that external endpoint and start only the retriever stack.
Examples:
VDMS_VDB_HOSTandVDMS_VDB_PORTfor VDMSMILVUS_URIfor MilvusPGVECTOR_CONNECTION_STRINGfor PGVector
Then run:
source setup.sh --nosetup
docker compose -f docker/compose.yaml up -d --build
Manual Docker Compose (Advanced)#
Use direct compose commands only when you want explicit control or troubleshooting behavior.
Start with local backend overlay services:
docker compose -f docker/compose.yaml -f docker/compose.${RETRIEVER_BACKEND}.yaml up -d --build
Start retriever-only (for external backend services):
docker compose -f docker/compose.yaml up -d --build
setup.sh remains recommended because manual compose does not perform setup-time validation and convenience handling.
Verify Deployment#
curl --location --request GET 'http://localhost:6008/health'
curl --location --request GET 'http://localhost:6008/ready'
Cleanup and Stop#
Use the commands below based on how much cleanup you need.
Stop running services (--down)#
source setup.sh --down
This stops vector-retriever and overlay services across all backend compose files.
Stop services and remove stack data (--clean-data)#
source setup.sh --clean-data
This stops services, removes compose orphans, and removes only this stack’s named volumes.
Sample CURL Commands#
All requests target http://localhost:6008.
Health Check#
curl --location --request GET 'http://localhost:6008/health'
Readiness Check#
curl --location --request GET 'http://localhost:6008/ready'
Filter Capabilities (All Backends)#
curl --location --request GET 'http://localhost:6008/capabilities/filters'
Filter Capabilities (Single Backend)#
curl --location --request GET 'http://localhost:6008/capabilities/filters?backend=vdms'
curl --location --request GET 'http://localhost:6008/capabilities/filters?backend=milvus'
curl --location --request GET 'http://localhost:6008/capabilities/filters?backend=pgvector'
curl --location --request GET 'http://localhost:6008/capabilities/filters?backend=faiss'
Query with where and Top-K#
curl --location 'http://localhost:6008/query' \
--header 'Content-Type: application/json' \
--data '[
{
"query_id": "q1",
"query": "red car",
"where": {
"field": "tags",
"op": "contains_any",
"value": ["traffic"]
},
"top_k": 10
}
]'
where is the preferred filter contract. Legacy tags, time_filter, and filters
fields are still accepted for backward compatibility.
Query with Image Input (base64)#
curl --location 'http://localhost:6008/query' \
--header 'Content-Type: application/json' \
--data '[
{
"query_id": "img1",
"image": {
"type": "image_base64",
"image_base64": "<base64-encoded-image-data>"
},
"top_k": 5
}
]'
Query with Image Input (URL)#
curl --location 'http://localhost:6008/query' \
--header 'Content-Type: application/json' \
--data '[
{
"query_id": "img2",
"image": {
"type": "image_url",
"image_url": "https://example.com/photo.jpg"
},
"top_k": 5
}
]'
Note:
queryandimageare mutually exclusive. Providing both returns422.
Query with Time Filter#
curl --location 'http://localhost:6008/query' \
--header 'Content-Type: application/json' \
--data '[
{
"query_id": "q2",
"query": "person near crosswalk",
"time_filter": {
"start": "2026-03-01T00:00:00Z",
"end": "2026-03-22T23:59:59Z"
}
}
]'
Query with Dynamic Filters#
curl --location 'http://localhost:6008/query' \
--header 'Content-Type: application/json' \
--data '[
{
"query_id": "q3",
"query": "bus on main road",
"filters": {
"bucket_name": {"op": "in", "value": ["north", "west"]},
"timestamp": {"op": "gte", "value": 10}
}
}
]'
Run Tests (Unit and Functional)#
Run tests from this service root directory.
Install test dependencies#
Pick the backend dependency group you want to validate and install with dev dependencies:
export RETRIEVER_BACKEND=vdms
poetry install --only "main,backend-${RETRIEVER_BACKEND},dev" --no-root
export RETRIEVER_BACKEND=milvus
poetry install --only "main,backend-${RETRIEVER_BACKEND},dev" --no-root
export RETRIEVER_BACKEND=pgvector
poetry install --only "main,backend-${RETRIEVER_BACKEND},dev" --no-root
export RETRIEVER_BACKEND=faiss
poetry install --only "main,backend-${RETRIEVER_BACKEND},dev" --no-root
Run unit tests#
Unit tests exclude dockerized backend functional tests:
PYTHONPATH=. poetry run pytest -q tests --ignore=tests/functional
You can also run the core unit suite directly:
PYTHONPATH=. poetry run pytest -q \
tests/test_schema.py \
tests/test_filters.py \
tests/test_backend_factory.py \
tests/test_service.py \
tests/test_main.py
Run functional backend tests#
Functional tests bring up docker compose backend overlays, seed test data, and verify the filter matrix end-to-end.
Run all backend functional tests:
RUN_FUNCTIONAL_BACKEND_TESTS=1 PYTHONPATH=. poetry run pytest -q tests/functional
Run one backend only:
RUN_FUNCTIONAL_BACKEND_TESTS=1 PYTHONPATH=. poetry run pytest -q tests/functional/test_vdms_filters.py
RUN_FUNCTIONAL_BACKEND_TESTS=1 PYTHONPATH=. poetry run pytest -q tests/functional/test_milvus_filters.py
RUN_FUNCTIONAL_BACKEND_TESTS=1 PYTHONPATH=. poetry run pytest -q tests/functional/test_pgvector_filters.py
RUN_FUNCTIONAL_BACKEND_TESTS=1 PYTHONPATH=. poetry run pytest -q tests/functional/test_faiss_filters.py
Note: Functional tests are intentionally heavier than unit tests and require Docker.
Troubleshooting#
Container fails to start
Run
docker logs vector-retriever(or the compose service container name) to inspect startup failures.Ensure required ports (default
6008) are available.
Readiness check fails
Confirm the embedding endpoint configured by
EMBEDDINGS_ENDPOINTis reachable from the container.Confirm backend-specific connectivity (VDMS/Milvus/PGVector) is valid.
No results returned
Verify index/collection name (
INDEX_NAME) matches where embeddings were stored.Reduce filters temporarily to isolate backend filter translation issues.
Configuration changes not applied
Re-run
source setup.shafter changing environment variables.Use
source setup.sh --confto inspect rendered compose configuration.