Skip to content

Drive Integration 🟒 GA

Read and write bot files through Drive with Vault-issued credentials, and prove the change is visible to the runtime.

Admin guide Β· Drive operations runbook

When to use Before you start Steps Verify Roll back
Uploading a KB document, inspecting a bot tree Vault unsealed, oc in /tmp Read credentials, alias, copy, observe reload Object present, bot sees it Restore prior object from backup

When to use

Use this runbook for any bot file operation: Drive is the runtime home of .gbkb knowledge and .gbdrive user files.

Before you start

  • Drive is an OtterIO S3-compatible service. Its credentials come from Vault at secret/gbo/drive (accesskey, secret, port); never place them in .env or in the repository.
  • The oc client is installed under /tmp, never at the repository root.
  • For git-owned bots, .gbdialog/ scripts and .gbot/ prompts live in the bot's ALM repository; read them in Drive for inspection only. Change them in the repository.
  • Use hostnames and the loopback address with the Vault-provided port; do not record an internal IP.

Steps

# 1. Read credentials from Vault.
source <(grep -E '^VAULT_' "${WORKSPACE}/.env")
export VAULT_ADDR="$VAULT_ADDR"
export VAULT_CACERT="${WORKSPACE}/botserver-stack/conf/system/certificates/ca/ca.crt"
export VAULT_TOKEN=$(cat /tmp/vault-token-gb 2>/dev/null || echo "$VAULT_TOKEN")
VAULT_BIN="${WORKSPACE}/botserver-stack/bin/vault/vault"
DRIVE_ACCESSKEY=$($VAULT_BIN kv get -field=accesskey secret/gbo/drive)
DRIVE_SECRET=$($VAULT_BIN kv get -field=secret secret/gbo/drive)
DRIVE_PORT=$($VAULT_BIN kv get -field=port secret/gbo/drive)

# 2. Configure the local alias.
/tmp/oc alias set local "http://127.0.0.1:${DRIVE_PORT}" "$DRIVE_ACCESSKEY" "$DRIVE_SECRET" --api s3v4

# 3. Inspect, then upload a Drive-owned document.
/tmp/oc ls local/
/tmp/oc ls local/"<bot>.gbai"/"<bot>.gbkb"/docs/
/tmp/oc cp /tmp/document.pdf local/"<bot>.gbai"/"<bot>.gbkb"/docs/

# 4. Confirm the runtime observed the change.
grep -E "drive_monitor|ERROR" botserver.log | tail -30

Contract in one paragraph

Drive buckets are .gborg / .gbai trees materialised into bots by the drive monitors. The runtime reads bot configuration and knowledge from this tree; for git-owned bots the dialog scripts and prompts are copies of the ALM repository and are never edited in place.

Credentials

Vault is the single source for the access key, secret and port. Rotate with the rotation runbook; a stale cached credential requires a process restart.

Verify

Check Command Pass condition
Alias /tmp/oc ls local/ bot buckets listed
Object /tmp/oc ls .../docs/ uploaded object present
Reload botserver.log drive monitor observed the change
Retrieval chat query over the new KB document document is used
Secrets repository search no credential value present

Roll back

πŸ”΄ Remove the uploaded object or restore the previous version from the backup runbook, then confirm the bot no longer sees it. Do not restore a whole live drive while bots are writing: stop the affected bots first.

See also