COMPLIANCE-FIRST AI ENGAGEMENT
Reddit Comment Engagement Agent
AI-powered Reddit engagement with 13-node LangGraph workflow, quality scoring, human-in-the-loop approval, and comprehensive safety controls
Overview
The Reddit Comment Engagement Agent is an intelligent automation tool that helps you engage with Reddit communities while maintaining compliance and avoiding shadowbans. Built with a compliance-first approach, it uses AI to identify high-quality engagement opportunities and requires human approval before posting.
Perfect for developers, marketers, and community managers who want to maintain authentic Reddit presence without manual monitoring. The agent operates within strict safety limits and learns from historical performance to improve over time.
Product Promotion
Engage authentically when users ask about your product category
Community Support
Respond to questions in your niche with helpful answers
Content Distribution
Share relevant blog posts or resources where appropriate
Key Features
7-factor quality assessment including upvote ratio, author karma, content freshness, engagement velocity, question signals, thread depth, and historical performance.
Mandatory approval via Slack/Telegram with URL-based buttons. Secure one-time tokens with 48-hour expiry ensure safety. Auto-publish after approval.
Daily limits (8 comments/day), cooldown periods, random timing jitter, bot filtering, and diversity controls prevent detection and shadowbans.
13-node pipeline with intelligent routing: fetch candidates → score quality → filter duplicates → check compliance → human approval → auto-publish.
Learns from past performance per subreddit with time-decay weighting. Tracks 24-hour engagement metrics (upvotes, replies) to refine future scoring.
Next.js admin UI with real-time stats, settings editor, workflow visualizer, and setup wizard. Secure JWT authentication with role-based access.
Architecture
Backend Stack
- FastAPI - High-performance Python web framework with async support
- LangGraph - Orchestrates 13-node workflow with conditional logic
- PostgreSQL - Persistent storage with Alembic migrations
- PRAW - Reddit API wrapper with rate limiting
- Gemini 2.5 Flash - Primary LLM for draft generation
Frontend Stack
- Next.js 16 - React framework with App Router
- shadcn/ui - Beautiful Radix UI components
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first styling
- Recharts - Data visualization for dashboard
How It Works
- 1
Fetch Candidates
Retrieves inbox replies (HIGH priority) + rising posts/comments from allowed subreddits
- 2
Select by Ratio
Applies 30% post / 70% comment distribution for natural engagement patterns
- 3
Score Quality
AI-powered 7-factor scoring with historical learning and 25% exploration
- 4
Filter & Check Rules
Removes duplicates, applies cooldowns, verifies subreddit compliance
- 5
Diversity Select
Max 2 per subreddit, max 1 per post (with quality overrides)
- 6
Generate Draft
LLM creates human-like reply with context-aware prompts
- 7
Human Approval
Sends to Slack/Telegram with approve/reject buttons + context link
- 8
Auto-Publish
Posts approved drafts to Reddit automatically with random timing jitter
Getting Started
- Python 3.11+ installed
- Reddit API credentials (Client ID + Secret)
- LLM API key (Gemini, OpenAI, or Anthropic)
- PostgreSQL database (local or cloud)
- Public URL for callback server (ngrok, Cloudflare Tunnel, or VPS)
1. Clone the repository
git clone https://github.com/yourusername/reddit_agent
cd reddit_agent2. Create virtual environment
python -m venv venv
source venv/bin/activate # macOS/Linux
# OR
venv\Scripts\activate # Windows3. Install dependencies
pip install -r requirements.txt4. Configure environment
cp .env.example .env
# Edit .env with your credentials5. Run database migrations
alembic upgrade head6. Start the callback server
python main.py server7. Run the agent (in another terminal)
source venv/bin/activate
python main.py run --onceConfiguration Guide
- 1. Visit reddit.com/prefs/apps
- 2. Click "Create App" or "Create Another App"
- 3. Select "script" type
- 4. Fill name and redirect URI (http://localhost)
- 5. Copy Client ID (under app name) and Secret
- 6. Add to .env file
Gemini (Recommended)
Get free API key at aistudio.google.com
OpenAI
Sign up at platform.openai.com
Anthropic
Get API key from console.anthropic.com
Slack Webhook
Create incoming webhook at api.slack.com/apps
Telegram Bot
Create bot via @BotFather, get token + chat ID
Generic Webhook
Any endpoint accepting POST with JSON payload
- MAX_COMMENTS_PER_DAY8
- MAX_COMMENTS_PER_RUN3
- INBOX_COOLDOWN_HOURS6
- RISING_COOLDOWN_HOURS24
- POST_REPLY_RATIO0.3
Web Dashboard
Features
Dashboard Stats
Real-time metrics, charts, and draft status
Settings Editor
Edit environment variables with validation
Workflow Visualizer
Interactive 13-node pipeline diagram
Setup Wizard
4-step configuration with test functions
Access
# Start server (includes web dashboard)
python main.py server
# Access dashboard
# Open browser: http://localhost:3000Default password: admin123
Change password hash in .env: ADMIN_PASSWORD_HASH
Frequently Asked Questions
Related Projects
License & Credits
License
This project is available under an open-source license. See the repository for full license details.
Author: Avinash Sangle
Website: avinashsangle.com
Year: 2026
Built With
- • LangGraph - Workflow orchestration
- • PRAW - Reddit API wrapper
- • FastAPI - High-performance web framework
- • shadcn/ui - Beautiful React components
- • PostgreSQL - Reliable database
- • Gemini 2.5 Flash - AI language model
- • Built with Claude Code - AI-assisted development
Ready to Get Started?
Start engaging with Reddit communities intelligently while maintaining compliance and avoiding shadowbans.