Autonomous AI agent for tasteful recommendations via Reddit community analysis
Project description
Reddit Consensus Agent
An autonomous AI agent that provides tasteful insights by analyzing Reddit discussions and community feedback.
Features
- Elegant Console UI: Clean side-by-side dashboard with responsive layout
- Async Parallel Tool Execution: Uses asyncio for fast, concurrent Reddit API calls
- Two-Phase Research: Initial research followed by critical analysis
- Community-Driven: Analyzes real Reddit discussions and user opinions
- Balanced Insights: Provides both pros and cons based on community feedback
- Configurable AI Models: Uses
gpt-4.1-miniby default, but supports other OpenAI models viaconfig.py
Architecture
- Agent State Management: Tracks research progress and findings
- Reddit Tools: Async tools for searching posts and analyzing comments
- Prompt Templates: Centralized prompts for consistent AI interactions
- Parallel Processing: Simultaneous tool execution for faster results
Quick Start
Installation
# Install from PyPI
pip install reddit-consensus
# Or clone and install from source
git clone https://github.com/jashvira/reddit-consensus.git
cd reddit-consensus
uv sync
Interactive Session (Recommended)
# If installed from PyPI
ask-reddit
# If running from source
python ask_reddit.py
The interactive session will:
- Check your API keys (or help you enter them)
- Ask what you'd like insights on
- Analyze Reddit discussions with elegant dashboard
- Show balanced insights with pros/cons
- Offer to answer another query
Programmatic Usage
import asyncio
from reddit_consensus.recommender import AutonomousRedditConsensus
async def main():
agent = AutonomousRedditConsensus()
result = await agent.process_query("Best cafes in Adelaide Hills")
agent.print_results()
asyncio.run(main())
Setup
1. Install Dependencies
uv sync
2. API Keys
You can either set environment variables or enter them when prompted:
Option A: Environment Variables (Recommended)
export OPENAI_API_KEY="your-openai-api-key"
export REDDIT_CLIENT_ID="your-reddit-client-id"
export REDDIT_CLIENT_SECRET="your-reddit-client-secret"
export REDDIT_USER_AGENT="YourApp/1.0 (by /u/yourusername)"
Option B: Enter When Prompted
Run python ask_reddit.py and the interactive session will help you enter credentials.
3. Get API Keys
- OpenAI: https://platform.openai.com/
- Reddit: https://www.reddit.com/prefs/apps/ (create "script" app)
Requirements
- Python 3.11+
- OpenAI API access
- Reddit API credentials
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reddit_consensus-0.1.2.tar.gz.
File metadata
- Download URL: reddit_consensus-0.1.2.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7e3e7afed9b760b0a665ceff4d20de870bf2b365d28182d6d2bcc75d591f912
|
|
| MD5 |
0e17832a5d3ce6e90d43527cbbf2dfea
|
|
| BLAKE2b-256 |
a95305a2a05dd5cb8e9e220e5dbf74c2b25265aee18f3a35074a29bfe49facd6
|
Provenance
The following attestation bundles were made for reddit_consensus-0.1.2.tar.gz:
Publisher:
publish.yml on jashvira/reddit-consensus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reddit_consensus-0.1.2.tar.gz -
Subject digest:
f7e3e7afed9b760b0a665ceff4d20de870bf2b365d28182d6d2bcc75d591f912 - Sigstore transparency entry: 267752573
- Sigstore integration time:
-
Permalink:
jashvira/reddit-consensus@ea747148154059413c71788698b702bd6029bd6a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jashvira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea747148154059413c71788698b702bd6029bd6a -
Trigger Event:
release
-
Statement type:
File details
Details for the file reddit_consensus-0.1.2-py3-none-any.whl.
File metadata
- Download URL: reddit_consensus-0.1.2-py3-none-any.whl
- Upload date:
- Size: 25.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc9270d6e1899cba92831df29d9d5182eaf0b9b9bd0f8d05f5a97090a8fb9bfb
|
|
| MD5 |
18cc37c5ccd276fd6675c6eef2e5d93f
|
|
| BLAKE2b-256 |
afb62b70d48816730b2465ea8c325c97c518e311053a37038df3d39577be079c
|
Provenance
The following attestation bundles were made for reddit_consensus-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on jashvira/reddit-consensus
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reddit_consensus-0.1.2-py3-none-any.whl -
Subject digest:
fc9270d6e1899cba92831df29d9d5182eaf0b9b9bd0f8d05f5a97090a8fb9bfb - Sigstore transparency entry: 267752575
- Sigstore integration time:
-
Permalink:
jashvira/reddit-consensus@ea747148154059413c71788698b702bd6029bd6a -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/jashvira
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ea747148154059413c71788698b702bd6029bd6a -
Trigger Event:
release
-
Statement type: