An autonomous Reddit outreach bot that uses AI (Grok-4) to intelligently find and engage with relevant users through context-aware comments and DMs.
- AI-Powered Lead Triage: Uses Grok-4 to evaluate leads, classify user intent, and select appropriate response templates
- Multi-Strategy Targeting: Configure multiple keyword strategies with different actions (DM, comment)
- Context-Aware Responses: 100+ message templates organized by user archetype (question-asking, frustration, seeking advice, etc.)
- Smart Rate Limiting: Ramp-up schedule to avoid detection (configurable daily limits)
- Multi-Account Support: Operate multiple Reddit accounts with isolated state tracking
- Browser Automation: Uses Zendriver for undetectable browser automation
- Dry Run Mode: Preview proposed actions before execution
- Search Phase: Scrapes Reddit for posts/comments matching your keywords
- Discovery Phase: Grok evaluates "maybe" leads for relevance
- Context Enrichment: Fetches parent comments and thread titles via Reddit API
- Triage Phase: Grok classifies user intent and selects the best template
- Execution Phase: Posts comments or sends DMs with human-like delays
- Python 3.10+
- Chrome browser
- xAI API key (for Grok)
cd reddit-bot
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt- Copy the example config:
cp config.example.json config.json
cp .env.example .env-
Edit
config.jsonwith your Reddit account credentials and targeting strategy -
Add your xAI API key to
.env:
XAI_API_KEY=xai-your-key-here
-
Customize message templates in
templates.json -
Edit prompts in
prompts/to match your use case
python src/dry_run.pypython src/execute_verified.pypython src/main.py| Field | Description |
|---|---|
accounts |
Reddit account credentials |
ramp_schedule |
Daily limits that increase over time |
search.keywords_* |
Keywords to search for |
search.subreddits_priority |
Subreddits to target |
strategies |
Named strategies with keywords and allowed actions |
delays |
Timing configuration for human-like behavior |
grok |
Grok API configuration |
Templates in templates.json are organized by:
- Strategy (e.g.,
scanner_app,controversial_ingredient) - Action type (
dm,comment) - User archetype (
question_asking,frustration,seeking_advice, etc.)
Templates support placeholders: {username}, {subreddit}, {ingredient}, {app_mentioned}, {topic}
reddit-bot/
├── config.example.json # Example configuration
├── templates.json # Message templates
├── prompts/ # Grok prompt files
│ ├── base_system.txt
│ ├── triage_v2.txt
│ └── discovery.txt
├── src/
│ ├── main.py # Main orchestration
│ ├── auth.py # Session management
│ ├── search.py # Lead discovery
│ ├── triage.py # Grok-based evaluation
│ ├── comment.py # Comment posting
│ ├── dm.py # DM sending
│ ├── state.py # Atomic state management
│ └── rate_limiter.py # Rate limiting
└── data/ # Runtime data (gitignored)
- Atomic file-locked state to prevent race conditions
- Pre-reply verification before posting
- Screenshot capture for error logging
- Consecutive failure limits
- Never contacts the same user twice
MIT