Skip to main content

Configuration File

Edit docker/assistant-api/.assistant.env before starting the service. For local development (without Docker), export the variables and override the Docker hostnames shown in the table below.

Required Variables

VariableDefaultDescription
SECRETrpd_pksJWT signing secret — must be identical across all services
POSTGRES__HOSTpostgresPostgreSQL host
POSTGRES__DB_NAMEassistant_dbDatabase name
POSTGRES__AUTH__USERrapida_userDatabase user
POSTGRES__AUTH__PASSWORDrapida_db_passwordDatabase password
REDIS__HOSTredisRedis host
OPENSEARCH__HOST(empty)OpenSearch host — optional, leave empty to disable knowledge base
INTEGRATION_HOSTintegration-api:9004integration-api gRPC address
ENDPOINT_HOSTendpoint-api:9005endpoint-api gRPC address
WEB_HOSTweb-api:9001web-api gRPC address
DOCUMENT_HOST(empty)document-api HTTP address — optional, only needed for knowledge base
PUBLIC_ASSISTANT_HOSTPublicly reachable hostname for telephony callbacks and WebSocket media
PUBLIC_ASSISTANT_HOST must resolve from the public internet. Twilio, Vonage, and Exotel connect WebSocket media streams to wss://PUBLIC_ASSISTANT_HOST/v1/talk/{provider}/ctx/{contextId}. For local testing, use an ngrok tunnel and set this to your ngrok hostname (e.g. abc123.ngrok.io).

Service Identity

VariableDefaultDescription
SERVICE_NAMEworkflow-apiInternal service name label
HOST0.0.0.0Bind address
PORT9007HTTP / gRPC / WebSocket port (cmux)
LOG_LEVELdebugdebug · info · warn · error
ENVdevelopmentdevelopment · staging · production

PostgreSQL

VariableDefaultDescription
POSTGRES__HOSTpostgresHost (localhost for local dev)
POSTGRES__PORT5432Port
POSTGRES__DB_NAMEassistant_dbDatabase name
POSTGRES__AUTH__USERrapida_userUser
POSTGRES__AUTH__PASSWORDrapida_db_passwordPassword
POSTGRES__MAX_OPEN_CONNECTION50Connection pool size
POSTGRES__MAX_IDEAL_CONNECTION25Idle connections
POSTGRES__SSL_MODEdisabledisable · require · verify-full
POSTGRES__SLC_CACHE__HOSTredisRedis host for second-level GORM cache
POSTGRES__SLC_CACHE__PORT6379Redis port for GORM cache
POSTGRES__SLC_CACHE__DB1Redis DB index for GORM cache
POSTGRES__SLC_CACHE__MAX_CONNECTION10Redis pool size

Redis

VariableDefaultDescription
REDIS__HOSTredisRedis host (localhost for local dev)
REDIS__PORT6379Redis port
REDIS__MAX_CONNECTION10Connection pool size
REDIS__MAX_DB0Redis DB index

OpenSearch (Optional — Knowledge Base Only)

OpenSearch is only needed for knowledge base / RAG features. If OPENSEARCH__HOST is left empty (the default), the assistant-api starts without knowledge base support and skips the OpenSearch connection entirely.
VariableDefaultDescription
OPENSEARCH__SCHEMAhttphttp · https
OPENSEARCH__HOST(empty)OpenSearch host — leave empty to disable knowledge base
OPENSEARCH__PORT9200OpenSearch port
OPENSEARCH__MAX_RETRIES3Request retry count
OPENSEARCH__MAX_CONNECTION10Connection pool size

Asset Storage

VariableDefaultDescription
ASSET_STORE__STORAGE_TYPElocallocal · s3 · azure
ASSET_STORE__STORAGE_PATH_PREFIX/app/rapida-data/assets/workflowPath for local storage
ASSET_STORE__PUBLIC_URL_PREFIXhttp://localhost:8080/rapida-data/assets/workflowPublic URL for serving stored assets

Telemetry (Optional)

assistant-api supports an optional environment-configured default telemetry exporter. Set exporter type:
VariableDefaultDescription
TELEMETRY__TYPE(empty)otlp_http · otlp_grpc · xray · google_trace · azure_monitor · datadog · opensearch · logging
Provider-specific keys:

OTLP HTTP

VariableDescription
TELEMETRY__OTLP_HTTP__ENDPOINTOTLP endpoint
TELEMETRY__OTLP_HTTP__PROTOCOLhttp/protobuf or grpc
TELEMETRY__OTLP_HTTP__HEADERSComma-separated headers (A=B, C=D)
TELEMETRY__OTLP_HTTP__INSECUREtrue/false

OTLP gRPC

VariableDescription
TELEMETRY__OTLP_GRPC__ENDPOINTOTLP endpoint
TELEMETRY__OTLP_GRPC__PROTOCOLUsually grpc
TELEMETRY__OTLP_GRPC__HEADERSComma-separated headers
TELEMETRY__OTLP_GRPC__INSECUREtrue/false

Datadog

VariableDescription
TELEMETRY__DATADOG__ENDPOINTDatadog OTLP/agent endpoint
TELEMETRY__DATADOG__PROTOCOLProtocol override
TELEMETRY__DATADOG__HEADERSAdditional headers
TELEMETRY__DATADOG__API_KEYDatadog API key
TELEMETRY__DATADOG__INSECUREtrue/false

AWS X-Ray

VariableDescription
TELEMETRY__XRAY__ENDPOINTADOT/OTLP endpoint
TELEMETRY__XRAY__PROTOCOLProtocol override
TELEMETRY__XRAY__REGIONAWS region
TELEMETRY__XRAY__INSECUREtrue/false

Google Trace

