OpenAgent
Deployment

Configuration Reference

All configuration options for OpenAgent.

Configuration Reference

OpenAgent is configured via environment variables (recommended for Docker) or the conf/app.conf file (for source deployments).

Application

VariableDefaultDescription
APP_SECRET_KEYRequired. Secret key for session signing. Generate with openssl rand -hex 32.
APP_HOST0.0.0.0Bind address for the HTTP server
APP_PORT14000HTTP port
APP_DOMAINPublic domain (used for webhook URLs)
APP_ENVproductionproduction or development
LOG_LEVELinfodebug, info, warn, error

Database

VariableDefaultDescription
DB_HOSTlocalhostMySQL host
DB_PORT3306MySQL port
DB_NAMEopenagentDatabase name
DB_USERopenagentDatabase user
DB_PASSWORDRequired. Database password
DB_MAX_OPEN_CONNS100Max open connections in pool
DB_MAX_IDLE_CONNS10Max idle connections in pool

Authentication (Casdoor)

OpenAgent uses Casdoor for SSO and user management.

VariableDefaultDescription
CASDOOR_ENDPOINThttp://casdoor:8000Casdoor service URL
CASDOOR_CLIENT_IDOAuth2 client ID from Casdoor
CASDOOR_CLIENT_SECRETOAuth2 client secret from Casdoor
CASDOOR_ORG_NAMEbuilt-inCasdoor organization name
CASDOOR_APP_NAMEopenagentCasdoor application name

The Docker Compose setup configures Casdoor automatically. These variables only need to be set manually for custom deployments.

File Storage

VariableDefaultDescription
STORAGE_PROVIDERlocallocal, s3, gcs, azure_blob
STORAGE_LOCAL_PATH./uploadsPath for local storage
STORAGE_S3_BUCKETS3 bucket name
STORAGE_S3_REGIONAWS region
STORAGE_S3_ACCESS_KEYAWS access key ID
STORAGE_S3_SECRET_KEYAWS secret access key
STORAGE_S3_ENDPOINTCustom S3 endpoint (for MinIO, etc.)
STORAGE_MAX_FILE_SIZE100MBMaximum upload size

Knowledge Base

VariableDefaultDescription
KB_CHUNK_SIZE512Default chunk size in tokens
KB_CHUNK_OVERLAP50Overlap between chunks in tokens
KB_DEFAULT_TOP_K5Default number of chunks to retrieve
KB_SIMILARITY_THRESHOLD0.7Minimum similarity score for retrieval

Rate Limiting

VariableDefaultDescription
RATE_LIMIT_ENABLEDtrueEnable per-user rate limiting
RATE_LIMIT_RPM60Requests per minute per user
RATE_LIMIT_BURST10Burst capacity

Security

VariableDefaultDescription
CORS_ORIGINS*Comma-separated allowed origins
CSRF_ENABLEDtrueEnable CSRF protection
SECURE_COOKIEStrueSet Secure flag on cookies (requires HTTPS)
ADMIN_EMAILEmail for the initial admin account
ADMIN_PASSWORDPassword for the initial admin account

Email (Optional)

Required for password reset and email notifications.

VariableDefaultDescription
SMTP_HOSTSMTP server hostname
SMTP_PORT587SMTP port
SMTP_USERSMTP username
SMTP_PASSWORDSMTP password
SMTP_FROMSender email address
SMTP_TLStrueEnable STARTTLS

Multi-Tenancy

VariableDefaultDescription
MULTI_TENANTfalseEnable multi-tenant mode
TENANT_ISOLATIONdatabasedatabase (separate DB per tenant) or schema

Performance

VariableDefaultDescription
WORKER_CONCURRENCY4Number of concurrent background workers
CACHE_ENABLEDtrueEnable in-memory caching
CACHE_TTL300Cache TTL in seconds

Example .env File

.env
# Application
APP_SECRET_KEY=your-64-char-secret-here
APP_DOMAIN=https://ai.yourcompany.com
LOG_LEVEL=info

# Database
DB_HOST=db
DB_PORT=3306
DB_NAME=openagent
DB_USER=openagent
DB_PASSWORD=secure-db-password
DB_ROOT_PASSWORD=secure-root-password

# Storage (S3 example)
STORAGE_PROVIDER=s3
STORAGE_S3_BUCKET=my-openagent-uploads
STORAGE_S3_REGION=us-east-1
STORAGE_S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
STORAGE_S3_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

# Admin account (first run only)
ADMIN_EMAIL=admin@yourcompany.com
ADMIN_PASSWORD=change-me-after-first-login

# Email
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=SG.xxxxx
SMTP_FROM=noreply@yourcompany.com

Never commit .env files to version control. Add .env to your .gitignore.

On this page