Storage Configuration
Configure where Reflexio stores data, including SQLite (default), Supabase, and PostgreSQL for production deployments.
Storage Configuration
Storage configuration determines where Reflexio stores data.
Default Storage (Open Source)
The open-source version uses SQLite by default — no storage configuration is needed. Reflexio automatically creates and manages a local SQLite database, so you can start using it immediately without any setup.
# No storage configuration required — SQLite is used automatically
client = ReflexioClient() # see Quickstart for connection options
config = client.get_config()
# config.storage_config is already set to SQLiteSupabase Storage
Enterprise
Reflexio Enterprise uses Supabase for storage with automatic provisioning and managed infrastructure. Hosted accounts are configured with managed storage when you create an account. You can switch to your own Supabase project from Settings; self-hosted Enterprise deployments can configure Supabase as shown below.
For production deployments that need managed cloud storage, you can configure Supabase manually:
from reflexio.models.config_schema import StorageConfigSupabase
storage = StorageConfigSupabase(
url="https://your-project.supabase.co",
key="your_service_role_key",
db_url="postgresql://...",
# Optional: route search reads through a read-only PostgREST endpoint
read_url="https://your-reader.supabase.co",
read_key="your_reader_key",
)
config.storage_config = storage
client.set_config(config)| Field | Type | Description |
|---|---|---|
url | str | Supabase project URL |
key | str | Supabase service-role key (needs write access) |
db_url | str | PostgreSQL connection string |
read_url | str | Optional. Supabase reader URL for search. Defaults to url. |
read_key | str | Optional. Reader key for search. Defaults to key. |
schema | str | Optional. Used by hosted Reflexio for platform-managed per-org schemas. Omit this for bring-your-own Supabase storage. |
Search uses reader credentials when provided, so search results can be bounded-stale on replicated infrastructure. Mutations and publish/generation consistency reads continue to use the writer credentials.
PostgreSQL Storage
Enterprise
Reflexio Enterprise can also store data in a customer-owned PostgreSQL database, such as AWS RDS, without running Supabase or PostgREST. Auth/login storage remains separate from data storage.
from reflexio.models.config_schema import StorageConfigPostgres
storage = StorageConfigPostgres(
db_url="postgresql://user:password@host:5432/database",
schema="public",
# Optional reader pool for search traffic
read_db_url="postgresql://user:password@reader:5432/database",
read_pool_size=10,
)
config.storage_config = storage
client.set_config(config)| Field | Type | Description |
|---|---|---|
db_url | str | PostgreSQL connection string |
schema | str | Optional. Target schema for Reflexio data. Defaults to public. |
pool_size | int | Optional. Maximum direct SQL connections per process (per organization). Defaults to 10. |
pool_acquire_timeout | float | Optional. Seconds a query waits for a free pooled connection before failing. Defaults to 30.0. |
read_db_url | str | Optional. Reader PostgreSQL connection string for search. Defaults to db_url. |
read_pool_size | int | Optional. Maximum reader connections per process. Defaults to pool_size. |
read_pool_acquire_timeout | float | Optional. Seconds search waits for a free reader connection. Defaults to pool_acquire_timeout. |
PostgreSQL storage requires PostgreSQL 14+ with pgvector available.
The pool is shared by all concurrent work for an organization. When in-flight
queries exceed pool_size, additional queries queue for up to
pool_acquire_timeout seconds rather than failing immediately; only a query that
waits longer than the timeout raises an error. Because pool_size is per
organization, the total server-side connection count scales with the number of
active organizations — size it against your database's max_connections.
In self-host deployments, pool settings can be set without editing config via
REFLEXIO_POSTGRES_POOL_SIZE, REFLEXIO_POSTGRES_POOL_ACQUIRE_TIMEOUT,
REFLEXIO_POSTGRES_READ_DB_URL, REFLEXIO_POSTGRES_READ_POOL_SIZE, and
REFLEXIO_POSTGRES_READ_POOL_ACQUIRE_TIMEOUT.
Search/read timeout knobs are also available for production deployments:
REFLEXIO_SUPABASE_HTTP_TIMEOUT_SECONDS for Supabase/PostgREST and
REFLEXIO_POSTGRES_STATEMENT_TIMEOUT_MS for native Postgres.
Row Retention
Reflexio applies high-water row limits to data tables on the publish path. When
an eligible table reaches its limit, the server deletes the oldest 20% of rows
for that table by created_at.
# Defaults to 250000 rows per target
REFLEXIO_ROW_LIMIT_INTERACTIONS=500000
REFLEXIO_ROW_LIMIT_PROFILES=250000
# Set a target to 0 to disable its cleanup
REFLEXIO_ROW_LIMIT_PLAYBOOK_OPTIMIZATION_EVENTS=0The legacy INTERACTION_CLEANUP_THRESHOLD variable still applies to
interactions when REFLEXIO_ROW_LIMIT_INTERACTIONS is unset.
Enterprise Self-Host Single Database
Enterprise
Enterprise self-host deployments can run with one customer-owned database for both login metadata and Reflexio data. Set DEPLOYMENT_MODE=self_host, choose REFLEXIO_STORAGE=supabase or REFLEXIO_STORAGE=postgres, and provide SELF_HOST_USERNAME / SELF_HOST_PASSWORD for the only login account.
For Supabase self-host, configure DATA_SUPABASE_URL, DATA_SUPABASE_KEY, and DATA_DB_URL. For vanilla Postgres self-host, configure DATA_DB_URL. Startup applies auth and data migrations to that same database and stores the generated configuration_json in public.organizations.