If you use PostgreSQL for any store, the target database must be UTF8 encoded. See PostgreSQL UTF8 Requirement.
config_store
When
config_store is omitted, Bifrost creates a default SQLite config store in the app directory. Set config_store.enabled to false only when you want file-only configuration with no config-backed Web UI/API edits. See Source of Truth & Reconciliation.SQLite (Default)
Simplest setup - no external database required. Bifrost stores configuration in a local SQLite file.PostgreSQL
Production-grade storage suitable for high-availability and high-throughput deployments.
Use
password_command for short-lived database credentials such as AWS RDS IAM auth tokens:
Disabled (file-only mode)
Use this when you want Bifrost to read all configuration fromconfig.json only - no configuration database and no config-backed Web UI/API edits.
config.json is the single source of truth.
logs_store
Useclient.hidden_request_types to hide selected request types from dashboard and log API reads while continuing to store their logs. The same setting is editable in the UI under Logs Settings. See Hiding request types from the dashboard for configuration examples and behavior.
SQLite
PostgreSQL
logs_store supports the same dynamic PostgreSQL credential fields as config_store:
For high log volumes, increase
max_open_conns:
ClickHouse
A column-oriented backend built for high-volume log ingestion and fast analytical queries. Best suited for large-scale deployments where log throughput and dashboard query performance on big time ranges matter more than operational simplicity.ClickHouse is a
logs_store-only backend. The config_store supports only sqlite and postgres — pair a ClickHouse logs store with a SQLite or PostgreSQL config store (see Mixed Backend Examples).host is the only required field; the rest have sensible defaults.
TLS + HTTP protocol against a managed ClickHouse (e.g. ClickHouse Cloud):
cluster so tables are created with replicated engines across the cluster:
With ClickHouse,
retention_days is enforced by a native table TTL rather than a background delete job. The TTL is reconciled on every startup, so changing retention_days later updates the existing logs, mcp_tool_logs and webhook_deliveries tables (metadata only; expired rows are dropped by ClickHouse’s regular TTL merges). Setting it to 0 (or omitting it) leaves any existing TTL untouched and creates new tables without one, so ClickHouse itself never expires rows unless you manage the TTL yourself. Background cleanup is controlled separately by client_config.log_retention_days; on ClickHouse each run is a single lightweight DELETE FROM ... WHERE created_at < cutoff, as are the periodic sweeps of stale processing rows, so setting both is safe. Lightweight deletes require ClickHouse 24.4 or newer. matview_refresh_interval and matview_refresh_timeout do not apply - they are PostgreSQL-only settings for materialized views.Required privileges
Bifrost creates and evolves its own tables on every startup, so the ClickHouse user needs DDL rights as well as read and write access. The database itself must already exist. Bifrost does not create it.bifrost with your database and bifrost_user with your user.
Managed services such as ClickHouse Cloud do not let a user read
system tables without an explicit grant. A missing grant fails startup with Not enough privileges ... SELECT ON system.data_skipping_indices.The user’s settings profile must not be readonly. Bifrost sets query settings such as final, mutations_sync and max_query_size on its connections.Disabled
Log Retention
Setretention_days to automatically purge old log entries. 0 disables retention-based cleanup.
Disk space on PostgreSQL
Retention deletes expired rows every hour. PostgreSQL keeps the space of deleted rows inside the table and reuses it for new logs once autovacuum has processed them, so with retention on, the tables stay near their steady-state size instead of growing. Bifrost setsautovacuum_vacuum_scale_factor = 0.01 and autovacuum_vacuum_threshold = 10000 on logs, mcp_tool_logs, relay_logs, warp_topic_assignments and warp_topic_unmatched, so autovacuum runs after about 1% of a table is dead rows instead of PostgreSQL’s default 20%. The migration replaces any per-table values for these two parameters that you set yourself, and rolling it back resets them to the server defaults. Reapply your own values after upgrading if you tuned these tables by hand.
The tables do not shrink on their own. To give space back to the filesystem after lowering retention_days or after a large backlog, use pg_repack. It rewrites a table while reads and writes continue, taking an exclusive lock only briefly at the start and the end. If a long query holds the table when it needs that lock, by default it cancels the query after --wait-timeout and then disconnects the blocking session; pass --no-kill-backend to skip the table instead. It needs the pg_repack extension installed in the database and free disk space of about twice the table and its indexes. Avoid VACUUM FULL on a running deployment: it locks the table for the whole rewrite, so log writes and dashboard queries wait until it finishes.
Client IP capture
Setcapture_client_ip to true to record the caller’s IP on LLM, MCP and relay logs in the client_ip field. Bifrost takes the leftmost X-Forwarded-For value, then X-Real-IP, and falls back to the TCP peer address when neither header is present. This is the same order enterprise audit logs use. The caller sends these headers and Bifrost does not verify them. For an address you can trust, put Bifrost behind a proxy that overwrites both headers, and block direct access to Bifrost so no request can skip the proxy.
It defaults to false. When it’s off, new logs leave client_ip empty in the logs database, the API, CSV exports and object storage. Turning it off doesn’t clear addresses already recorded: logs written while it was on keep their values until log retention deletes those rows. With log retention off, the addresses stay until you delete the logs yourself. The setting is read at startup, so restart Bifrost after changing it. The user email field doesn’t depend on this setting.
Materialized View Refresh Interval (PostgreSQL only)
The PostgreSQL logs store backs the dashboard’s stats and histograms with materialized views, refreshed in the background. The default cadence is 1 minute, which keeps dashboard data near real-time but issues aREFRESH MATERIALIZED VIEW CONCURRENTLY every minute — an expensive operation that can be too aggressive on smaller or CPU-constrained database instances.
Set matview_refresh_interval (Go duration string) to slow down refreshes when near-real-time accuracy isn’t critical:
When a pod stops (restart, scale-down, eviction), it cancels its running refresh and releases the refresh lock before exiting. If the Bifrost process is killed without warning (for example
SIGKILL or an OOM kill), PostgreSQL notices the closed connection within about 10 seconds and stops the statement, which frees the lock for other replicas. Two cases take longer:
- The whole node disappears. No close reaches the database, so it learns the connection is gone only when TCP keepalives fail (PostgreSQL
tcp_keepalives_idle,tcp_keepalives_interval,tcp_keepalives_count; the OS default can be hours). - The database server cannot run connection checks (PostgreSQL supports them on Linux, macOS, illumos and BSD, not on Windows). Bifrost logs a warning once and keeps the other limits.
matview_refresh_timeout, because the database enforces that limit itself. The first build of the views has no time limit, since it can legitimately run long on a large logs table, so in these cases it runs until it finishes or hits matview_refresh_temp_file_limit. Once the statement ends, the database closes the session after one minute idle, which frees the refresh lock for other replicas.
Notes
- The interval is a cluster-wide cadence. Every replica runs its own refresh ticker, but each refresh is recorded in the database (
matview_refresh_state), and a replica skips any view whose last successful refresh, by any replica, finished less thanmatview_refresh_intervalago. So adding replicas does not add refreshes, and a pass that takes longer than the interval is followed by a quiet gap of at least the interval rather than an immediate next pass. A failed or cancelled refresh does not count, so that view is retried on the next tick. - Refreshes are already activity-gated: when no INSERT/UPDATE/DELETE has hit the
logstable since the last refresh, the scheduled tick short-circuits without touching the views. So idle clusters don’t pay for the configured cadence — they only pay when there’s actual log activity. - Dashboard freshness lag will be at most the configured interval. Stats and histograms over the last 24 hours come straight from the raw
logstable (no matview), so short-window dashboards stay real-time regardless of this setting. - A 10-minute safety-net refresh runs even on totally idle clusters so the rolling 30-day filter dropdown window evicts aged-out values.
- Your database instance is CPU-constrained and matview refreshes are showing up as a hot consumer.
- Your team mostly looks at multi-day trends, not minute-by-minute dashboards.
- The database has consistent CPU headroom.
- Operators rely on near-real-time dashboards (e.g. live incident triage).
- You don’t use the Bifrost dashboard (e.g. Bifrost runs headless behind your own observability stack). With
"off", the views are neither created nor refreshed, and any dashboard query transparently uses the raw tables.
Materialized views during upgrades
Schema migrations pause materialized-view refreshes on every replica for as long as they run. On a largelogs table a single refresh pass can take many minutes, and while it runs it holds a snapshot that every CREATE INDEX CONCURRENTLY in the database waits on, plus a lock that ALTER TABLE logs cannot get past. The pause works during a rolling upgrade too: older replicas skip their refresh when the migrating pod holds the refresh lock.
A refresh pass that is already running when migrations start is given migration_matview_cancel_after to finish. After that its REFRESH statements are cancelled. A cancelled concurrent refresh rolls back harmlessly: the view keeps its previous contents and is refreshed again once migrations finish. Sessions are never terminated, and nothing other than a REFRESH MATERIALIZED VIEW is ever cancelled.
Lock waits during upgrades
A migration that alters a table (ALTER TABLE logs ADD COLUMN, for example) needs an exclusive lock, which it only gets in a gap between other sessions’ queries on that table. Each attempt waits at most 5 seconds, then the step backs off and retries. The first timeout logs the sessions holding the table, with a pg_cancel_backend hint, so an operator can cancel an old replica’s long read instead of waiting it out. When the budget runs out the process exits and the next start retries from where it left off.
Upgrading to a release without this pause (for example 2.2.x to 2.3.0) on a large log store: the old replicas keep refreshing and the new pods’ migrations can stall behind them. Before you roll, either restart the old replicas with
matview_refresh_interval set to "off" (restore it after the upgrade), or have an operator cancel REFRESH MATERIALIZED VIEW statements from the old pods with pg_cancel_backend while the new pods migrate.Object Storage for Logs
Offload LLM request/response logs and MCP tool logs from the database to S3, GCS, or Azure Blob Storage. The database retains lightweight index records and fetches full payloads on demand. For MCP logs, the full tool log is stored in object storage and the database keeps dashboard/table fields plus a 200-character input preview.AWS S3
Required IAM permissions The IAM user or role needs the following permissions on your bucket:access_key_id and secret_access_key:
Using KMS to encrypt your bucket?
Using KMS to encrypt your bucket?
- Attach this IAM policy to whichever AWS principal Bifrost authenticates as: the IAM user behind
access_key_id/secret_access_key, or the IAM role behindrole_arn:
- If you’re using a customer-managed key (not the AWS-managed
aws/s3key), it also needs permission granted separately on the key’s own policy (in the KMS console). Add that same IAM user or role ARN there too (AWS guide). AWS-managed keys don’t allow their key policy to be edited, so this step doesn’t apply if you’re using the defaultaws/s3key.
Default encryption applies KMS without requiring encryption headers from the uploader. Bifrost’s IAM identity still needs the KMS permissions above regardless of encryption mode. If instead your bucket policy denies uploads that don’t include the encryption header, note that Bifrost does not send that header, so uploads will fail under that policy.
Google Cloud Storage
credentials_json to use Application Default Credentials (Workload Identity, GCE metadata, gcloud auth).
Azure Blob Storage
Create the container before starting Bifrost. Setbucket to the container name, not the storage account name.
endpoint uses DefaultAzureCredential: managed identity, workload identity, or a service principal configured through AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET. These credentials are separate from Azure model-provider credentials.
For connection-string authentication, replace endpoint with "connection_string": "env.AZURE_STORAGE_CONNECTION_STRING". Set only one. bucket, endpoint, and connection_string accept environment or vault references and must resolve to nonempty values.
Grant Storage Blob Data Contributor on the container, or equivalent read/write/list/delete permissions. Blob index-tag permissions are not needed.
Azure supports JSON/gzip and Parquet for logs, and also stores skills files. See Log exports for format options.
MinIO (Self-Hosted)
vector_store
A vector store is required for semantic caching. Choose from Weaviate, Redis/Valkey, Qdrant, or Pinecone.Weaviate
Redis / Valkey
Qdrant
Pinecone
Pinecone is external-only.Mixed Backend Examples
Each store is configured independently, so you can run the config store and logs store on different backends — or even different database instances. This is useful when config and logs have different scaling, cost, or retention profiles.In
config.json each store carries its own config block, so the two stores can point at entirely separate hosts. The Helm chart shares one PostgreSQL connection across both stores by default; set storage.logsStore.postgres.enabled: true to point the logs store at a separate PostgreSQL instance. See Separate PostgreSQL for Logs.
