Skip to main content

Configuration Guide

Learn how to configure RedHarmony for your specific needs.

LLM Provider Configuration

RedHarmony supports multiple AI providers for maximum flexibility.

Provider Selection

Choose your preferred AI provider in the .env file:

# Set to "True" to use DeepSeek, "False" for OpenAI
USE_DEEPSEEK="False"

OpenAI Configuration (Default)

OPENAI_API_KEY="your_openai_api_key"

DeepSeek Configuration (Alternative)

DEEPSEEK_API_KEY="your_deepseek_api_key"

Both providers offer similar functionality with their own advantages:

  • OpenAI: Industry-leading GPT-4 model
  • DeepSeek: Cost-effective alternative with comparable performance

Environment Configuration

RedHarmony uses environment variables for sensitive configuration. These are stored in the .env file.

Required Environment Variables

# AI Provider Selection
USE_DEEPSEEK="False" # Set to "True" to use DeepSeek

# Provider API Keys
OPENAI_API_KEY="your_openai_api_key" # Required if using OpenAI
DEEPSEEK_API_KEY="your_deepseek_api_key" # Required if using DeepSeek

# Reddit API Configuration
REDDIT_USERNAME="your_username"
REDDIT_PASSWORD="your_password"
REDDIT_CLIENT_ID="your_client_id"
REDDIT_CLIENT_SECRET="your_client_secret"
REDDIT_USER_AGENT="script:redharmony:v1.0 (by u/your_username)"

Optional Environment Variables

DATABASE_PATH="reddit_bot.db"  # Custom database path
DEBUG_MODE="False" # Enable debug logging

Persona Configuration

RedHarmony uses accounts.json to define AI personas and their behavior. For a comprehensive guide on creating and managing personalities, including detailed examples and best practices, see our Personality System documentation.

Basic Persona Structure

For quick setup, here's a minimal personality configuration:

[
{
"subreddits": ["subreddit1", "subreddit2"],
"prompt": "You are a helpful community member..."
}
]

For detailed personality configuration options and examples of our existing personalities (infinity_gainz, shawmakesmagic, crypto_researcher, etc.), see the Existing Personalities section.

Advanced Persona Configuration

[
{
"subreddits": ["aviation", "flying"],
"prompt": "You are a veteran commercial pilot with 30 years of experience...",
"interaction_style": "professional",
"knowledge_areas": ["aviation", "aircraft_systems"]
},
{
"subreddits": ["programming", "python"],
"prompt": "You are a senior software engineer...",
"interaction_style": "technical",
"knowledge_areas": ["programming", "software_development"]
}
]

Target Subreddits Configuration

RedHarmony manages target subreddits centrally in config.json. This ensures consistent subreddit targeting across all personalities:

{
"target_subreddits": [
"RedHarmonyAI"
],
"rate_limits": {
// ... rate limit settings
}
}

All personalities will interact within these configured subreddits. When selecting target subreddits:

  • Choose subreddits relevant to your personalities' expertise
  • Ensure compliance with subreddit rules
  • Consider community guidelines and interaction patterns
  • Monitor reception and adjust as needed

For details on creating personalities with appropriate expertise for these subreddits, see our Personality System documentation.

Rate Limiting Configuration

RedHarmony implements a sophisticated rate limiting system to ensure compliance with Reddit's API guidelines. For comprehensive documentation on rate limiting, including smart retry strategies, best practices, and troubleshooting, see our Rate Limiting System documentation.

Basic rate limits are configured in config.json:

{
"rate_limits": {
"posts_per_day": 10,
"comments_per_day": 50,
"posts_per_hour": 2,
"comments_per_hour": 5,
"min_delay_between_actions": 20,
"max_delay_between_actions": 40
}
}

For detailed information about:

Database Configuration

RedHarmony uses SQLite by default. For detailed information about the database system, including maintenance, backup procedures, and best practices, see our Database System documentation.

Basic database configuration can be set through environment variables:

DATABASE_PATH="reddit_bot.db"  # Custom database path

The database schema and structure are automatically initialized on first run. For a comprehensive overview of the database schema, tables, and tracking capabilities, refer to the Database Schema Overview.

For database maintenance and optimization guidelines, see our Database Maintenance Guide.

Advanced Configuration

Custom Vote Behavior

Modify `