> ## Documentation Index
> Fetch the complete documentation index at: https://docs.langbot.app/llms.txt
> Use this file to discover all available pages before exploring further.

# System Environment Settings

Configure system runtime settings in `data/config.yaml`.
Generally, no modification is needed.

```yaml theme={null}
admins: []
api:
    port: 5300
    webhook_prefix: 'http://127.0.0.1:5300'
    extra_webhook_prefix: ''
command:
    enable: true
    prefix:
    - '!'
    - ！
    privilege: {}
concurrency:
    pipeline: 20
    session: 1
proxy:
    http: ''
    https: ''
system:
    instance_id: ''
    edition: community
    recovery_key: ''
    allow_modify_login_info: true
    disabled_adapters: []
    limitation:
        max_bots: -1
        max_pipelines: -1
        max_extensions: -1
    task_retention:
        # Keep at most this many completed async task records in memory
        completed_limit: 200
    jwt:
        expire: 604800
        secret: ''
database:
    use: sqlite
    sqlite:
        path: 'data/langbot.db'
    postgresql:
        host: '127.0.0.1'
        port: 5432
        user: 'postgres'
        password: 'postgres'
        database: 'postgres'
vdb:
    use: chroma
    qdrant:
        url: ''
        host: localhost
        port: 6333
        api_key: ''
    seekdb:
        mode: embedded  # 'embedded' or 'server'
        # Embedded mode options:
        path: './data/seekdb'
        database: 'langbot'
        # Server mode options (used when mode='server'):
        host: 'localhost'
        port: 2881
        user: 'root'
        password: ''
        tenant: ''  # Optional, for OceanBase server
    milvus:
        uri: 'http://127.0.0.1:19530'
        token: ''
        db_name: ''
    pgvector:
        host: '127.0.0.1'
        port: 5433
        database: 'langbot'
        user: 'postgres'
        password: 'postgres'
storage:
    use: local
    cleanup:
        # Enable periodic cleanup of local/S3 uploaded files and old log files
        enabled: true
        # Cleanup check interval in hours
        check_interval_hours: 1
        # Root-level uploaded files older than this will be deleted
        uploaded_file_retention_days: 7
        # LangBot log files older than this many days will be deleted
        log_retention_days: 3
    s3:
        endpoint_url: ''
        access_key_id: ''
        secret_access_key: ''
        region: 'us-east-1'
        bucket: 'langbot-storage'
plugin:
    enable: true
    runtime_ws_url: 'ws://langbot_plugin_runtime:5400/control/ws'
    enable_marketplace: true
    display_plugin_debug_url: 'ws://localhost:5401/plugin/debug/ws'
    binary_storage:
        # Max bytes for a single plugin binary storage value
        max_value_bytes: 10485760
monitoring:
    auto_cleanup:
        # Enable automatic cleanup of expired monitoring records
        enabled: true
        # Retention period in days, records older than this will be deleted
        retention_days: 30
        # Cleanup check interval in hours
        check_interval_hours: 1
        # Number of expired rows to delete per table batch
        delete_batch_size: 1000
space:
    # Space service URL for OAuth and API
    url: 'https://space.langbot.app'
    # Space API URL for model requests (MaaS)
    models_gateway_api_url: 'https://api.langbot.cloud/v1'
    # OAuth authorization page URL
    oauth_authorize_url: 'https://space.langbot.app/auth/authorize'
    disable_models_service: false
    disable_telemetry: false
```

## Notes

* `storage.cleanup.uploaded_file_retention_days` only cleans temporary uploaded files at the storage root. It does not delete plugin configuration files or internal objects stored under directories.
* `storage.cleanup.log_retention_days` cleans old log files by the date in their file names. The default keeps at most 3 days of logs.
* When SQLite is used as the database, automatic monitoring cleanup directly releases database file space after deleting expired records.
* `plugin.binary_storage.max_value_bytes` limits the size of a single plugin binary storage value. The default is 10 MiB.
* The WebUI sidebar includes a “Storage Analysis” page for viewing database, logs, uploaded files, vector store, plugins, MCP, temporary files, and cleanup candidates.

## Set Configuration Via Environment Variables

The configuration in `config.yaml` can be set via environment variables. Environment variable names use uppercase letters and double underscores, for example: `API__PORT` represents `api.port`.

* `API__PORT` represents `api.port`
* `CONCURRENCY__PIPELINE` represents `concurrency.pipeline`
* `DATABASE__SQLITE__PATH` represents `database.sqlite.path`
* `STORAGE__CLEANUP__UPLOADED_FILE_RETENTION_DAYS` represents `storage.cleanup.uploaded_file_retention_days`
* `STORAGE__CLEANUP__LOG_RETENTION_DAYS` represents `storage.cleanup.log_retention_days`
* `MONITORING__AUTO_CLEANUP__RETENTION_DAYS` represents `monitoring.auto_cleanup.retention_days`
* `PLUGIN__BINARY_STORAGE__MAX_VALUE_BYTES` represents `plugin.binary_storage.max_value_bytes`

On startup, LangBot reads all environment variables, applies the corresponding configuration to `config.yaml`, and writes it to `data/config.yaml`.
