- 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:[app]
- Application-level settings (log level, host, port, embedding settings)[db]
- Database connection and pool settings[auth]
- Authentication configuration[llm]
- LLM provider API keys and general settings[dialectic]
- Dialectic API configuration (provider, model, search settings)[deriver]
- Background worker settings and theory of mind configuration[summary]
- Session summarization settings[sentry]
- Error tracking and monitoring 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
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:- Environment variables - Always take precedence
- .env file - Loaded for local development
- config.toml - Base configuration
- Default values - Built-in defaults
- 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 inconfig.toml
:
Core Configuration
Application Settings
Basic Application Configuration:Database Configuration
Required Database Settings:Authentication Configuration
JWT Authentication: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 theLLM_
prefix:
General LLM Settings
Feature-Specific Model Configuration
Different features can use different providers and models: Dialectic API:Default Provider Usage
By default, Honcho uses:- Anthropic for dialectic API responses
- Groq for query generation
- Google for deriving theory of mind and summarization
- OpenAI for embeddings (if
EMBED_MESSAGES=true
)
Monitoring Configuration
Sentry Error Tracking
Sentry Settings:Environment-Specific Examples
Development Configuration
config.toml for development:Production Configuration
config.toml 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