# libraryofcelsus/aetherius_ai_assistant architecture

> Architecture diagram of the GitHub repository libraryofcelsus/aetherius_ai_assistant, 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/libraryofcelsus/aetherius_ai_assistant
- Repository: https://github.com/libraryofcelsus/aetherius_ai_assistant

## Overview

##### Project’s Nature and Goals
- Project Type: A modular, locally operated AI assistant and multi-agent framework.
- Purpose: To provide a digital personal assistant with advanced memory management (explicit, episodic, etc.), multi-agent processing, external data integration (web scrapes, file processing, OCR), and support for multiple AI backends (Oobabooga, KoboldCpp, OpenAI, AetherNode). The system is designed to be both a chatbot and an orchestrator that handles complex agent loops and memory operations.

##### File Structure for Key Components
- Core Engine – Aetherius_API:
- Contains the main entry script (Main.py), API settings, configuration files (chatbot_settings.json), languages for generation (Generation_Settings), and model format definitions.
- Subdirectories like “Sub_Agents” (for various agent implementations: Llama_2, KoboldCpp, Oobabooga, OpenAi) encapsulate different agent modules.
- “Cloning”, “Examples”, “Tools”, “Utilities”, and “resources” indicate auxiliary functions that support data conversion (e.g., audio conversion), web scraping, memory search strategies, and integration with external libraries.
- User Interface – Aetherius_GUI and Terminal/CLI Scripts:
- Provided by the Aetherius_GUI folder and several run_*.bat / shell scripts for launching different modes, including a dedicated terminal UI.
- External Integrations and Configuration:
- API keys folder and configuration scripts (like API_Settings.json) reveal integration with external services (e.g., OpenAI, Qdrant, Tesseract, Ngrok).
- Database and Memory Storage:
- Qdrant integration and file uploads (Upload folder) suggest a dedicated layer for long-term memory storage and retrieval.

##### Key High-Level Components
A. Frontend Layer:
– User Interfaces (GUI, Terminal, Discord Bot, possibly Gradio UI).
– Input layer capturing user requests.
B. Main AI Engine (Aetherius_API):
– Input Processing Module: processes user input, handles input expansion and conversation history.
– Core Agent Architecture: the flow with multiple stages:
- Knowledge Domain Extraction
- Semantic Term Separation
- First Memory DB Search (for inner monologue generation)
- Inner Monologue Generation and Second Memory DB Search (for intuition generation)
- Implicit Memory Generation and Final Response Generation
- Explicit and Episodic Memory Generation and subsequent updates.
– Sub-Agent Manager: Handles the dynamic invocation of sub-agents for specialized tasks (e.g., External Resource Search, Memory Search types like episodic or flashbulb).
– Memory and Task Management: Modules for memory consolidation (implicit, explicit, episodic) and tasklist generation.
C. Tools and Auxiliary Services:
– Web Scrapers, File Processors, and OCR modules (within the Tools directory and Utilities).
– External Script Triggers: Additional isolated scripts from Cloning or Examples folders that complement processing (e.g., converting audio files).
D. Database and External APIs:
– External AI Model Providers: Represent integrations with OpenAI, KoboldCpp, Oobabooga, and AetherNode for LLM inference.
– API Gateway (API_Settings.json and Discord Bot trigger): Showing how the service can expose itself externally when needed (e.g., via Ngrok or a dedicated REST API).
E. Configuration and Deployment:
– Configuration Files (chatbot_settings.json, various settings.json files under Generation_Settings and model formats).
– Installer Scripts and Docker for Qdrant, showing containerization/deployment aspects.

##### Representing Relationships and Data Flow
- User Input (via UI) → AI Engine → Memory Modules → Sub-Agent invocations → External Data/Tools → Final Response.
– Break out the agent loop components (e.g., “Input Expansion” to “Inner Monologue Generation” to “Tasklist Generation”) as sequential modules.
– Indicate interactions between modules (e.g., the Sub-Agent Manager drives calls to different Memory Search scripts in the “Sub_Agents” folder).

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        UI_GUI["User Interface (GUI)"]:::frontend
        UI_Term["User Interface (Terminal - Python)"]:::frontend
        UI_Bat["User Interface (Terminal - Batch)"]:::frontend
    end

    subgraph "Core Engine"
        MAIN["Main Engine"]:::backend
        CFG["Configuration"]:::config
        SA["Sub-Agent Manager"]:::backend
        IP["Input Processing & Memory Search"]:::backend
    end

    subgraph "Auxiliary & External Services"
        TOOLS["Tools & Utilities"]:::tools
        API_CFG["API Configuration & Keys"]:::external
        DB["Database & Memory Storage"]:::db
        CLONE["External Script Triggers & Data Conversion"]:::tools
    end

    %% Data Flow
    UI_GUI -->|"sends input"| IP
    UI_Term -->|"sends input"| IP
    UI_Bat -->|"sends input"| IP

    IP -->|"processed input"| MAIN
    IP -->|"triggers agents"| SA

    MAIN -->|"loads settings"| CFG
    MAIN -->|"invokes sub-agents"| SA
    MAIN -->|"calls tools"| TOOLS

    SA -->|"requests external data"| API_CFG
    SA -->|"updates memory"| DB

    API_CFG -->|"configures"| TOOLS
    API_CFG -->|"integrates with"| DB
    TOOLS -->|"executes conversions"| CLONE

    %% Click Events for Core Engine
    click MAIN "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/Aetherius_API/Main.py"
    click CFG "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/Aetherius_API/chatbot_settings.json"
    click CFG "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Generation_Settings"
    click CFG "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Model_Formats"
    click SA "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Sub_Agents"
    click IP "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Chatbot_Prompts"

    %% Click Events for UI Layer
    click UI_GUI "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/Aetherius_GUI/Aetherius_GUI.py"
    click UI_Term "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/Aetherius_Terminal_Mode.py"
    click UI_Bat "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/run_windows_aetherius_terminal_mode.bat"

    %% Click Events for External Integrations
    click API_CFG "https://github.com/libraryofcelsus/aetherius_ai_assistant/blob/main/API_Settings.json"
    click API_CFG "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/api_keys"

    %% Click Events for Tools & Auxiliary Services
    click TOOLS "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Tools"
    click TOOLS "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Utilities"

    %% Click Events for Database & Cloning
    click DB "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Upload"
    click CLONE "https://github.com/libraryofcelsus/aetherius_ai_assistant/tree/main/Aetherius_API/Cloning"

    %% Styles
    classDef frontend fill:#FFCC00,stroke:#000,stroke-width:2px;
    classDef backend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef config fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef external fill:#FF9999,stroke:#000,stroke-width:2px;
    classDef db fill:#DDA0DD,stroke:#000,stroke-width:2px;
    classDef tools fill:#B0E0E6,stroke:#000,stroke-width:2px;
```
