Skip to main content
Honcho uses a flexible configuration system that supports both TOML files and environment variables. Configuration values are loaded in the following priority order (highest to lowest):
  1. Environment variables (always take precedence)
  2. .env file (for local development)
  3. config.toml file (base configuration)
  4. Default values

Option 1: Environment Variables Only (Production)

  • Use environment variables for all configuration
  • No config files needed
  • Ideal for containerized deployments (Docker, Kubernetes)
  • Secrets managed by your deployment platform

Option 2: config.toml (Development/Simple Deployments)

  • Use config.toml for base configuration
  • Override sensitive values with environment variables
  • Good for development and simple deployments

Option 3: Hybrid Approach

  • Use config.toml for non-sensitive base settings
  • Use .env file for sensitive values (API keys, secrets)
  • Good for development teams

Option 4: .env Only (Local Development)

  • Use .env file for all configuration
  • Simple for local development
  • Never commit .env files to version control

Configuration Methods

Using config.toml

Copy the example configuration file to get started:
Then modify the values as needed. The TOML file is organized into sections:
  • [app] - Application-level settings (log level, session limits, embedding settings, Langfuse integration, local metrics collection)
  • [db] - Database connection and pool settings (connection URI, pool size, timeouts, connection recycling)
  • [auth] - Authentication configuration (enable/disable auth, JWT secret)
  • [cache] - Redis cache configuration (enable/disable caching, Redis URL, TTL settings, lock configuration for cache stampede prevention)
  • [llm] - LLM provider API keys (Anthropic, OpenAI, Gemini, Groq, OpenAI-compatible endpoints) and general LLM settings
  • [dialectic] - Dialectic API configuration (provider, model, query generation settings, semantic search parameters, context window size)
  • [deriver] - Background worker settings (worker count, polling intervals, queue management) and theory of mind configuration (model, tokens, observation limits)
  • [peer_card] - Peer card generation settings (provider, model, token limits)
  • [summary] - Session summarization settings (frequency thresholds, provider, model, token limits for short and long summaries)
  • [dream] - Dream processing configuration (enable/disable, thresholds, idle timeouts, dream types, LLM settings)
  • [webhook] - Webhook configuration (webhook secret, workspace limits)
  • [metrics] - Metrics collection settings (enable/disable metrics, namespace)
  • [sentry] - Error tracking and monitoring settings (enable/disable, DSN, environment, sample rates)

Using Environment Variables

All configuration values can be overridden using environment variables. The environment variable names follow this pattern:
  • {SECTION}_{KEY} for nested settings
  • Just {KEY} for app-level settings
Examples:
  • DB_CONNECTION_URI[db].CONNECTION_URI
  • DB_POOL_SIZE[db].POOL_SIZE
  • AUTH_JWT_SECRET[auth].JWT_SECRET
  • DIALECTIC_MODEL[dialectic].MODEL
  • LOG_LEVEL (no section) → [app].LOG_LEVEL

Configuration Priority

When a configuration value is set in multiple places, Honcho uses this priority:
  1. Environment variables - Always take precedence
  2. .env file - Loaded for local development
  3. config.toml - Base configuration
  4. Default values - Built-in defaults
This allows you to:
  • Use config.toml for base configuration
  • Override specific values with environment variables in production
  • Use .env files for local development without modifying config.toml

Example

If you have this in config.toml:
You can override just the connection URI in production:
The application will use the production connection URI while keeping the pool size from config.toml.

Core Configuration

Application Settings

Application-level settings control core behavior of the Honcho server including logging, session limits, message handling, and optional integrations. Basic Application Configuration:
Optional Integrations:

Database Configuration

Required Database Settings:
Database Pool Settings:
Docker Compose for PostgreSQL:

Authentication Configuration

JWT Authentication:
Generate JWT Secret:

Cache Configuration

Honcho supports Redis caching to improve performance by caching frequently accessed data like peers, sessions, and working representations. Caching also includes lock mechanisms to prevent cache stampede scenarios. Redis Cache Settings:
When to Enable Caching:
  • High-traffic production environments
  • Applications with many repeated reads of the same data
  • When you need to reduce database load
Note: Caching requires a Redis instance. You can run Redis locally with Docker:

LLM Provider Configuration

Honcho supports multiple LLM providers for different tasks. API keys are configured in the [llm] section, while specific features use their own configuration sections.

API Keys

All provider API keys use the LLM_ prefix:

General LLM Settings

Feature-Specific Model Configuration

Different features can use different providers and models: Dialectic API: The Dialectic API provides theory-of-mind informed responses by integrating long-term facts with current context.
Deriver (Theory of Mind): The Deriver is a background processing system that extracts facts from messages and builds theory-of-mind representations of peers.
Peer Card: Peer cards are short, structured summaries of peer identity and characteristics.
Summary Generation: Session summaries provide compressed context for long conversations. Honcho creates two types: short summaries (frequent) and long summaries (comprehensive).

Default Provider Usage

By default, Honcho uses:
  • Anthropic (Claude) for dialectic API responses
  • Groq for query generation (fast, cost-effective)
  • Google (Gemini) for theory of mind derivation
  • OpenAI (GPT) for peer cards and summarization
  • OpenAI for embeddings (if EMBED_MESSAGES=true)
You only need to set the API keys for the providers you plan to use. All providers are configurable per feature.

Additional Features Configuration

Dream Processing

Dream processing consolidates and refines peer representations during idle periods, similar to how human memory consolidation works during sleep. Dream Settings:

Webhook Configuration

Webhooks allow you to receive real-time notifications when events occur in Honcho (e.g., new messages, session updates). Webhook Settings:

Metrics Collection

Enable metrics collection for monitoring Honcho performance and usage. Metrics Settings:

Monitoring Configuration

Sentry Error Tracking

Sentry Settings:

Environment-Specific Examples

Development Configuration

config.toml for development:
Environment variables for development:

Production Configuration

config.toml for production:
Environment variables for production:

Migration Management

Running Database Migrations:

Troubleshooting

Common Configuration Issues:
  1. Database Connection Errors
    • Ensure DB_CONNECTION_URI uses postgresql+psycopg:// prefix
    • Verify database is running and accessible
    • Check pgvector extension is installed
  2. Authentication Issues
    • Set AUTH_USE_AUTH=true for production
    • Generate and set AUTH_JWT_SECRET if authentication is enabled
    • Use python scripts/generate_jwt_secret.py to create a secure secret
  3. LLM Provider Issues
    • Verify API keys are set correctly
    • Check model names match provider specifications
    • Ensure provider is enabled in configuration
  4. Deriver Issues
    • Increase DERIVER_WORKERS for better performance
    • Check DERIVER_STALE_SESSION_TIMEOUT_MINUTES for session cleanup
    • Monitor background processing logs
This configuration guide covers all the settings available in Honcho. Always use environment-specific configuration files and never commit sensitive values like API keys or JWT secrets to version control.