# jbexta/agentpilot architecture

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

- Interactive diagram: https://gitdiagram.com/jbexta/agentpilot
- Repository: https://github.com/jbexta/agentpilot

## Overview

- GUI Layer: Represented by the src/gui directory, this includes the main interface, windows, pages (like chat, settings, agents, etc.), widgets, and style components. This layer drives the user interaction and displays workflows.
- Core System & Business Logic: Found in src/system and src/members, these components handle the logic for managing agents, workflows, blocks, notifications, and user interactions. For example, files for agents, blocks, and nodes reside here.
- Plugins & Extensibility: The src/plugins folder contains numerous plugins (e.g., awspolly, openaiassistant, openinterpreter) with consistent subfolder/module organization. This clearly denotes a plugin-based architecture where add-ons extend the capabilities of the core system.
- Utility and Configuration: Directories like src/utils (and configuration files such as pyproject.toml and requirements.txt) provide helpers, file system interactions, language support, and setup for dynamic configuration.
- Data Persistence: The single data.db file suggests an integrated database (likely SQLite) holding state, user data, chat histories, or workflow configurations.
- Build & Deployment: Scripts like build.py, build.spec, and documentation under docs indicate build procedures and guides for deployment.

##### Relationships and Interactions
- The configuration files (pyproject.toml, requirements.txt) support the overall project setup and dependency management. A smaller section for “Deployment/Build Tools” can include build.py, build.spec, and docs/guides.

##### Architectural Patterns
- MVC/Separation of Concerns: The GUI (view) is clearly separated from the business logic (controller/model). While not a strict MVC implementation, the separation allows for dynamic UI changes and backend processing.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Frontend Layer: GUI Components
    subgraph "Frontend (GUI Layer)"
        GUI["GUI Components"]:::frontend
        GUI_Pages["Pages"]:::frontend
        GUI_Windows["Windows"]:::frontend
        GUI_Widgets["Widgets"]:::frontend
        GUI_Main["Main Interface"]:::frontend
        GUI_Config["UI Configuration"]:::frontend
    end

    %% Backend Layer: Core System & Business Logic
    subgraph "Backend (Core System & Business Logic)"
        Core["Core Workflow Engine"]:::core
        Agents["Agents & Workflows"]:::core
    end

    %% Plugins & Extensibility
    subgraph "Plugins & Extensions"
        Plugins["Plugin Manager & Extensions"]:::plugin
        Plugin_AWSPolly["AWSPolly Plugin"]:::plugin
        Plugin_OpenAIAssistant["OpenAI Assistant Plugin"]:::plugin
        Plugin_OpenInterpreter["Open Interpreter Plugin"]:::plugin
    end

    %% Data Persistence Layer
    subgraph "Data Persistence"
        Data["Data Storage"]:::database
    end

    %% Utility and Configuration
    subgraph "Utilities & Configuration"
        Utils["Utility Functions"]:::utils
        PyProject["Project Config"]:::utils
        Requirements["Dependencies"]:::utils
    end

    %% Build & Deployment Tools
    subgraph "Build & Deployment"
        Build["Build Tools"]:::build
        Doc_Plugin["Plugin Guide"]:::build
        Doc_Build["Build Guide"]:::build
    end

    %% Main Connections
    GUI -->|"triggers"| Core
    Core -->|"manages"| Agents
    Core <-->|"fetchesSaves"| Data
    GUI <-->|"readsWrites"| Data
    Plugins -->|"extends"| Core
    Plugins -->|"integratesWith"| Agents

    %% Supporting relationships from Utilities & Configuration
    Utils ---|"supports"| GUI
    Utils ---|"supports"| Core
    Utils ---|"supports"| Plugins
    Utils ---|"supports"| Build

    %% Build Tools Deployment connection
    Build -->|"deploys"| Core

    %% Click Events for Frontend Layer
    click GUI "https://github.com/jbexta/agentpilot/tree/master/src/gui"
    click GUI_Pages "https://github.com/jbexta/agentpilot/tree/master/src/gui/pages"
    click GUI_Windows "https://github.com/jbexta/agentpilot/tree/master/src/gui/windows"
    click GUI_Widgets "https://github.com/jbexta/agentpilot/tree/master/src/gui/widgets"
    click GUI_Main "https://github.com/jbexta/agentpilot/blob/master/src/gui/main.py"
    click GUI_Config "https://github.com/jbexta/agentpilot/blob/master/src/gui/config.py"

    %% Click Events for Backend System & Business Logic
    click Core "https://github.com/jbexta/agentpilot/tree/master/src/system"
    click Agents "https://github.com/jbexta/agentpilot/tree/master/src/members"
    
    %% Click Events for Plugins & Extensions
    click Plugins "https://github.com/jbexta/agentpilot/tree/master/src/plugins"
    click Plugin_AWSPolly "https://github.com/jbexta/agentpilot/tree/master/src/plugins/awspolly"
    click Plugin_OpenAIAssistant "https://github.com/jbexta/agentpilot/tree/master/src/plugins/openaiassistant"
    click Plugin_OpenInterpreter "https://github.com/jbexta/agentpilot/tree/master/src/plugins/openinterpreter"

    %% Click Events for Utilities and Configuration
    click Utils "https://github.com/jbexta/agentpilot/tree/master/src/utils"
    click PyProject "https://github.com/jbexta/agentpilot/blob/master/pyproject.toml"
    click Requirements "https://github.com/jbexta/agentpilot/blob/master/requirements.txt"

    %% Click Event for Data Persistence
    click Data "https://github.com/jbexta/agentpilot/blob/master/data.db"

    %% Click Events for Build & Deployment
    click Build "https://github.com/jbexta/agentpilot/blob/master/build.py"
    click Doc_Plugin "https://github.com/jbexta/agentpilot/blob/master/docs/guides/creating_a_plugin.md"
    click Doc_Build "https://github.com/jbexta/agentpilot/blob/master/docs/guides/how_to_build.md"

    %% Styles
    classDef frontend fill:#a8d0e6,stroke:#374785,stroke-width:2px;
    classDef core fill:#f76c5e,stroke:#374785,stroke-width:2px;
    classDef plugin fill:#afc3d9,stroke:#374785,stroke-width:2px;
    classDef database fill:#f8b195,stroke:#374785,stroke-width:2px;
    classDef utils fill:#c9d6ea,stroke:#374785,stroke-width:2px;
    classDef build fill:#99d98c,stroke:#374785,stroke-width:2px;
```
