Configuration Guide
Complete guide to configuring Honcho for development and production
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):
- Environment variables (always take precedence)
.env
file (for local development)config.toml
file (base configuration)- Default values
Recommended Configuration Approaches
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, host, port)[db]
- Database connection and pool settings[auth]
- Authentication configuration[llm]
- LLM provider and model settings[agent]
- Agent behavior settings[deriver]
- Background worker settings[history]
- Message history settings[sentry]
- Error tracking settings
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
LLM_DIALECTIC_MODEL
→[llm].DIALECTIC_MODEL
LOG_LEVEL
(no section) →[app].LOG_LEVEL
Configuration Priority
When a configuration value is set in multiple places, Honcho uses this priority:
- Environment variables - Always take precedence
- .env file - Loaded for local development
- config.toml - Base configuration
- 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
Basic Application Configuration:
Environment-specific settings:
Database Configuration
Required Database Settings:
Database Pool Settings:
Docker Compose for PostgreSQL:
Authentication Configuration
JWT Authentication:
Generate JWT Secret:
LLM Provider Configuration
Anthropic (Claude)
Required Settings:
OpenAI
Required Settings:
Google (Gemini)
Required Settings:
Groq
Required Settings:
LLM General Settings
Default Configuration:
Agent Configuration
Semantic Search Settings:
Theory of Mind Settings:
Deriver Configuration
Background Processing:
Processing Methods:
History Configuration
Message Summarization:
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:
-
Database Connection Errors
- Ensure
DB_CONNECTION_URI
usespostgresql+psycopg://
prefix - Verify database is running and accessible
- Check pgvector extension is installed
- Ensure
-
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
- Set
-
LLM Provider Issues
- Verify API keys are set correctly
- Check model names match provider specifications
- Ensure provider is enabled in configuration
-
Deriver Issues
- Increase
DERIVER_WORKERS
for better performance - Check
DERIVER_STALE_SESSION_TIMEOUT_MINUTES
for session cleanup - Monitor background processing logs
- Increase
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.