<div align="center">
<img src="logo.png" alt="Reddit Consensus Agent" width="120" height="120">
# Reddit Consensus Agent
*An autonomous AI agent that provides tasteful insights by analyzing Reddit discussions and community feedback.*
[](https://badge.fury.io/py/reddit-consensus)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
[](https://github.com/Textualize/rich)
</div>
---
## 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-mini` by default, but supports other OpenAI models via [`config.py`](reddit_consensus/config.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
```bash
# 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)
```bash
# If installed from PyPI
ask-reddit
# If running from source
python ask_reddit.py
```
The interactive session will:
1. Check your API keys (or help you enter them)
2. Ask what you'd like insights on
3. Analyze Reddit discussions with elegant dashboard
4. Show balanced insights with pros/cons
5. Offer to answer another query
### Programmatic Usage
```python
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
```bash
uv sync
```
### 2. API Keys
You can either set environment variables or enter them when prompted:
#### Option A: Environment Variables (Recommended)
```bash
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
Raw data
{
"_id": null,
"home_page": null,
"name": "reddit-consensus",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": "Jash Vira <jashvira2001404@gmail.com>",
"keywords": "reddit, ai, agent, recommendations, consensus, community",
"author": null,
"author_email": "Jash Vira <jashvira2001404@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/a9/53/05a2a05dd5cb8e9e220e5dbf74c2b25265aee18f3a35074a29bfe49facd6/reddit_consensus-0.1.2.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n\n<img src=\"logo.png\" alt=\"Reddit Consensus Agent\" width=\"120\" height=\"120\">\n\n# Reddit Consensus Agent\n\n*An autonomous AI agent that provides tasteful insights by analyzing Reddit discussions and community feedback.*\n\n[](https://badge.fury.io/py/reddit-consensus)\n[](https://www.python.org/downloads/)\n[](https://opensource.org/licenses/MIT)\n[](https://github.com/Textualize/rich)\n\n</div>\n\n---\n\n## Features\n\n- **Elegant Console UI**: Clean side-by-side dashboard with responsive layout\n- **Async Parallel Tool Execution**: Uses asyncio for fast, concurrent Reddit API calls\n- **Two-Phase Research**: Initial research followed by critical analysis\n- **Community-Driven**: Analyzes real Reddit discussions and user opinions\n- **Balanced Insights**: Provides both pros and cons based on community feedback\n- **Configurable AI Models**: Uses `gpt-4.1-mini` by default, but supports other OpenAI models via [`config.py`](reddit_consensus/config.py)\n\n## Architecture\n\n- **Agent State Management**: Tracks research progress and findings\n- **Reddit Tools**: Async tools for searching posts and analyzing comments\n- **Prompt Templates**: Centralized prompts for consistent AI interactions\n- **Parallel Processing**: Simultaneous tool execution for faster results\n\n## Quick Start\n\n### Installation\n```bash\n# Install from PyPI\npip install reddit-consensus\n\n# Or clone and install from source\ngit clone https://github.com/jashvira/reddit-consensus.git\ncd reddit-consensus\nuv sync\n```\n\n### Interactive Session (Recommended)\n```bash\n# If installed from PyPI\nask-reddit\n\n# If running from source\npython ask_reddit.py\n```\n\nThe interactive session will:\n1. Check your API keys (or help you enter them)\n2. Ask what you'd like insights on\n3. Analyze Reddit discussions with elegant dashboard\n4. Show balanced insights with pros/cons\n5. Offer to answer another query\n\n### Programmatic Usage\n```python\nimport asyncio\nfrom reddit_consensus.recommender import AutonomousRedditConsensus\n\nasync def main():\n agent = AutonomousRedditConsensus()\n result = await agent.process_query(\"Best cafes in Adelaide Hills\")\n agent.print_results()\n\nasyncio.run(main())\n```\n\n## Setup\n\n### 1. Install Dependencies\n```bash\nuv sync\n```\n\n### 2. API Keys\nYou can either set environment variables or enter them when prompted:\n\n#### Option A: Environment Variables (Recommended)\n```bash\nexport OPENAI_API_KEY=\"your-openai-api-key\"\nexport REDDIT_CLIENT_ID=\"your-reddit-client-id\"\nexport REDDIT_CLIENT_SECRET=\"your-reddit-client-secret\"\nexport REDDIT_USER_AGENT=\"YourApp/1.0 (by /u/yourusername)\"\n```\n\n#### Option B: Enter When Prompted\nRun `python ask_reddit.py` and the interactive session will help you enter credentials.\n\n### 3. Get API Keys\n- **OpenAI**: https://platform.openai.com/\n- **Reddit**: https://www.reddit.com/prefs/apps/ (create \"script\" app)\n\n## Requirements\n\n- Python 3.11+\n- OpenAI API access\n- Reddit API credentials\n",
"bugtrack_url": null,
"license": null,
"summary": "Autonomous AI agent for tasteful recommendations via Reddit community analysis",
"version": "0.1.2",
"project_urls": {
"Bug Tracker": "https://github.com/jashvira/reddit-consensus/issues",
"Documentation": "https://github.com/jashvira/reddit-consensus#readme",
"Homepage": "https://github.com/jashvira/reddit-consensus",
"Repository": "https://github.com/jashvira/reddit-consensus.git"
},
"split_keywords": [
"reddit",
" ai",
" agent",
" recommendations",
" consensus",
" community"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "afb62b70d48816730b2465ea8c325c97c518e311053a37038df3d39577be079c",
"md5": "18cc37c5ccd276fd6675c6eef2e5d93f",
"sha256": "fc9270d6e1899cba92831df29d9d5182eaf0b9b9bd0f8d05f5a97090a8fb9bfb"
},
"downloads": -1,
"filename": "reddit_consensus-0.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "18cc37c5ccd276fd6675c6eef2e5d93f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.11",
"size": 25083,
"upload_time": "2025-07-08T16:34:58",
"upload_time_iso_8601": "2025-07-08T16:34:58.818469Z",
"url": "https://files.pythonhosted.org/packages/af/b6/2b70d48816730b2465ea8c325c97c518e311053a37038df3d39577be079c/reddit_consensus-0.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "a95305a2a05dd5cb8e9e220e5dbf74c2b25265aee18f3a35074a29bfe49facd6",
"md5": "0e17832a5d3ce6e90d43527cbbf2dfea",
"sha256": "f7e3e7afed9b760b0a665ceff4d20de870bf2b365d28182d6d2bcc75d591f912"
},
"downloads": -1,
"filename": "reddit_consensus-0.1.2.tar.gz",
"has_sig": false,
"md5_digest": "0e17832a5d3ce6e90d43527cbbf2dfea",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.11",
"size": 26494,
"upload_time": "2025-07-08T16:35:00",
"upload_time_iso_8601": "2025-07-08T16:35:00.167270Z",
"url": "https://files.pythonhosted.org/packages/a9/53/05a2a05dd5cb8e9e220e5dbf74c2b25265aee18f3a35074a29bfe49facd6/reddit_consensus-0.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-08 16:35:00",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jashvira",
"github_project": "reddit-consensus",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "reddit-consensus"
}