Configuration Guide#
The Semantic Search Agent uses environment variables (or a .env file at the project root) for all configuration. No YAML subscription file is required; data sources are JSON files under config/.
Load Order#
The service loads configuration in the following order:
Environment Variables /
.env: Loaded via Pydantic Settings on startup. Environment variables take precedence over.envfile values.Config JSON Files:
config/inventory.jsonandconfig/orders.jsonare loaded lazily on first use by the ComparisonEngine and cached in memory for the lifetime of the process.
Environment Variables#
All variables can be set as real environment variables or placed in the .env file at the project root.
Service Settings#
Variable |
Default |
Description |
|---|---|---|
|
|
Service name reported in health and logs. |
|
|
Service version reported in health responses. |
|
|
Logging level: |
|
|
Port the FastAPI server listens on. |
|
|
Port for the Prometheus |
|
|
Enable or disable the Prometheus metrics mount. |
Matching Configuration#
Variable |
Default |
Description |
|---|---|---|
|
|
Matching strategy: |
|
|
Minimum VLM confidence score to consider a semantic match successful. |
|
|
Maximum retries for VLM inference calls on transient failures. |
VLM Backend Selection#
Variable |
Default |
Description |
|---|---|---|
|
|
VLM backend to use: |
OVMS Backend Settings#
Required when VLM_BACKEND=ovms and strategy is semantic or hybrid.
Variable |
Default |
Description |
|---|---|---|
|
(empty) |
Full base URL of the OVMS server (e.g. |
|
(empty) |
Model name served by OVMS (e.g. |
|
|
HTTP request timeout in seconds for OVMS calls. |
OpenVINO Local Backend Settings#
Required when VLM_BACKEND=openvino_local and strategy is semantic or hybrid.
Variable |
Default |
Description |
|---|---|---|
|
(empty) |
Path to the OpenVINO IR model directory on disk. ⚠️ Required. |
|
|
Inference device: |
|
|
Maximum tokens to generate per inference call. |
|
|
Sampling temperature (0.0 = deterministic). |
OpenAI Backend Settings#
Required when VLM_BACKEND=openai and strategy is semantic or hybrid.
Variable |
Default |
Description |
|---|---|---|
|
(empty) |
OpenAI API key. ⚠️ Required. |
|
|
OpenAI model identifier to use for inference. |
|
|
Maximum tokens to generate per API call. |
Cache Settings#
Variable |
Default |
Description |
|---|---|---|
|
|
Enable or disable response caching for semantic match results. |
|
|
Cache backend: |
|
|
Redis hostname (used when |
|
|
Redis port. |
|
|
Redis database index. |
|
|
Cache entry time-to-live in seconds. |
Proxy Settings#
Pass these when running the service or building the Docker image behind a corporate proxy:
Variable |
Default |
Description |
|---|---|---|
|
(empty) |
HTTP proxy URL (e.g. |
|
(empty) |
HTTPS proxy URL. |
|
(empty) |
Comma-separated list of hosts to bypass the proxy. |
Note: The OVMS backend sets
trust_env=Falseon its HTTP client to bypass proxy settings for internal OVMS communication. This is intentional — OVMS hosts are typically on the same internal network.
Config JSON Files#
Two JSON data files drive the comparison engine’s data sources. Their paths can be overridden via environment variables; defaults point to the config/ directory in the project root.
config/inventory.json#
A flat JSON array of item name strings representing the available inventory:
[
"apple",
"banana",
"milk",
"bread",
"eggs",
"butter"
]
config/orders.json#
A JSON object mapping order IDs to lists of expected items with names and quantities:
{
"order_001": [
{"name": "apple", "quantity": 3},
{"name": "milk", "quantity": 2}
]
}
Path Override Variables#
Variable |
Default |
Description |
|---|---|---|
|
|
Base directory for config files. |
|
|
Path to the orders JSON file. |
|
|
Path to the inventory JSON file. |
Matching Strategy Reference#
Strategy |
VLM Required |
Behavior |
|---|---|---|
|
No |
Normalizes both strings (lowercase, trim, strip special chars) and compares directly. |
|
Yes |
Sends a structured YES/NO prompt to the VLM backend for every comparison. Result is cached. |
|
Yes |
Tries exact match first. If exact confidence ≥ |