Skip to content

Configuration

Device Agent configuration comes from three places: the console settings page, .device_agent/config.json, and the workspace-root .env. For day-to-day changes, use the console settings page. For first startup, service deployment, and environment-specific values, use .env. For backup, migration, or bulk rollout, edit or replace the configuration file.

Configuration Sources

SourceBest forNotes
Console settings pageDaily MQTT, model, voice, IM, and tool permission changesSaves to .device_agent/config.json. The UI shows whether a restart is required.
.device_agent/config.jsonBackup, migration, bulk rollout, or environments without UI accessStores the main Device Agent runtime configuration.
.envFirst startup, containers or system services, environment differences, secret injectionRead at startup. For config-backed fields, startup env values are written into the matching config file fields.

In development, the runtime home is usually .device_agent under the repository. In production, it is usually ~/.device_agent. Use the Runtime Home line in the startup logs as the source of truth.

Apply Behavior

ConfigurationStored inApply behavior
MQTT connection, topics, TLS.device_agent/config.json, can be written by .envUsually requires a gateway restart. Existing MQTT connections do not switch automatically.
Agent and vision models.device_agent/config.json, can be written by .envSaving in the console updates the running agent configuration.
Voice provider, models, and credentials.device_agent/config.json, can be written by .envCan update while the service is running; enable state, bind host, port, and TLS changes require restart.
IM channels.device_agent/config.json, can be written by .envChannels are loaded at startup, so changes require restart.
Tool permissions.device_agent/config.json, with optional env overridesSaving in the console updates runtime permissions. Env-overridden fields are shown as overridden in the UI.
Logging.device_agent/config.json, can be written by .envSaving updates log level and output behavior.
HTTP bind address, database, A2A identity, additional IM channels.envRead at startup only.
Web frontend variables.envRead by the frontend dev server or build process. Restart or rebuild the frontend after changing them.

If a field is set in both .env and the console, the .env value is written again on the next restart. To keep console changes long-term, remove the matching .env variable or keep both values aligned.

Minimal Startup Example

bash
MQTT_BROKER_URL=mqtt://broker.example.com:1883
MQTT_USERNAME=your-username
MQTT_PASSWORD=your-password
VITE_MQTT_WS_URL=wss://broker.example.com:8084/mqtt

LLM_PROVIDER=openai
LLM_MODEL=gpt-4.1
OPENAI_API_KEY=sk-...

AGENT_GATEWAY_HTTP_HOST=127.0.0.1
AGENT_GATEWAY_HTTP_PORT=3000

To access the console from a server IP or LAN address, set AGENT_GATEWAY_HTTP_HOST to 0.0.0.0 and adjust AGENT_GATEWAY_HTTP_PORT if needed.

Next