Skip to main content
VectorDB uses environment variables for API keys, connection strings, and deployment-specific settings. This reference documents all supported environment variables.

Why environment variables?

Environment variables provide several benefits:
  • Security: Keep credentials out of version control
  • Flexibility: Change settings per environment without code changes
  • Portability: Deploy the same config across dev, staging, and production
  • CI/CD integration: Inject secrets from vault systems

Variable syntax in configurations

VectorDB supports two environment variable patterns in YAML:

Vector database credentials

Pinecone

string
required
API key for Pinecone authentication. Get from Pinecone console.Example:
Usage in config:

Weaviate

string
required
Weaviate cluster URL including protocol and port.Example:
Usage in config:
string
required
API key for Weaviate authentication.Example:
Usage in config:

Milvus

string
required
Milvus connection URI including protocol, host, and port.Example:
Usage in config:
string
Authentication token for Milvus (required for managed instances).Example:
Usage in config:

Qdrant

string
required
Qdrant server URL including protocol, host, and port.Example:
Usage in config:
string
API key for Qdrant authentication (required for cloud deployments).Example:
Usage in config:
string
Alternative: Qdrant host (used with QDRANT_PORT).Example:
string
Qdrant port number (used with QDRANT_HOST).Default: 6333

Chroma

string
Chroma server host for client/server mode.Example:
Usage in config:
string
Chroma server port.Example:
Default: 8000
string
Directory for Chroma local persistence.Example:
Usage in config:

LLM API keys

Groq

string
required
API key for Groq LLM services. Get from Groq console.Example:
Usage in config:

OpenAI

string
required
API key for OpenAI services.Example:
Usage in config:

Cohere

string
API key for Cohere reranking services.Example:
Usage in config:

Application settings

string
Logging level for the application.Values: DEBUG, INFO, WARNING, ERROR, CRITICALExample:
Default: INFOUsage in config:
string
Deployment environment identifier.Values: development, staging, productionExample:
Usage in code:
boolean
Enable telemetry and metrics collection.Example:
Default: false
integer
Maximum retry attempts for failed operations.Example:
Default: 3
integer
Default timeout for API requests in seconds.Example:
Default: 30

Setting environment variables

Local development (.env file)

Create a .env file in your project root:
.env
Load with python-dotenv:

Shell export

Docker

Or use an env file:

Docker Compose

docker-compose.yml

Kubernetes secrets

secrets.yaml
deployment.yaml

GitHub Actions

.github/workflows/test.yml

Environment-specific configuration pattern

Organize variables by environment:
Load environment-specific file:

Security best practices

Add environment files to .gitignore:
.gitignore
Provide an example file with placeholders:
.env.example
For production, use dedicated secret management:
  • AWS Secrets Manager or Parameter Store
  • Google Cloud Secret Manager
  • Azure Key Vault
  • HashiCorp Vault
  • Kubernetes Secrets
Example with AWS Secrets Manager:
  • Set up automatic key rotation (monthly or quarterly)
  • Monitor for leaked credentials using tools like GitGuardian
  • Revoke old keys after rotation
  • Test new credentials before revoking old ones
Check that required variables are set at startup:

Troubleshooting

Symptom: Configuration shows ${VAR_NAME} literal instead of value.Solutions:
  • Ensure variable is exported: export VAR_NAME=value
  • Check variable name spelling matches exactly
  • Verify .env file is loaded if using python-dotenv
  • Use default syntax: ${VAR_NAME:-default} to see if default appears
Symptom: Variable resolves to empty string.Solutions:
  • Variable is set but empty: export VAR_NAME=
  • Use echo $VAR_NAME to verify shell environment
  • Check for typos in variable name
  • Ensure export happens before running Python
Symptom: Production uses development credentials.Solutions:
  • Set ENVIRONMENT variable before loading config
  • Use explicit env file path: load_dotenv('.env.production')
  • Check which env file was loaded in logs
  • Verify Kubernetes/Docker env injection

Next steps

Configuration reference

See how to use these variables in YAML configs

Production deployment

Learn production secrets management patterns

Building RAG pipelines

Use environment variables in your first pipeline

Benchmarking

Set up evaluation environments