An AI-powered Reddit user persona analyzer that generates comprehensive psychological profiles and business insights using GROQ's Llama 3 70B model.
IMPORTANT - Create a .env file in your system after pulling this Repo
Get GROQ API key here - https://console.groq.com/keys
Also if first time if the code throws "invalid API key" error then create another API key from the same link and it'll work for sure.
Reddit_Persona_AI/
├── Hungry_Move_Persona.txt # Sample analysis of u/Hungry-Move-6603
├── kojied_persona.txt # Sample analysis of u/kojied
├── README.md # This file
├── requirements.txt # Python dependencies
└── script.py # Main executable script
-
Install dependencies:
pip install -r requirements.txt
-
Create a .env file and add GROQ API Key
GROQ_API_KEY=your_api_key_here
-
Run the script:
py script.py
-
Follow the interactive prompts:
- Enter Reddit username or profile URL: - Choose output filename (or press Enter for auto-generated): - Set data analysis limit (default: 1000 posts/comments):
- AI-Powered Analysis: Uses GROQ's Llama 3 70B for advanced persona generation
- Interactive Interface: User-friendly command-line prompts
- Flexible Input: Accepts various Reddit URL formats or just usernames
- Comprehensive Profiling: Generates detailed psychological and behavioral analysis
- Evidence-Based: All insights backed by specific posts/comments
- Configurable Limits: Adjustable data collection limits (up to 3000+ items)
- Auto-Generated Filenames: Automatic timestamped output files
- Error Handling: Robust handling of network issues and invalid inputs
The repository includes pre-generated analyses for:
- kojied: Active NYC-based tech professional with gaming interests
- Hungry-Move-6603: User with different activity patterns
Each generated persona includes:
- Basic Information: Age estimates, location, occupation
- Personality Traits: Analytical, curious, helpful, etc. with confidence levels
- Interests and Hobbies: Gaming, technology, food, anime, etc.
- Communication Style: Informed, concise, helpful patterns
- Demographic Indicators: Education level, income estimates
- Behavioral Patterns: Online presence, learning tendencies
- Values and Beliefs: Self-care, fairness, equality concerns
- Motivations and Goals: Personal growth, social connections
- Frustrations and Pain Points: Game mechanics, workplace fairness
- Business/Marketing Insights: Target audience, marketing strategies
- Language: Python 3.7+
- AI Model: GROQ Llama 3 70B (llama3-70b-8192)
- Data Source: Reddit JSON API
- Dependencies: requests, groq, python-dotenv
- Code Style: PEP-8 compliant with type hints
- Security: Environment variables for API key management
- Input Processing: Normalizes various Reddit URL formats
- Data Collection: Scrapes posts and comments using pagination
- AI Analysis: Sends structured prompt to GROQ for persona generation
- Output Generation: Creates formatted text file with analysis
- Evidence Tracking: Maintains links to original posts/comments
# Basic usage
py script.py
# Example interaction:
Enter Reddit profile information:
Reddit Profile: kojied
Choose output filename:
Output filename: [Press Enter for auto-generated]
Data analysis limit:
Max items (or press Enter for 1000): [Press Enter]- Data Fetching: ~1-2 seconds per 100 items
- AI Analysis: 1-3 minutes for comprehensive persona
- Total Runtime: 2-5 minutes for typical user analysis
- Rate Limiting: Built-in delays to respect Reddit's API limits
- Public Data Only: Analyzes only publicly available Reddit content
- API Key Protection: Uses .env file (excluded from version control)
- No Data Storage: Doesn't permanently store personal information
- Ethical Guidelines: Intended for research and educational purposes
The script handles:
- Invalid Reddit URLs or usernames
- Private or deleted accounts
- Network connectivity issues
- API rate limiting
- Missing or corrupted data
- Invalid user input
- Python 3.7 or higher
- Internet connection
- GROQ API key (provided for evaluation)
- Valid Reddit usernames (public profiles only)
=== AI-POWERED REDDIT PERSONA ANALYSIS ===
Username: kojied
Generated: 2025-07-15 18:13:20
Total Posts Analyzed: 31
Total Comments Analyzed: 328
**Persona Analysis: kojied**
**1. Basic Information**
* Age: Late 20s to early 30s
* Location: New York City, USA
* Occupation: Software developer or tech professional
[Additional analysis sections...]
=== ANALYSIS COMPLETED ===
Powered by GROQ AI (Llama 3 70B)
For questions or issues:
- Check that your .env file contains a valid GROQ API key
- Verify internet connectivity
- Ensure the Reddit username is valid and public
- Review error messages for specific guidance
Note: This project demonstrates AI-powered user analysis capabilities. Please use responsibly and respect user privacy.