# quantum-369/vox-omni architecture

> Architecture diagram of the GitHub repository quantum-369/vox-omni, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/quantum-369/vox-omni
- Repository: https://github.com/quantum-369/vox-omni

## Overview

##### Project Overview and Type
- This project is a multi-agent AI platform focused on data analysis, competitor research, and intelligent query resolution.
- It integrates several different AI models and services (Gemini 2.0 Flash, OpenAI GPT, Claude, and Perplexity AI) to handle general queries, conduct SQL-based data analysis, and generate competitive insights.
- It is a full-stack application to some extent: it features a basic web frontend (index.html, script.js, style.css) likely meant for user interactions and a robust Python backend handling the AI logic and data analytics.

##### Analyzing the File Structure
- Front-end Components:
- index.html, script.js, and style.css indicate a user interface layer. Their inclusion suggests that users interact via a web page which possibly feeds input to the backend.
- Core Python Modules:
- gemini_database_assistant.py: Acts as the main entry point for the assistant, coordinating the integration of different modules.
- Integrated_analyser.py and Successful_Analyser.py: Handle integrated analysis workflows and advanced (diagnostic, predictive, prescriptive) analytics respectively.
- csv_creator.py: Responsible for generating CSV reports from database queries.
- sql_assistant.py: Processes SQL queries, likely using the LangChain SQL toolkit.
- perplexity_agent.py: Integrates Perplexity AI to perform real-time competitor analysis.
- function_library.py: Provides shared utility functions (for token management, query handling, etc.).
- Additional Files and Assets:
- server.py might be used to launch or coordinate a server for handling incoming requests.
- The included LICENSE and README files ensure the project’s open-source nature.

##### Key Components and Their Relationships
- User Interface (UI) Layer:
- index.html, script.js, style.css provide the front-end through which users input queries.
- Main Control/Coordinator:
- gemini_database_assistant.py is the central coordinator that routes requests to different agents based on the type of query.
- Data Analysis Modules:
- csv_creator.py and sql_assistant.py work together to handle data retrieval, CSV generation, and SQL execution.
- Successful_Analyser.py (for advanced analytics) works with CSV data and interacts with Claude for programmatically generated Python analyses.
- Specialized Agents:
- Integrated_analyser.py likely consolidates the outputs from various analytic efforts.
- perplexity_agent.py focuses on competitor queries by interfacing with Perplexity AI.
- External API Integrations:

##### Architectural Patterns and Technologies
- Multi-agent pattern: Clearly divide the responsibilities among different agent modules.
- Service Oriented Architecture (SOA) style: Although not strictly microservices, each module (SQL querying, CSV creation, competitor research) acts as self-contained components.
- Modular & Layered Design: The separation between UI and backend, and further modularization within backend components.
- Relevant technologies include Python 3.9+, web technologies (HTML/CSS/JS), database engines (MySQL, PostgreSQL via SQL assistants), and external APIs.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        FE1["index.html"]:::frontend
        FE2["script.js"]:::frontend
        FE3["style.css"]:::frontend
    end

    %% Backend Components
    subgraph "Backend Components"
        SV["server.py"]:::server
        GD["gemini_database_assistant.py"]:::coordinator
        IA["Integrated_analyser.py"]:::data
        SA["Successful_Analyser.py"]:::data
        CC["csv_creator.py"]:::data
        SQL["sql_assistant.py"]:::data
        PA["perplexity_agent.py"]:::data
        FL["function_library.py"]:::utility
    end

    %% External API Services
    subgraph "External API Services"
        GEM["Gemini 2.0"]:::external
        OAI["OpenAI GPT"]:::external
        CLAU["Claude"]:::external
        PERX["Perplexity AI"]:::external
    end

    %% Connections from Frontend to Server
    FE1 -->|"sendsRequest"| SV
    FE2 -->|"sendsRequest"| SV
    FE3 -->|"sendsRequest"| SV

    %% Server routes to Backend Coordinator
    SV -->|"routesTo"| GD

    %% Backend Coordinator to Data Processing Modules
    GD -->|"dataQuery"| SQL
    GD -->|"dataQuery"| CC
    SQL -->|"processQuery"| SA
    CC -->|"generateCSV"| SA
    SA -->|"advancedAnalyze"| CLAU

    %% Backend Coordinator to Integrated Analysis Module
    GD -->|"integratedAnalysis"| IA

    %% Backend Coordinator to Competitor Analysis
    GD -->|"competitorQuery"| PA
    PA -->|"analyzeCompetitor"| PERX

    %% Backend Coordinator for General Queries
    GD -->|"generalQuery"| GEM
    GD -->|"generalQuery"| OAI

    %% Utility Library support (dotted lines)
    GD ---|"util"| FL
    SQL ---|"util"| FL
    CC ---|"util"| FL
    SA ---|"util"| FL
    IA ---|"util"| FL
    PA ---|"util"| FL

    %% Click Events for Frontend Components
    click FE1 "https://github.com/quantum-369/vox-omni/blob/main/index.html"
    click FE2 "https://github.com/quantum-369/vox-omni/blob/main/script.js"
    click FE3 "https://github.com/quantum-369/vox-omni/blob/main/style.css"

    %% Click Events for Backend Components
    click SV "https://github.com/quantum-369/vox-omni/blob/main/server.py"
    click GD "https://github.com/quantum-369/vox-omni/blob/main/gemini_database_assistant.py"
    click IA "https://github.com/quantum-369/vox-omni/blob/main/Integrated_analyser.py"
    click SA "https://github.com/quantum-369/vox-omni/blob/main/Successful_Analyser.py"
    click CC "https://github.com/quantum-369/vox-omni/blob/main/csv_creator.py"
    click SQL "https://github.com/quantum-369/vox-omni/blob/main/sql_assistant.py"
    click PA "https://github.com/quantum-369/vox-omni/blob/main/perplexity_agent.py"
    click FL "https://github.com/quantum-369/vox-omni/blob/main/function_library.py"

    %% Styles
    classDef frontend fill:#f9c74f,stroke:#333,stroke-width:2px;
    classDef server fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef coordinator fill:#90be6d,stroke:#333,stroke-width:2px;
    classDef data fill:#f94144,stroke:#333,stroke-width:2px;
    classDef external fill:#577590,stroke:#333,stroke-width:2px;
    classDef utility fill:#f3722c,stroke:#333,stroke-width:2px;
```
