# manavdarji2/artificial-intelligence architecture

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

- Interactive diagram: https://gitdiagram.com/manavdarji2/artificial-intelligence
- Repository: https://github.com/manavdarji2/artificial-intelligence

## Overview

##### Project Type and Purpose
- The README indicates that this is a "Personal AI Assistance" application aimed for desktop use.
- The project has been implemented entirely in Python, which suggests that the design should emphasize modular Python scripts that include AI logic, command handling, API integration, and file or app management.

##### File Structure
- There are several Python files, each seemingly corresponding to a specific functionality:
- AI_manav.py and Gemini_ai.py: Likely contain core AI logic or different AI modules. They might represent separate brains or processing units within the project, possibly handling distinct tasks.
- command_ai.py: Likely processes user commands or coordinates between different AI modules.
- say_AI.py: Possibly responsible for text-to-speech or verbal output.
- open_app_function.py: Could handle launching desktop applications or interfacing with other apps.
- get_api_key_value.py: Manages retrieval of API keys, indicating integration with external services or APIs.
- check_if.py: May handle conditional checks, validations, or state management.
- save_file.py: Manages file-saving operations, suggesting persistence or logging.
- AI_info.txt: A text file that might store additional information or configuration details.
- README.md and .gitignore mark documentation and project setup considerations.

##### Main Components
- Core AI Modules: Represented by AI_manav.py and Gemini_ai.py. These modules could be drawn as separate “engine” components illustrating AI reasoning or processing.
- Command Handling Unit: command_ai.py acts as a bridge between user inputs (or events) and the AI modules.
- Voice/Output Component: say_AI.py should be included to show how the system provides output or interacts through speech.
- Application/Service Launcher: open_app_function.py reflects connectivity to desktop applications or external services.
- API Integration: get_api_key_value.py emphasizes that the system retrieves and uses API keys—this might connect to external services (e.g., AI APIs).
- Utility/Support Functions: Files like check_if.py and save_file.py in support roles for validation and storage.
- Configuration/Information: AI_info.txt as a configuration or informational resource.

##### Relationships and Interactions
- The command handling unit (command_ai.py) likely sends user inputs or triggers to the core AI modules (AI_manav.py and Gemini_ai.py).
- The output module (say_AI.py) receives processed responses from the AI components.
- The API key module (get_api_key_value.py) interacts with the AI modules to provide necessary credentials for accessing external AI services.
- The application launcher (open_app_function.py) interacts with the operating system or other desktop apps, probably triggered by specific commands from the AI.
- Utilities (check_if.py and save_file.py) support various functions, with check_if.py performing pre-condition validations and save_file.py ensuring persistence or logging.

##### Important Architectural Patterns
- Although not a multi-tier or full-stack project, this design benefits from a modular approach where each script has a defined role. This loosely follows separation of concerns.
- The design can showcase simple dependency injection or configuration management (via get_api_key_value.py and the config file AI_info.txt) for scaling up integration with external systems in the future.

## Diagram (Mermaid)

```mermaid
flowchart TD
    user["User Command"]:::external
    config["Configuration (AI_info.txt)"]:::config
    cmd["Command Processor (command_ai.py)"]:::command
    api["API Integration (get_api_key_value.py)"]:::api

    subgraph "Core AI Modules"
        ai1["Core AI Engine (AI_manav.py)"]:::core
        ai2["Core AI Engine (Gemini_ai.py)"]:::core
    end

    out["Voice Output (say_AI.py)"]:::output
    app["Application Launcher (open_app_function.py)"]:::app

    subgraph "Utility Functions"
        chk["Condition Checker (check_if.py)"]:::utility
        sf["File Saver (save_file.py)"]:::utility
    end

    user --> cmd
    config --> cmd
    config --> api

    cmd -->|"trigger"| api
    api -->|"provide_keys"| ai1
    api -->|"provide_keys"| ai2

    cmd -->|"commandToAI"| ai1
    cmd -->|"commandToAI"| ai2

    ai1 -->|"response"| out
    ai2 -->|"response"| out

    ai1 -->|"launchApp"| app
    ai2 -->|"launchApp"| app

    cmd -->|"validateCmd"| chk
    cmd -->|"logEvent"| sf
    ai1 -->|"saveLog"| sf
    ai2 -->|"saveLog"| sf

    click cmd "https://github.com/manavdarji2/artificial-intelligence/blob/main/command_ai.py"
    click ai1 "https://github.com/manavdarji2/artificial-intelligence/blob/main/AI_manav.py"
    click ai2 "https://github.com/manavdarji2/artificial-intelligence/blob/main/Gemini_ai.py"
    click out "https://github.com/manavdarji2/artificial-intelligence/blob/main/say_AI.py"
    click app "https://github.com/manavdarji2/artificial-intelligence/blob/main/open_app_function.py"
    click api "https://github.com/manavdarji2/artificial-intelligence/blob/main/get_api_key_value.py"
    click chk "https://github.com/manavdarji2/artificial-intelligence/blob/main/check_if.py"
    click sf "https://github.com/manavdarji2/artificial-intelligence/blob/main/save_file.py"
    click config "https://github.com/manavdarji2/artificial-intelligence/blob/main/AI_info.txt"

    classDef external fill:#ffffff,stroke:#000,stroke-width:2px;
    classDef command fill:#add8e6,stroke:#000,stroke-width:2px;
    classDef core fill:#90ee90,stroke:#000,stroke-width:2px;
    classDef output fill:#ffeb99,stroke:#000,stroke-width:2px;
    classDef app fill:#ffcc99,stroke:#000,stroke-width:2px;
    classDef api fill:#ffb6c1,stroke:#000,stroke-width:2px;
    classDef utility fill:#d3d3d3,stroke:#000,stroke-width:2px;
    classDef config fill:#e0ffff,stroke:#000,stroke-width:2px;
```
