Skip to main content

Autonomous AI agent for tasteful recommendations via Reddit community analysis

Project description

Reddit Consensus Agent

Reddit Consensus Agent

An autonomous AI agent that provides tasteful insights by analyzing Reddit discussions and community feedback.

PyPI version Python 3.11+ License: MIT Rich Console


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

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:

  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

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

Requirements

  • Python 3.11+
  • OpenAI API access
  • Reddit API credentials

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reddit_consensus-0.1.2.tar.gz (26.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reddit_consensus-0.1.2-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

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

Hashes for reddit_consensus-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f7e3e7afed9b760b0a665ceff4d20de870bf2b365d28182d6d2bcc75d591f912
MD5 0e17832a5d3ce6e90d43527cbbf2dfea
BLAKE2b-256 a95305a2a05dd5cb8e9e220e5dbf74c2b25265aee18f3a35074a29bfe49facd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for reddit_consensus-0.1.2.tar.gz:

Publisher: publish.yml on jashvira/reddit-consensus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reddit_consensus-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for reddit_consensus-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc9270d6e1899cba92831df29d9d5182eaf0b9b9bd0f8d05f5a97090a8fb9bfb
MD5 18cc37c5ccd276fd6675c6eef2e5d93f
BLAKE2b-256 afb62b70d48816730b2465ea8c325c97c518e311053a37038df3d39577be079c

See more details on using hashes here.

Provenance

The following attestation bundles were made for reddit_consensus-0.1.2-py3-none-any.whl:

Publisher: publish.yml on jashvira/reddit-consensus

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page