Skip to content

Agent Container Installation Manual

This document explains how to install obs-agent with Docker and Kubernetes. If you are installing on Kubernetes, prefer Helm.

When the container starts, it uses BEAK_WS_URL, AGENT_ID, and AGENT_API_KEY to load runtime configuration from Beak, then starts the agent.

Persistent storage is a runtime prerequisite. /app stores active session/task JSONL history and related data, while the other two directories store profile and Owl data. Docker, Kubernetes YAML, and Helm deployments must provide persistent storage for /app, /var/lib/obs-agent/profile-cache, and /app/.owl. Mount the Owl volume separately at /app/.owl. Otherwise, active sessions/tasks may be unable to continue after a container or Pod rebuild or upgrade.

If the container node cannot access Beak, the LLM, or other public services directly, first read Configure an obs-agent forward proxy.

Prepare Connection Information

Copy these values from the Beak console or installation page. Docker and Kubernetes YAML installations use all three values. Branded Helm Charts already contain the default Beak address and use only AGENT_ID and AGENT_API_KEY unless you need to override that address:

export BEAK_WS_URL='https://agent-api.guance.com'
export AGENT_ID='replace-with-agent-uuid'
export AGENT_API_KEY='replace-with-agent-api-key'

Prepare the image address:

export OBS_AGENT_IMAGE='pubrepo.guance.com/guance/obs-agent:v0.8.1'

Install with Docker

Docker deployments must create and remount the three named volumes shown below. Reuse the same volume names during upgrades and restarts; do not replace them with container-temporary directories. A bind mount managed independently from the container is also supported.

Create an env file:

cat > obs-agent.env <<EOF
BEAK_WS_URL=${BEAK_WS_URL}
AGENT_ID=${AGENT_ID}
AGENT_API_KEY=${AGENT_API_KEY}
EOF

Start the container:

docker run -d \
  --name obs-agent \
  --restart unless-stopped \
  --env-file ./obs-agent.env \
  -v obs-agent-work:/app \
  -v obs-agent-profile-cache:/var/lib/obs-agent/profile-cache \
  -v obs-agent-owl:/app/.owl \
  "${OBS_AGENT_IMAGE}"

Check status:

docker ps --filter name=obs-agent
docker logs -f obs-agent

The following log lines indicate that startup succeeded:

obs-agent profile request loaded
obs-agent websocket connected

Upgrade the image:

OBS_AGENT_IMAGE="${OBS_AGENT_IMAGE%:*}:v0.8.1"
docker pull "${OBS_AGENT_IMAGE}"
docker rm -f obs-agent
docker run -d \
  --name obs-agent \
  --restart unless-stopped \
  --env-file ./obs-agent.env \
  -v obs-agent-work:/app \
  -v obs-agent-profile-cache:/var/lib/obs-agent/profile-cache \
  -v obs-agent-owl:/app/.owl \
  "${OBS_AGENT_IMAGE}"

Remove the Docker installation:

The docker volume rm command below permanently deletes session/task history and related data. Run it only after confirming that no task needs to be restored or continued.

docker rm -f obs-agent
docker volume rm obs-agent-work obs-agent-profile-cache obs-agent-owl

Install with Kubernetes YAML

If you do not use Helm, you can use the base manifest published to OSS directly.

The base manifest creates and mounts three PVCs (20 GiB, 5 GiB, and 5 GiB). Before installation, the cluster must have a default StorageClass for dynamic provisioning or pre-created PVs that the PVCs can bind to. A Pod remains Pending while its PVCs are unbound. Do not replace them with emptyDir, because a Pod rebuild or upgrade would lose active session/task JSONL history and related data.

Download the manifest:

curl -fsSL https://static.guance.com/obs-agent/obs-agent.yml -o obs-agent.yml

Download a specific version of the manifest:

curl -fsSL https://static.guance.com/obs-agent/obs-agent-v0.8.1.yml -o obs-agent.yml

Create the namespace:

kubectl create namespace obs-agent

The manifest stores the Beak address and Agent credentials in environment variables. Make sure envsubst is installed, then expand only these three variables so characters such as / and & in URLs or credentials are not interpreted by a replacement command:

envsubst '${BEAK_WS_URL} ${AGENT_ID} ${AGENT_API_KEY}' \
  < obs-agent.yml \
  | kubectl -n obs-agent apply -f -

obs-agent.yml already includes a Kubernetes Secret. The envsubst command writes the current credentials into these fields:

