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.

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

Interactive Session (Recommended)

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.0.tar.gz (24.8 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.0-py3-none-any.whl (22.6 kB view details)

Uploaded Python 3

File details

Details for the file reddit_consensus-0.1.0.tar.gz.

File metadata

  • Download URL: reddit_consensus-0.1.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for reddit_consensus-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a8097da47c5beb674fa95f63fa6fdd3fe071d5dee27e6ec135bb8d9c22dc76a3
MD5 359597499bb75f627cd7d2bf4e838066
BLAKE2b-256 8cf3f09bc4e7f6ec19a3198c80f2d6b3ec6a32f4ec6d16163cf7d3eafcc74c6e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for reddit_consensus-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c94c705e378979ada595de9b06385759e43052445713d8213b0eb71802ac9931
MD5 8dc297da802a4754022f4ef3c87c01a0
BLAKE2b-256 0a790d02dc547c2fb362330eadd3cbb603e9399a9cc6fa6f03683af77fabdee0

See more details on using hashes here.

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