Skip to content

An AI-powered tool that scrapes Reddit user activity and generates detailed user personas using Groq LLMs via LangChain. Includes text-based output and PowerPoint slide generation. πŸ”—πŸ§ πŸ“Š

Notifications You must be signed in to change notification settings

jasoncobra3/Reddit_Persona_Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Reddit User Persona Generator

This project is a Generative AI-powered Reddit User Persona Generator that analyzes a user's public Reddit activity - comments and posts to generate a rich, human-like persona. It leverages Large Language Models (LLMs) via Groq and is orchestrated using LangChain, providing deep behavioral insights, motivations, and personality traits based on natural language patterns.


πŸ“Œ Features

  • πŸ”— Accepts any public Reddit user profile URL
  • 🧹 Scrapes all available comments and posts using Reddit's PRAW API
  • 🧠 Generates an in-depth user persona using Groq's LLM (e.g., Mixtral)
  • πŸ“„ Outputs the persona to a clean .txt file in the outputs/ folder
  • πŸ“Œ Cites specific posts/comments for each personality trait

πŸ“Έ Screenshots

🧠 AI Persona Generator UI πŸ“„ Example Output
UI Output

πŸ› οΈ Tech Stack

Purpose Technology Used
Web scraping Python + PRAW
LLM pipeline LangChain + Groq (Mixtral)
Secrets mgmt python-dotenv
Output .txt user persona files
User Interface Streamlit
Future (optional) python-pptx for visual persona

πŸ“‚ Project Structure

Reddit_Persona_Generator/
β”œβ”€β”€ reddit_scraper.py         # Fetches user comments/posts
β”œβ”€β”€ persona_generator.py      # Generates persona using LLM
β”œβ”€β”€ main.py                   # Main entry point
β”œβ”€β”€ .env                      # API credentials (ignored in .gitignore)
β”œβ”€β”€ requirements.txt          # Python dependencies
β”œβ”€β”€ README.md                 # Project documentation
β”œβ”€β”€ .gitignore                # Hides secrets, venv, and outputs
└── outputs/
    β”œβ”€β”€ kojied.txt
    └── Hungry-Move-6603.txt

πŸ” .env Setup

Create a .env file in the root folder with:

REDDIT_CLIENT_ID=your_reddit_client_id
REDDIT_CLIENT_SECRET=your_reddit_client_secret
REDDIT_USERNAME=your_reddit_username
REDDIT_PASSWORD=your_reddit_password
USER_AGENT=YourScriptName by u/yourusername
GROQ_API_KEY=your_groq_api_key

πŸš€ How to Run

  1. Clone the Repo
    git clone https://github.com/your-username/beyondchats_ai_intern.git
    cd beyondchats_ai_intern
    
  2. Create Virtual Environment
    python -m venv reddit_persona
     # Windows:
     reddit_persona\Scripts\activate
     # macOS/Linux:
     source reddit_persona/bin/activate
    
  3. Install Dependencies
    pip install -r requirements.txt
    
  4. Run the Script
    python main.py
    
  • πŸ‘‰ Enter a Reddit profile URL when prompted.
  • πŸ“ Output will be saved in outputs/<username>.txt

πŸš€ Run Streamlit App

  1. Run the Script in Terminal
    streamlit run app.py

πŸ“„ Sample Output

User Persona: kojied

Personality Traits

  • Strategic Thinker
  • Analytical
  • Socially Aware

Goals

  • Strategic resource management
  • Creative consistency

Direct Quotes

  1. "You have to kill the bandit units..." β€” [Reddit Comment]

⚠️ Notes

  • Only public Reddit profiles with visible comment/post history can be analyzed.
  • Quotes are extracted to reflect traits where applicable.
  • Personality bars and inferred professions are approximations based on LLM predictions.

🌟 Future Improvements

  • Generate persona slides or images using python-pptx
  • Visualize traits with charts or graphs

🀝 Contributing

Feel free to fork, star, or submit a pull request to contribute improvements!

About

An AI-powered tool that scrapes Reddit user activity and generates detailed user personas using Groq LLMs via LangChain. Includes text-based output and PowerPoint slide generation. πŸ”—πŸ§ πŸ“Š

Topics

Resources

Stars

Watchers

Forks

Languages