# berubeey/revogue architecture

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

- Interactive diagram: https://gitdiagram.com/berubeey/revogue
- Repository: https://github.com/berubeey/revogue

## Overview

##### File structure
- Top-level directories:
- app/ (Next.js front end—components, layout, pages, global CSS)
- backend/ (FastAPI service, Python virtualenv, agents, RAG/index build scripts, vectorstore indexes, image assets, tests)
- public/, config files (tsconfig.json, tailwind.config.js, next.config.js)
- The backend has multiple subfolders:
- backend/agents: each agent’s code, knowledge markdown, RAG index files (FAISS)
- backend/rag_system: scripts to build/query FAISS indexes
- backend/vectorstore: persistent FAISS vector indexes per agent
- backend/main.py: FastAPI entry point
- backend/test: automated tests for each agent
- Key config/build files: requirements.txt (backend), package.json (frontend), next.config.js, tsconfig.json.

##### README for additional insights
- Technology stack: Frontend (Next.js 14, TypeScript, Tailwind CSS, Framer Motion), Backend (FastAPI, LangGraph, Google Gemini AI, OpenCV)
- Multi-agent orchestration with RAG (Retrieval-Augmented Generation) using FAISS

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend (UI Layer)"
        ChatInterface["ChatInterface.tsx"]:::ui
        Page["app/page.tsx"]:::ui
        Layout["app/layout.tsx"]:::ui
        CSS["globals.css"]:::ui
    end

    subgraph "Backend API (FastAPI)"
        API["main.py"]:::api
    end

    ChatInterface -->|HTTP/WebSocket| API
    Page -->|layout| ChatInterface
    Layout -->|styles| ChatInterface
    CSS -->|styles| ChatInterface

    subgraph "Agent Orchestrator"
        Orchestrator["agent_rag_templates.py"]:::api
        BaseAgent["base_agent.py"]:::api
    end

    API -->|invokes| Orchestrator
    Orchestrator -->|inherits| BaseAgent

    subgraph "Agent Cluster"
        Color["ColorAnalysis Agent"]:::agent
        Trend["TrendAnalyst Agent"]:::agent
        ImageC["ImageConsultant Agent"]:::agent
        Personal["PersonalSecretary Agent"]:::agent
        Encourager["Encourager Agent"]:::agent
        Lead["FashionDesigner Lead Agent"]:::agent
    end

    Orchestrator --> Color
    Orchestrator --> Trend
    Orchestrator --> ImageC
    Orchestrator --> Personal
    Orchestrator --> Encourager
    Orchestrator --> Lead

    subgraph "Persistence (FAISS Indexes)"
        ColorIndex["Color FAISS Index"]:::persistence
        TrendIndex["Trend FAISS Index"]:::persistence
        ImageIndex["ImageConsultant FAISS Index"]:::persistence
        EncouragerIndex["Encourager FAISS Index"]:::persistence
        PDIndex["FashionDesigner FAISS Index"]:::persistence
    end

    Color -->|retrieves| ColorIndex
    Trend -->|retrieves| TrendIndex
    ImageC -->|retrieves| ImageIndex
    Encourager -->|retrieves| EncouragerIndex
    Lead -->|aggregates & retrieves| PDIndex

    subgraph "External Services"
        OpenCV["OpenCV"]:::external
        Gemini["Google Gemini API"]:::external
    end

    Color -->|image processing| OpenCV
    Color -->|LLM calls| Gemini
    Trend -->|LLM calls| Gemini
    ImageC -->|LLM calls| Gemini
    Personal -->|LLM calls| Gemini
    Encourager -->|LLM calls| Gemini
    Lead -->|LLM calls| Gemini

    subgraph "Static Storage"
        Public["public/"]:::persistence
        Images["backend/images/"]:::persistence
    end

    API -->|serves| Public
    API -->|serves| Images

    subgraph "Dev / Batch Jobs & Tests"
        BuildScripts["build_faiss_index.py"]:::dev
        QueryUtil["query_faiss.py"]:::dev
        BatchTagging["batch_image_tagging.py"]:::dev
        Tests["Automated Tests"]:::dev
    end

    BuildScripts --> ColorIndex & TrendIndex & ImageIndex & EncouragerIndex & PDIndex
    QueryUtil --> ColorIndex & TrendIndex & ImageIndex & EncouragerIndex & PDIndex
    BatchTagging --> ImageIndex
    Tests --> Color & Trend & ImageC & Personal & Encourager & Lead

    click ChatInterface "https://github.com/berubeey/revogue/blob/main/app/components/ChatInterface.tsx"
    click Page "https://github.com/berubeey/revogue/blob/main/app/page.tsx"
    click Layout "https://github.com/berubeey/revogue/blob/main/app/layout.tsx"
    click CSS "https://github.com/berubeey/revogue/blob/main/app/globals.css"
    click API "https://github.com/berubeey/revogue/blob/main/backend/main.py"
    click Orchestrator "https://github.com/berubeey/revogue/blob/main/backend/agents/agent_rag_templates.py"
    click BaseAgent "https://github.com/berubeey/revogue/blob/main/backend/agents/base_agent.py"
    click Color "https://github.com/berubeey/revogue/blob/main/backend/agents/color_analyst_agent.py"
    click Trend "https://github.com/berubeey/revogue/blob/main/backend/agents/trend_analyst_agent.py"
    click ImageC "https://github.com/berubeey/revogue/blob/main/backend/agents/image_consultant_agent.py"
    click Personal "https://github.com/berubeey/revogue/blob/main/backend/agents/personal_secretary_agent.py"
    click Encourager "https://github.com/berubeey/revogue/blob/main/backend/agents/encourager_agent.py"
    click Lead "https://github.com/berubeey/revogue/blob/main/backend/agents/fashion_designer_agent.py"
    click BuildScripts "https://github.com/berubeey/revogue/blob/main/backend/rag_system/build_faiss_index.py"
    click QueryUtil "https://github.com/berubeey/revogue/blob/main/backend/rag_system/query_faiss.py"
    click BatchTagging "https://github.com/berubeey/revogue/blob/main/backend/batch_image_tagging.py"

    classDef ui fill:#cce5ff,stroke:#1f78b4
    classDef api fill:#d4edda,stroke:#2e7d32
    classDef agent fill:#ffe5b4,stroke:#ef6c00
    classDef persistence fill:#e5ccff,stroke:#6a1b9a
    classDef external fill:#d6d8db,stroke:#5f6368
    classDef dev fill:#f8d7da,stroke:#c62828
```