apiVersion: v1
kind: Secret
metadata:
  name: obs-agent-secret
type: Opaque
stringData:
  AGENT_API_KEY: "${AGENT_API_KEY}"
  AGENT_ID: "${AGENT_ID}"

Check status:

kubectl -n obs-agent get pods
kubectl -n obs-agent get deploy
kubectl -n obs-agent logs -f deploy/obs-agent

When upgrading, download the new obs-agent.yml, keep the current BEAK_WS_URL, AGENT_ID, and AGENT_API_KEY, then run:

envsubst '${BEAK_WS_URL} ${AGENT_ID} ${AGENT_API_KEY}' \
  < obs-agent.yml \
  | kubectl -n obs-agent apply -f -

Keep and reuse the existing PVCs during an upgrade. Deleting a PVC or namespace may also delete the underlying PV data, depending on the StorageClass reclaim policy.

Remove the YAML installation:

The commands below delete the PVCs created by the manifest. Whether the underlying PV data is retained depends on the StorageClass reclaim policy. Run them only after confirming that no task needs to be restored or continued.

kubectl -n obs-agent delete -f obs-agent.yml
kubectl delete namespace obs-agent

Install with Kubernetes Helm

The Helm chart creates and mounts three PVCs (20 GiB, 5 GiB, and 5 GiB) by default. Before installation, configure a default StorageClass or specify three bound PVCs through persistence.work.existingClaim, persistence.profileCache.existingClaim, and persistence.owl.existingClaim. Do not disable these persistence entries, because a Pod rebuild or upgrade would lose active session/task JSONL history and related data.

Set the Helm repository address, then add the repository:

The Helm repository address is different from the container image repository. Do not use the later image.repository path with helm repo add.

export OBS_AGENT_HELM_REPO_URL='https://pubrepo.guance.com/chartrepo/obs-agent'
helm repo add obs-agent "${OBS_AGENT_HELM_REPO_URL}"
helm repo update obs-agent
helm search repo obs-agent

Create the namespace:

kubectl create namespace obs-agent

Create the agent secret:

kubectl -n obs-agent create secret generic obs-agent-secret \
  --from-literal=AGENT_ID="${AGENT_ID}" \
  --from-literal=AGENT_API_KEY="${AGENT_API_KEY}"

Branded Helm Charts include the default Beak address for the current brand, so normal installations do not need to set config.BEAK_WS_URL manually.

Install:

helm upgrade --install obs-agent obs-agent/obs-agent \
  --namespace obs-agent \
  --set image.repository=pubrepo.guance.com/guance/obs-agent \
  --set image.tag=v0.8.1 \
  --set secret.existingSecret=obs-agent-secret

Append --set-string config.BEAK_WS_URL="${BEAK_WS_URL}" only when using a custom Beak address, upgrading an older Chart without a branded default address, or installing the Chart directly from repository source at docs/examples/helm/obs-agent.

Check status:

kubectl -n obs-agent get pods
kubectl -n obs-agent get deploy -l app.kubernetes.io/instance=obs-agent
kubectl -n obs-agent logs -f deploy/obs-agent

If the Deployment name is not obs-agent, use the actual name from kubectl get deploy to view logs.

Upgrade:

helm upgrade obs-agent obs-agent/obs-agent \
  --namespace obs-agent \
  --reuse-values \
  --set image.tag=v0.8.1

If an older release already saved an incorrect or unresolved Beak address in its values, --reuse-values keeps that value. On the first upgrade to the fixed Chart, also pass --set-string config.BEAK_WS_URL="${BEAK_WS_URL}" to correct it. Later upgrades can continue reusing values.

Remove the Helm installation:

helm uninstall deletes PVCs created by the chart, and kubectl delete namespace also deletes PVCs in that namespace. Whether underlying PV data is retained depends on the StorageClass reclaim policy. Run these commands only after confirming that no task needs to be restored or continued.

helm uninstall obs-agent -n obs-agent
kubectl delete namespace obs-agent

View Available Environment Variables

All installation methods require AGENT_ID and AGENT_API_KEY. Docker and Kubernetes YAML also require BEAK_WS_URL. Branded Helm Charts provide a default address, so override it only for custom endpoints or older Charts. The remaining variables below are for troubleshooting or overriding defaults.

