Configuration

Configure SystemPrompt for your environment

SystemPrompt uses a profile-based configuration system. This guide covers all configuration options.

Configuration Hierarchy

Configuration loads in this order:

  1. Profile - Base settings (database, API URLs)
  2. Secrets - Sensitive values (API keys, passwords)
  3. Credentials - Auth tokens (OAuth, cloud access)
  4. Service Config - Per-service settings in services/config/

Profiles

Profiles are the single source of truth for environment configuration.

Create a Profile

systemprompt cloud profile create local

This creates a profile at ~/.config/systemprompt/profiles/local.yaml.

Profile Structure

# ~/.config/systemprompt/profiles/local.yaml
name: local
tenant_id: your-tenant-id

database:
  type: postgres
  host: localhost
  port: 5432
  database: systemprompt
  username: systemprompt
  # Password loaded from secrets

api:
  host: 0.0.0.0
  port: 3000
  base_url: http://localhost:3000

logging:
  level: info
  format: pretty

features:
  mcp: true
  agents: true
  scheduler: true

Switch Profiles

# List profiles
systemprompt cloud profile list

# Switch active profile
systemprompt cloud profile use production

# Show current profile
systemprompt cloud profile show

Secrets

Secrets store sensitive values separately from profiles.

Set Secrets

# Set database password
systemprompt admin config set-secret database.password "your-password"

# Set API keys
systemprompt admin config set-secret anthropic.api_key "sk-..."
systemprompt admin config set-secret openai.api_key "sk-..."

Secrets Location

Secrets are stored at ~/.config/systemprompt/secrets.yaml (encrypted).

Service Configuration

Service-specific configuration lives in services/config/:

AI Providers

# services/config/ai.yaml
providers:
  anthropic:
    model: claude-sonnet-4-20250514
    max_tokens: 4096
    temperature: 0.7

  openai:
    model: gpt-4o
    max_tokens: 4096
    temperature: 0.7

default_provider: anthropic

Scheduler

# services/config/scheduler.yaml
enabled: true
timezone: UTC

jobs:
  cleanup:
    cron: "0 0 * * *"  # Daily at midnight
    task: "maintenance:cleanup_old_sessions"

  analytics:
    cron: "0 9 * * *"  # Daily at 9 AM
    task: "analytics:generate_daily_report"

OAuth

# services/config/oauth.yaml
issuer: https://your-domain.com
token_lifetime: 3600  # 1 hour
refresh_lifetime: 604800  # 7 days

clients:
  - id: web-app
    name: Web Application
    redirect_uris:
      - http://localhost:3000/callback
    scopes: ["openid", "profile", "chat"]

Web Configuration

Customize the web interface in services/web/config.yaml:

branding:
  name: "My Platform"
  title: "My AI Platform"
  themeColor: "#f79938"

colors:
  dark:
    primary:
      hsl: "hsl(28, 91%, 60%)"

navigation:
  footer:
    resources:
      - path: "/documentation"
        label: "Documentation"
      - path: "/blog"
        label: "Blog"

Content Configuration

Configure content sources in services/content/config.yaml:

content_sources:
  blog:
    path: "content/blog"
    enabled: true
    allowed_content_types: ["article", "tutorial"]
    sitemap:
      url_pattern: "/blog/{slug}"
      priority: 0.8

  docs:
    path: "content/docs"
    enabled: true
    allowed_content_types: ["guide", "reference"]
    sitemap:
      url_pattern: "/documentation/{slug}"
      priority: 0.7

Environment Variables

While profiles are preferred, these environment variables are supported:

Variable Description
SYSTEMPROMPT_PROFILE Active profile name
SYSTEMPROMPT_LOG_LEVEL Override log level
DATABASE_URL Full database connection string

Configuration Validation

Validate your configuration:

# Check profile
systemprompt admin config validate

# Test database connection
systemprompt infra db status

# Check service health
systemprompt infra services status

Best Practices

  1. Use profiles - One profile per environment (local, staging, production)
  2. Keep secrets separate - Never commit secrets to version control
  3. Validate before deploy - Run systemprompt admin config validate
  4. Use cloud for production - Managed infrastructure with automatic backups

Next Steps