v0.17 storage refactor. The service now exposes a single, flat
storage surface:
memory, disk (embedded RocksDB), or s3 (AWS S3
or any S3-compatible store). The previous standalone, postgres,
and redis backends — and the catch-all CYBORGDB_CONNECTION_STRING
— are gone. If you are upgrading from v0.16: switch
standalone → disk and replace CYBORGDB_CONNECTION_STRING with
the new CYBORGDB_DISK_PATH / CYBORGDB_S3_* variables.API Key and Tiers
| Variable | Description | Example |
|---|---|---|
CYBORGDB_API_KEY | (Optional) Your CyborgDB license key. Doubles as the value clients must send in the X-API-Key request header when REQUIRE_API_KEY=true. If unset, the service runs in free tier mode (per-index cap of 1,000,000 items). Set a paid key for unlimited usage. | cyborg_abc123... |
Free tier vs paid.
CYBORGDB_API_KEY is the single switch between the two:- Unset → free tier. cyborgdb-core enforces a 1M-item-per-index cap. The startup banner prints
CYBORGDB_API_KEY not set — running in free tier. For evaluation only. - Set to a paid key (from the CyborgDB dashboard) → unlimited items, full feature set.
- Set to a demo key (from
cyborgdb.get_demo_api_key()/getDemoApiKey()/cyborgdb.GetDemoAPIKey(...)) → also free tier, time-limited. Useful for getting a real-looking key intoX-API-Keywithout dashboard signup.
X-API-Key header (assuming REQUIRE_API_KEY=true, the default).RBAC / Multi-Tenancy
CyborgDB Service can run in single-key mode (default) or with role-based access control enabled. RBAC is opt-in: settingCYBORGDB_SERVICE_ROOT_KEY switches the service into RBAC mode, after which the legacy single key is no longer accepted on index routes — only the root key or a minted per-user cdbk_… key.
| Variable | Description | Default |
|---|---|---|
CYBORGDB_SERVICE_ROOT_KEY | When set, enables RBAC. The holder of this key has full admin access and can mint per-user API keys via POST /v1/indexes/{index_name}/users. Per-user keys are scoped to one index with read / write permissions enforced cryptographically. | unset (RBAC off) |
INDEX_KEK_CACHE_TTL_SECONDS | TTL for plaintext index KEKs in the service-side cache. Shorter = faster KMS revocation propagation; longer = fewer KMS calls. | 60 |
Storage Backend
Pick one ofmemory, disk, or s3. If CYBORGDB_DB_TYPE is unset,
the service defaults to disk.
| Variable | Description | Default | Example |
|---|---|---|---|
CYBORGDB_DB_TYPE | Storage backend: memory, disk, or s3 | disk | s3 |
Disk (default)
Embedded RocksDB. Persistent local key-value storage with no external dependency.| Variable | Description | Default |
|---|---|---|
CYBORGDB_DISK_PATH | Data directory for the RocksDB store | ~/.cyborgdb/data (local) / /app/cyborgdb_data (Docker) |
Memory
In-process storage. Nothing persists across restarts. Use only for tests and ephemeral indexes.S3
AWS S3 or any S3-compatible store (MinIO, Cloudflare R2, …).| Variable | Description | Required for S3 |
|---|---|---|
CYBORGDB_S3_BUCKET | Bucket name | ✅ |
CYBORGDB_S3_REGION | Bucket region | Optional (defaults to us-east-1) |
CYBORGDB_S3_PREFIX | Key prefix for stored objects | Optional |
CYBORGDB_S3_ENDPOINT | Custom endpoint URL (MinIO, R2, …) | Required for non-AWS endpoints |
CYBORGDB_S3_ACCESS_KEY | S3 access key ID | Required with CYBORGDB_S3_ENDPOINT |
CYBORGDB_S3_SECRET_KEY | S3 secret access key | Required with CYBORGDB_S3_ENDPOINT |
CYBORGDB_S3_SESSION_TOKEN | Optional temporary session token | Optional |
S3 credential resolution
The S3 client resolves credentials independently of any KMS client:- On AWS (EC2 / ECS / EKS), real S3. Leave all
CYBORGDB_S3_*credential variables unset. The AWS default credential provider chain picks up the instance/task role. - Off AWS, real S3. Provide
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY(or a mounted AWS profile). The default chain picks them up. - S3-compatible endpoint (MinIO, R2, …). Set
CYBORGDB_S3_ENDPOINTplus explicitCYBORGDB_S3_ACCESS_KEY/CYBORGDB_S3_SECRET_KEY. A custom endpoint is not AWS — the AWS chain is never used against it, and startup fails fast if the explicit keys are missing.
CYBORGDB_S3_* namespace is deliberately separate from AWS_*
so storage credentials cannot collide with KMS credentials.
Optional Environment Variables
Service Configuration
Service Configuration
| Variable | Description | Default |
|---|---|---|
PORT | HTTP port for the service | 8000 |
CYBORGDB_SERVICE_LOG_LEVEL | Log level (DEBUG, INFO, WARNING, ERROR) | INFO |
REQUIRE_API_KEY | Whether the X-API-Key header is required on requests | true |
TLS / HTTPS
TLS / HTTPS
| Variable | Description | Default |
|---|---|---|
SSL_CERT_PATH | Path to TLS certificate | unset (HTTP) |
SSL_KEY_PATH | Path to TLS private key | unset (HTTP) |
HTTPS is enabled automatically when both
SSL_CERT_PATH and SSL_KEY_PATH are set and both files exist. Otherwise the service starts on HTTP.Per-keystore RAM cache
Per-keystore RAM cache
Applied to every newly created index.
cyborgdb-core caches
nothing by default; opt in here per keystore.| Variable | Description | Default |
|---|---|---|
CACHE_POLICY_VECTORS | Cache vector payloads in RAM | false |
CACHE_POLICY_METADATA | Cache metadata in RAM | false |
CACHE_POLICY_IDS | Cache item IDs in RAM | false |
Performance
Performance
| Variable | Description | Default |
|---|---|---|
CPU_THREADS | Worker threads. 0 = auto-detect | 0 |
GPU_OPERATIONS | GPU-accelerated ops: none, upsert, train, all, or comma-separated (e.g. upsert,train) | none |
RETRAIN_THRESHOLD | Auto-retrain trigger — fires when num_vectors > n_lists * RETRAIN_THRESHOLD | 10000 |
AUTO_TRAIN_DISABLED | Fully disable post-upsert auto-training. Explicit train() / POST /v1/indexes/train still work. Useful for benchmarking a fixed index state or controlling training timing yourself. Also implied when RETRAIN_THRESHOLD < 0. | false |
GPU-accelerated query is not yet supported by
cyborgdb-core. Passing query in GPU_OPERATIONS is silently ignored.Per-index KMS
Per-index KMS
Per-index KMS (BYOK) is configured exclusively via the YAML
file’s
kms.registry block — see the
KMS / BYOK guide. The related environment
variable is documented above under RBAC / Multi-Tenancy (INDEX_KEK_CACHE_TTL_SECONDS).YAML Configuration File
Every setting above is also expressible in a YAML file. The file is resolved in this order (first hit wins):CYBORGDB_CONFIG_FILEenvironment variable./cyborgdb.yaml,./cyborgdb.yml,/etc/cyborgdb/cyborgdb.yaml
CYBORGDB_CONFIG_FILE path that doesn’t exist is a hard
error.
cyborgdb.yaml
.env > YAML
file > file secrets.
Env-var substitution. Any string value in the YAML may reference
an environment variable as ${VAR} (required — startup fails if
unset) or ${VAR:-default} (uses default when unset). This lets
you keep BYOK role ARNs / account IDs out of the checked-in file. A
variable set to the empty string counts as unset.
Configuration Examples
Quick start (disk, default)
Quick start (disk, default)
In-memory (tests only)
In-memory (tests only)
S3 on AWS with instance role
S3 on AWS with instance role
S3 on MinIO with explicit credentials
S3 on MinIO with explicit credentials
Production with HTTPS
Production with HTTPS
Docker
Pass any of the variables above todocker run with -e:
--env-file:
Troubleshooting
Missing API key
Missing API key
Set
CYBORGDB_API_KEY. Check for typos. Keys start with
cyborg_.`Invalid CYBORGDB_DB_TYPE`
`Invalid CYBORGDB_DB_TYPE`
v0.17 only accepts
memory, disk, or s3. The legacy
standalone, postgres, and redis values are gone. If
you were on standalone, switch to disk and set
CYBORGDB_DISK_PATH if you used a custom directory.S3 startup fails with missing credentials
S3 startup fails with missing credentials
With
CYBORGDB_S3_ENDPOINT set, the AWS default credential
chain is bypassed entirely. Provide
CYBORGDB_S3_ACCESS_KEY and CYBORGDB_S3_SECRET_KEY
explicitly.TLS not enabling
TLS not enabling
Both
SSL_CERT_PATH and SSL_KEY_PATH must be set and
both files must exist on disk before the service starts.
Missing either falls back to HTTP silently.