Environment Variable Manual Configuration Required Description
BEAK_WS_URL Docker/YAML: Yes; branded Helm: No Beak config API address, such as https://agent-api.guance.com. Branded Helm Charts include a default and allow overrides through config.BEAK_WS_URL.
AGENT_ID Yes Agent instance ID. Each running instance must be unique.
AGENT_API_KEY Yes Credential used by Agent to access the Beak config API and WebSocket.
BEAK_ENDPOINT No Fallback address used by the container entrypoint when reading the Beak config API. If unset, BEAK_WS_URL is used.
HTTP_PROXY / http_proxy No HTTP forward proxy for HTTP and WS requests. Uppercase and lowercase variables must match if both are set.
HTTPS_PROXY / https_proxy No Proxy for HTTPS and WSS requests; the proxy endpoint still uses http://.
NO_PROXY / no_proxy No Hosts, domains, IPs, or CIDRs that bypass the proxy. Include at least localhost,127.0.0.1,::1.
SSL_CERT_FILE / SSL_CERT_DIR No Enterprise CA file or directory when the proxy re-signs TLS certificates.
AGENT_NAME No Agent display name. If not manually configured, it is delivered by the Beak config API.
AGENT_WORKDIR No Agent working directory. Container default is /app.
AGENT_PROFILE_CACHE_DIR No Profile cache directory. Container default is /var/lib/obs-agent/profile-cache.
AGENT_LOCAL_TIMEZONE No Agent local timezone. Container default is Asia/Shanghai.
AGENT_HTTP_ALLOWED_DOMAINS No Restricts domains accessible by HTTP tools, comma-separated.
AGENT_UPDATE_ENABLED No Containerized deployment keeps self-update disabled. Upgrade by replacing the image or manifest.
AGENT_UPDATE_HELPER_PATH No Self-update helper path. Usually not used in containerized deployment.
AGENT_UPDATE_BASE_URL No Self-update release address. Usually not used in containerized deployment.
AGENT_UPDATE_CHECK_INTERVAL_SECONDS No Self-update check interval. Default is 300.
AGENT_UPDATE_STATE_PATH No Self-update state file path.
AGENT_UPDATE_HISTORY_PATH No Self-update history file path.
AGENT_INSTALL_MODE No Installation mode marker, usually written by the installer.
AGENT_SELF_HOST_STATE_PATH No Host installation state file path. Usually not used in containerized deployment.
AGENT_SKILL_DEP_INSTALLER No Skill dependency installer path. Usually provided by the installer or image.
AGENT_SKILL_DEP_STATE_PATH No Skill dependency state file path.
AGENT_SKILL_DEP_HISTORY_PATH No Skill dependency history file path.
LLM_BASE_URL No Delivered by the Beak config API.
LLM_API_KEY No Delivered by the Beak config API. Defaults to AGENT_API_KEY.
LLM_MODEL No No manual configuration is required. If unset, agent uses the default model.
LLM_TEMPERATURE No LLM temperature. Default is 0.2.
LLM_MAX_TOKENS No Maximum LLM output tokens. Default 0 means using the model default.
AI_HUB_BASE_URL No AI Hub address. If unset, LLM_BASE_URL is used.
LOG_LEVEL No Log level. Container default is info.
LOG_FORMAT No Log format. Container default is text.
LOG_PATH No Log output location. Container default is stdout.
AGENT_DIAGNOSTIC_LOG_PATH No Bounded rotating log copy used by bug reports. Containers default to /var/lib/obs-agent/profile-cache/diagnostics/agent.log on the persistent profile-cache volume and fall back to a 4 MiB in-memory tail if the path is not writable.
LOG_RELATIVE_PATH No Whether the log path is resolved relative to the work directory. Default is true.
LOG_MAX_SIZE_MB No Maximum size of one log file. Default is 32.
LOG_MAX_BACKUPS No Number of log backup files. Default is 5.
OTEL_EXPORTER_OTLP_PROTOCOL No OTEL export protocol. Container default is http/protobuf.
OTEL_EXPORTER_OTLP_ENDPOINT No OTEL collector endpoint. Delivered by the Beak config API or manually overridden when trace export is required.
OTEL_EXPORTER_OTLP_HEADERS No OTEL request headers. Delivered by the Beak config API or manually overridden when trace export is required.
OTEL_LOGS_ENABLED No Legacy variable ignored by the current Agent. Beak's runtime-config API controls metrics, logs, and traces together.
AGENT_MAX_LLM_CALLS No Limit on actual LLM provider calls per task. Default is 512 and must be greater than 0; 429 responses, timeouts, 5xx responses, and automatic retries all count.
AGENT_MAX_RUN_TOKENS No Optional hard cumulative token budget per task. Default is 0 (unlimited); set a positive value to enable it.
AGENT_MAX_RUN_DURATION No Hard wall-clock budget per task. Default is 2h; 0s disables it.
AGENT_MAX_LLM_MESSAGES No Optional message-count safety limit for a single model request. Default is 0 (disabled).
AGENT_MAX_LLM_MESSAGE_CHARS No Maximum characters per LLM message. Default is 512000.
AGENT_MAX_SYSTEM_PROMPT_CHARS No Maximum system prompt characters. Default is 512000.
AGENT_QUERY_SESSION_CHAT_HISTORY_LIMIT No Query limit for session history. Default is 20.
AGENT_CONTEXT_BUDGET_TOKENS No Context token budget. Default is 262144.
AGENT_CONTEXT_BUDGET_CHARS No Context character budget. Default is 262144.
AGENT_REASONING_DISPLAY_MODE No Reasoning display mode. Supports hidden or raw. Default is hidden.
AGENT_PROFILE_SYNC_DISABLE No Whether to disable profile sync. Default is false.
AGENT_PROFILE_SYNC_INTERVAL No Periodic fallback interval for full Profile synchronization. Default is 5m; saving this Agent's Profile, Skill, or MCP binding also triggers an immediate targeted synchronization. For full semantics, see Real-time Profile Material Refresh.
AGENT_DEFAULT_APPROVAL_TTL_SECONDS No Default approval TTL. Default is 300 seconds.
AGENT_WEB_SEARCH_ENABLED No Whether to enable the Web Search tool. Default is true.
AGENT_WEB_SEARCH_BASE_URL No Web Search service address. Required when Web Search is enabled.
AGENT_WEB_SEARCH_DEFAULT_LIMIT No Default number of Web Search results. Default is 5.
AGENT_WEB_SEARCH_MAX_LIMIT No Maximum number of Web Search results. Default is 10.
AGENT_WEB_SEARCH_MAX_CONTENT_CHARS No Maximum content characters per search result. Default is 3000.
AGENT_WEB_SEARCH_MAX_CONTEXT_CHARS No Maximum search context characters. Default is 12000.
AGENT_WEB_SEARCH_DEFAULT_MODE No Default Web Search mode. Default is auto.
AGENT_WEB_SEARCH_TIMEOUT No Web Search timeout. Default is 30s.
AGENT_MESSAGE_ENCRYPTION_ENABLED No Whether message encryption is enabled. Default is true.
AGENT_MESSAGE_HPKE_KEY_ID No HPKE key ID.
AGENT_MESSAGE_HPKE_PRIVATE_KEY No HPKE private key content.
AGENT_MESSAGE_HPKE_KEY_PATH No HPKE private key file path.
AGENT_MESSAGE_HPKE_ROTATION_INTERVAL No HPKE key rotation interval. Default 0 means no automatic rotation.
OWL_BASE_URL No Owl dependency download address. Usually built into the image or delivered by the Beak config API.
OWL_INSTALL_URL No Owl installation script address. Usually delivered by the Beak config API.
OWL_REGISTRY_ENDPOINT No Owl registry address. Usually delivered by the Beak config API.
OWL_TOKEN No Owl registry access token. Usually delivered by the Beak config API.
OWL_DIR No Owl working directory. Container default is ${AGENT_WORKDIR}/.owl, or /app/.owl. obs-agent exposes it as a shared read-only root for read_file and list_dir. Explicit paths from older deployments remain supported.
AGENT_IMAGE_PRINT_VERSIONS No Whether to print obs-agent and owl versions at container startup. Default is false.

Notes

  • Docker and Helm cannot use the same AGENT_ID online at the same time. Each running instance needs an independent agent.
  • For older deployments upgraded by replacing only the image, if the Owl volume remains mounted at /var/lib/obs-agent/work/.owl, the entrypoint detects and continues using it when OWL_DIR is unset. New Compose, Kubernetes, and Helm templates use /app/.owl. Do not mount both Owl volumes during migration.
  • obs-agent.yml creates a dedicated ServiceAccount and disables Kubernetes service account token auto-mounting.
  • The container does not run the host installation script and does not depend on systemd.
  • Containerized deployment does not enable local self-update. Upgrade by replacing the image tag or digest.
  • In production, use an image digest to pin the version.

Feedback

Is this page helpful?