Skip to main content
CyborgDB Service uses environment variables to configure various aspects of the service, such as database connections, API keys, SSL settings, and performance tuning. This allows for flexible configuration without hardcoding values in your codebase. Below are the key environment variables you can set for the CyborgDB service:

Required Environment Variables

These environment variables must be set for the service to run:
The service requires CYBORGDB_API_KEY to start. Database configuration is optional - see below for details.

Database Configuration

Default Behavior: If you don’t set CYBORGDB_DB_TYPE or CYBORGDB_CONNECTION_STRING, the service automatically uses a built-in standalone instance for evaluation and testing. Data is stored in a ~/.cyborgdb/data directory (local) or /app/cyborgdb_data (Docker).For production deployments, you should configure an external Redis or PostgreSQL database:
Important: CYBORGDB_CONNECTION_STRING is required when CYBORGDB_DB_TYPE is set to redis or postgres. For standalone, the connection string is optional and can be used to override the default data directory path. For memory, no connection string is needed.Standalone is for EVALUATION ONLY - For production use, configure an external PostgreSQL or Redis database.

Optional Environment Variables

When both SSL_CERT_PATH and SSL_KEY_PATH are provided and the files exist, the service automatically enables HTTPS.
These variables provide granular control over database connections. If not set, they fall back to the main database configuration:
These variables allow you to customize the table/collection names used by the service:
These variables allow you to optimize performance based on your hardware and workload:
GPU_OPERATIONS valid values: none, upsert, train, query, all, or comma-separated (e.g., upsert,train).RETRAIN_THRESHOLD controls when auto-training triggers: training is initiated when num_vectors > n_lists * RETRAIN_THRESHOLD.
These variables control system-level settings:

Connection Formats

Use the standard PostgreSQL connection string format:
Parameters:
  • host - Database server hostname
  • port - Database server port (default: 5432)
  • dbname - Database name
  • user - Database username
  • password - Database password
Use a comma-separated format for Redis connections:
Parameters:
  • host - Redis server hostname
  • port - Redis server port (default: 6379)
  • db - Redis database number (default: 0)
  • password - Redis password (optional)
Redis URI format (redis:// or rediss://) is not supported. Use the comma-separated format shown above.
The standalone backend uses a local directory for data storage. A connection string is not required — if omitted, the default path is used.
  • Local default: ~/.cyborgdb/data
  • Docker default: /app/cyborgdb_data
To override the data directory path, set the connection string to a custom path:

Configuration Examples

Standalone is for evaluation and testing only. For production, configure an external database.

Docker Configuration

When using Docker, you can pass environment variables using the -e flag:
Or use an environment file:

Environment Variable Priority

Environment variables are loaded in the following order (later sources override earlier ones):
  1. Default values - Set in the application code
  2. .env file - Local environment file in the working directory
  3. System environment variables - Set via export or container environment
  4. Command line arguments - Passed directly to the application

Validation and Error Handling

The CyborgDB service performs automatic validation of environment variables on startup:
  • Missing required variables - Service will exit with error messages
  • Invalid database types - Supported types are standalone, postgres, redis, and memory
  • Connection testing - Database connections are tested on startup
  • SSL certificate validation - Certificate files are checked for existence
If validation fails, the service will display helpful error messages with examples of correct configuration.

Troubleshooting

  • Ensure CYBORGDB_API_KEY is set
  • Check for typos in the variable name
  • Verify the API key format starts with cyborg_
  • Verify database is running and accessible
  • Check connection string format
  • Test database connectivity manually
  • Ensure firewall allows connections
  • Verify certificate files exist at specified paths
  • Check file permissions (service must be able to read certificates)
  • Ensure certificate and key files match
  • Use absolute paths for certificate locations