# pranavagrawai/raa architecture

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

- Interactive diagram: https://gitdiagram.com/pranavagrawai/raa
- Repository: https://github.com/pranavagrawai/raa

## Overview

##### Project type and purpose
- RaA Benchmark is a Python-based CLI pipeline that runs a configurable, automated “telephone” game between modalities (image↔text), measures semantic drift after each iteration, and produces evaluation metrics plus visual and narrative reports.

##### File structure
- Top-level directories:
- configs: YAML files defining experiment parameters
- data: seed inputs (images, text) for experiments
- src: Python modules implementing core logic
- results: structured output artifacts (generated images/text, ratings, charts, summaries)
- tests: unit tests for each component
- Key modules in src:
- main.py – orchestrates end-to-end pipeline
- benchmark_config.py – loads & validates YAML config
- loop_controller.py – drives the I-T-I or T-I-T iterations
- prompt_engine.py – calls external generative model APIs
- evaluation_engine.py – runs pairwise comparisons via a multimodal LLM
- graph_creator.py – plots quantitative charts
- reporting_summary.py – composes qualitative drift summaries
- output_manager.py – handles file I/O into results/

##### README for additional insights
- The workflow is strictly linear/pipelined: configuration → seed data ingestion → iterative generation → evaluation → reporting → output.
- External dependency: AI model API (e.g., Google Gemini) accessed via prompt_engine using credentials from .env.

##### Essential architectural elements
- That all file reads/writes are managed by Output Manager into the results directory
- Tests suite as a side-band quality check

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Configuration & Entry"
        CLI["CLI / Entry Point"]:::entry
        ConfigLoader["Configuration Loader"]:::entry
    end

    subgraph "Generation Loop"
        LoopController["Loop Controller"]:::gen
        PromptEngine["Prompt Engine"]:::gen
        ExternalAPI["External Model API"]:::ext
    end

    subgraph "Evaluation"
        EvalEngine["Evaluation Engine"]:::eval
    end

    subgraph "Reporting & Output"
        GraphCreator["Graph Creator"]:::report
        ReportSummary["Reporting Summary Generator"]:::report
        OutputManager["Output Manager"]:::report
    end

    subgraph "Persistent Stores"
        ConfigStore["Config Store"]:::store
        DataStore["Seed Data Store"]:::store
        ResultsStore["Results Store"]:::store
        EnvCred["API Credentials (.env)"]:::store
        PromptTemplates["Prompt Templates"]:::store
    end

    Tests["Unit Tests Suite"]:::test

    CLI --> ConfigLoader
    ConfigLoader -->|"loads config"| ConfigStore
    ConfigLoader --> LoopController
    LoopController -->|"reads seed data"| DataStore
    LoopController --> PromptEngine
    PromptEngine --> ExternalAPI
    ExternalAPI --> PromptEngine
    PromptEngine -->|"artifact"| OutputManager
    OutputManager --> LoopController
    LoopController --> EvalEngine
    EvalEngine -->|"reads artifacts"| ResultsStore
    EvalEngine --> OutputManager
    EvalEngine --> GraphCreator
    GraphCreator -->|"reads ratings"| ResultsStore
    GraphCreator --> OutputManager
    GraphCreator --> ReportSummary
    ReportSummary --> OutputManager

    Tests -.-> CLI
    Tests -.-> ConfigLoader
    Tests -.-> LoopController
    Tests -.-> PromptEngine
    Tests -.-> EvalEngine
    Tests -.-> GraphCreator
    Tests -.-> ReportSummary
    Tests -.-> OutputManager

    click CLI "https://github.com/pranavagrawai/raa/blob/main/src/main.py"
    click ConfigLoader "https://github.com/pranavagrawai/raa/blob/main/src/benchmark_config.py"
    click ConfigStore "https://github.com/pranavagrawai/raa/tree/main/configs/"
    click DataStore "https://github.com/pranavagrawai/raa/tree/main/data/"
    click LoopController "https://github.com/pranavagrawai/raa/blob/main/src/loop_controller.py"
    click PromptEngine "https://github.com/pranavagrawai/raa/blob/main/src/prompt_engine.py"
    click PromptTemplates "https://github.com/pranavagrawai/raa/tree/main/prompts/"
    click EnvCred "https://github.com/pranavagrawai/raa/blob/main/.env.example"
    click EvalEngine "https://github.com/pranavagrawai/raa/blob/main/src/evaluation_engine.py"
    click GraphCreator "https://github.com/pranavagrawai/raa/blob/main/src/graph_creator.py"
    click ReportSummary "https://github.com/pranavagrawai/raa/blob/main/src/reporting_summary.py"
    click OutputManager "https://github.com/pranavagrawai/raa/blob/main/src/output_manager.py"
    click ResultsStore "https://github.com/pranavagrawai/raa/tree/main/results/"
    click Tests "https://github.com/pranavagrawai/raa/tree/main/tests/"

    classDef entry fill:#D6EAF8,stroke:#1F618D,color:#1F618D
    classDef gen fill:#D5F5E3,stroke:#239B56,color:#239B56
    classDef eval fill:#FCF3CF,stroke:#B7950B,color:#B7950B
    classDef report fill:#F5EEF8,stroke:#8E44AD,color:#8E44AD
    classDef store fill:#F2F3F4,stroke:#7B7D7D,color:#34495E
    classDef ext fill:#FDEBD0,stroke:#E67E22,color:#E67E22
    classDef test fill:#FADBD8,stroke:#C0392B,color:#922B21
```