VariableDescription
TELEMETRY__GOOGLE_TRACE__ENDPOINTTrace endpoint
TELEMETRY__GOOGLE_TRACE__HEADERSAdditional headers
TELEMETRY__GOOGLE_TRACE__API_KEYAPI key
TELEMETRY__GOOGLE_TRACE__ACCESS_TOKENOAuth bearer token
TELEMETRY__GOOGLE_TRACE__INSECUREtrue/false

Azure Monitor

VariableDescription
TELEMETRY__AZURE_MONITOR__ENDPOINTAzure Monitor endpoint
TELEMETRY__AZURE_MONITOR__HEADERSAdditional headers
TELEMETRY__AZURE_MONITOR__API_KEYAPI key/instrumentation key
TELEMETRY__AZURE_MONITOR__INSECUREtrue/false

OpenSearch / Logging

VariableDescription
TELEMETRY__OPENSEARCH__INDEX_PREFIXOptional index prefix
TELEMETRY__LOGGING__*No options required

Asterisk AudioSocket

The AudioSocket server binds on a separate TCP port. Asterisk dials into this port directly.
VariableDefaultDescription
AUDIOSOCKET__HOST0.0.0.0Bind address for the AudioSocket TCP server
AUDIOSOCKET__PORT4573TCP port for AudioSocket connections
Asterisk dialplan usage:
same = n,AudioSocket(${RAPIDA_CONTEXT_ID},assistant-api-host:4573)

SIP Server

The built-in SIP server handles direct SIP INVITE connections and Asterisk SIP trunk connections.
VariableDefaultDescription
SIP__SERVER0.0.0.0Bind address for SIP
SIP__EXTERNAL_IP0.0.0.0Public IP advertised in SDP and SIP Contact headers — must be your server’s public IP
SIP__PORT5090SIP signalling port (UDP)
SIP__TRANSPORTudpudp · tcp
SIP__RTP_PORT_RANGE_START10000RTP media port range start
SIP__RTP_PORT_RANGE_END20000RTP media port range end
Set SIP__EXTERNAL_IP to your server’s public IP address. If this is set to 0.0.0.0, SDP answers will advertise the wrong address and media will not flow for callers outside the local network.
SIP connection string:
sip:{assistantID}:{apiKey}@{SIP__EXTERNAL_IP}:{SIP__PORT}

Full Environment File

# ── Service identity ──────────────────────────────────────────────
SERVICE_NAME=workflow-api
HOST=0.0.0.0
PORT=9007
LOG_LEVEL=debug
SECRET=rpd_pks
ENV=development

# ── Asset storage ─────────────────────────────────────────────────
ASSET_STORE__STORAGE_TYPE=local
ASSET_STORE__STORAGE_PATH_PREFIX=/app/rapida-data/assets/workflow
ASSET_STORE__PUBLIC_URL_PREFIX=http://localhost:8080/rapida-data/assets/workflow

# ── PostgreSQL ────────────────────────────────────────────────────
POSTGRES__HOST=postgres
POSTGRES__DB_NAME=assistant_db
POSTGRES__AUTH__USER=rapida_user
POSTGRES__AUTH__PASSWORD=rapida_db_password
POSTGRES__PORT=5432
POSTGRES__MAX_OPEN_CONNECTION=50
POSTGRES__MAX_IDEAL_CONNECTION=25
POSTGRES__SSL_MODE=disable
POSTGRES__SLC_CACHE__HOST=redis
POSTGRES__SLC_CACHE__PORT=6379
POSTGRES__SLC_CACHE__MAX_CONNECTION=10
POSTGRES__SLC_CACHE__DB=1

# ── Redis ─────────────────────────────────────────────────────────
REDIS__HOST=redis
REDIS__PORT=6379
REDIS__MAX_CONNECTION=10
REDIS__MAX_DB=0

# ── OpenSearch (optional — remove or leave empty to disable knowledge base) ──
# OPENSEARCH__SCHEMA=http
# OPENSEARCH__HOST=opensearch
# OPENSEARCH__PORT=9200
# OPENSEARCH__MAX_RETRIES=3
# OPENSEARCH__MAX_CONNECTION=10

# ── Internal service addresses ────────────────────────────────────
INTEGRATION_HOST=integration-api:9004
ENDPOINT_HOST=endpoint-api:9005
ASSISTANT_HOST=assistant-api:9007
WEB_HOST=web-api:9001
# DOCUMENT_HOST=http://document-api:9010   # optional — only needed for knowledge base
UI_HOST=https://localhost:3000

# ── Public hostname (required for telephony) ──────────────────────
PUBLIC_ASSISTANT_HOST=your-public-hostname.example.com

# ── Asterisk AudioSocket ──────────────────────────────────────────
AUDIOSOCKET__HOST=0.0.0.0
AUDIOSOCKET__PORT=4573

# ── SIP Server ────────────────────────────────────────────────────
SIP__SERVER=0.0.0.0
SIP__EXTERNAL_IP=0.0.0.0
SIP__PORT=5090
SIP__TRANSPORT=udp
SIP__RTP_PORT_RANGE_START=10000
SIP__RTP_PORT_RANGE_END=20000

Local Development Overrides

When running from source, override Docker hostnames:
export $(grep -v '^#' docker/assistant-api/.assistant.env | xargs)
export POSTGRES__HOST=localhost
export REDIS__HOST=localhost
export INTEGRATION_HOST=localhost:9004
export ENDPOINT_HOST=localhost:9005
export WEB_HOST=localhost:9001

# Optional: only needed for knowledge base features
# export OPENSEARCH__HOST=localhost
# export DOCUMENT_HOST=http://localhost:9010

go run cmd/assistant/assistant.go

Next Steps

STT / TTS Providers

Configure and add speech recognition and synthesis providers.

Telephony

Twilio, Asterisk, SIP, and other telephony provider setup.