# manzarali25/agentred architecture

> Architecture diagram of the GitHub repository manzarali25/agentred, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manzarali25/agentred
- Repository: https://github.com/manzarali25/agentred

## Overview

##### Project type and purpose
- This is a Python‐based AI simulation system combining data retrieval (PRAW API), multi‐agent debate chains (LangChain), and judgment modeling. It’s not a web front‐end app but a CLI/entry‐point script (app.py) and Jupyter notebooks for experimentation.

##### File structure
- Top‐level files:
- AgentRed.py – core orchestration module
- app.py – command‐line or API entry point
- requirements.txt – lists dependencies (LangGraph, LangChain, PRAW, etc.)
- .devcontainer/devcontainer.json – dev environment config
- Notebooks – AgentRed.ipynb for interactive exploration
- No separate “frontend” or “backend” folders: all logic lives in Python modules.

##### README for additional insights
- The README describes three main processing stages:
a) Retriever Agent (LangGraph + PRAW)
b) Debate Agents (Support Chain & Counter Chain using LangChain)
c) Judge Chain (evaluates debate)
- Core data flows: user topic → Reddit retrieval → argument extraction/summarization → multi‐round debate → judgment.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface
    UI["CLI / Notebook Interface<br/>(app.py / AgentRed.ipynb)"]:::ui

    %% Core Modules
    subgraph "Core Modules"
        RA["Retriever Agent"]:::core
        DP["Data Processor"]:::core
        SC["Support Chain"]:::agent
        CC["Counter Chain"]:::agent
        JC["Judge Chain"]:::agent
        DS["Data Store<br/>(In-memory Cache)"]:::store
    end

    %% External Services
    subgraph "External Services"
        RED["Reddit (PRAW API)"]:::external
        LLM["OpenAI / LLM Service"]:::external
    end

    %% Flows
    UI -->|"topic"| RA
    RA -->|"retrieve_submissions()"| RED
    RED -->|threads| RA
    RA -->|raw_data| DP
    DP -->|"extract_axis(), summarize()"| DS
    DS -->|"context"| SC
    DS -->|"context"| CC
    SC -->|"arguments"| CC
    CC -->|"counter-arguments"| SC
    SC -->|"debate_history"| DS
    CC -->|"debate_history"| DS
    DS -->|"history"| JC
    JC -->|"verdict"| UI

    RED -->|"API calls"| requirements["requirements.txt"]:::config
    LLM -->|"LLM calls"| requirements

    %% Click Events
    click UI "https://github.com/manzarali25/agentred/blob/master/app.py"
    click UI "https://github.com/manzarali25/agentred/blob/master/AgentRed.ipynb"
    click RA "https://github.com/manzarali25/agentred/blob/master/AgentRed.py"
    click DP "https://github.com/manzarali25/agentred/blob/master/AgentRed.py"
    click SC "https://github.com/manzarali25/agentred/blob/master/AgentRed.py"
    click CC "https://github.com/manzarali25/agentred/blob/master/AgentRed.py"
    click JC "https://github.com/manzarali25/agentred/blob/master/AgentRed.py"
    click requirements "https://github.com/manzarali25/agentred/blob/master/requirements.txt"
    click devcontainer "https://github.com/manzarali25/agentred/blob/master/.devcontainer/devcontainer.json"

    %% Styles
    classDef ui fill:#FFD580,stroke:#CC8500,color:#000,stroke-width:1px;
    classDef core fill:#A0D6B4,stroke:#2E7D32,color:#000,stroke-width:1px;
    classDef agent fill:#90CAF9,stroke:#1565C0,color:#000,stroke-width:1px;
    classDef store fill:#FFE082,stroke:#FF8F00,color:#000,stroke-width:1px;
    classDef external fill:#E1BEE7,stroke:#6A1B9A,color:#000,stroke-width:1px;
    classDef config fill:#EEEEEE,stroke:#AAAAAA,color:#000,stroke-width:1px;
```
