# bhavesh-patil-2302/buddy-ai architecture

> Architecture diagram of the GitHub repository bhavesh-patil-2302/buddy-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhavesh-patil-2302/buddy-ai
- Repository: https://github.com/bhavesh-patil-2302/buddy-ai

## Overview

Buddy AI is a personal, interactive CLI assistant. Its startup and menu workflow loads settings and saved user details, greets the user, then dispatches choices to assistant actions, application launching, file listing, settings changes, or the notes menu. Notes and settings are distinct persistent-data stages; user details are stored separately. Core metadata, defaults, paths, and status definitions support these features. Edges reflect calls shown in excerpts or module references in the source index; storage relationships are limited to paths explicitly present in the excerpts.

Main entry points: [`buddy/assistants.py`](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/assistants.py) (Assistant Actions), [`main.py`](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/main.py) (Startup and Menu), [`buddy/memory/settings_manager.py`](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/settings_manager.py) (Settings Manager), [`buddy/notes/notes_manager.py`](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes_manager.py) (Notes Operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Assistant CLI"]
  node_main["Startup and Menu<br/>[main.py]"]
end

subgraph group_features["User Features"]
  node_assistant["Assistant Actions<br/>[assistants.py]"]
  node_app_catalog["App Catalog<br/>[commands.py]"]
  node_scanner["File Scanner<br/>[file_scanner.py]"]
  node_notes_cli["Notes Menu<br/>[notes_cli.py]"]
  node_notes_manager["Notes Operations<br/>[notes_manager.py]"]
  node_settings_manager["Settings Manager"]
end

subgraph group_persistence["Persistence"]
  node_user_memory["User Memory<br/>[user_memory.py]"]
  node_storage["JSON Storage<br/>[storage_manager.py]"]
  node_settings_data[("Settings Data<br/>[settings.json]")]
  node_user_data[("User Data<br/>[user.json]")]
  node_notes_data[("Notes Data<br/>[notes.json]")]
end

subgraph group_core["Core Support"]
  node_metadata["Settings Metadata"]
  node_defaults["Default Values<br/>[defaults.py]"]
  node_paths["Data Paths<br/>[paths.py]"]
  node_status["Status Types<br/>[status.py]"]
  node_app_info["App Identity<br/>[app_info.py]"]
end

node_user(("User"))
node_browser["Web Browser"]
node_os_apps["Operating System Apps"]

node_user -->|"chooses actions"| node_main
node_main -->|"dispatches actions"| node_assistant
node_main -->|"lists apps"| node_app_catalog
node_main -->|"requests listing"| node_scanner
node_main -->|"opens notes"| node_notes_cli
node_main -->|"loads settings"| node_settings_manager
node_main -->|"loads and saves"| node_user_memory
node_assistant -->|"looks up apps"| node_app_catalog
node_assistant -->|"changes settings"| node_settings_manager
node_assistant -->|"uses user data"| node_user_memory
node_assistant -->|"reads setting definitions"| node_metadata
node_assistant -->|"displays identity"| node_app_info
node_assistant -->|"opens website"| node_browser
node_assistant -->|"launches programs"| node_os_apps
node_notes_cli -->|"calls note actions"| node_notes_manager
node_notes_manager -->|"loads and saves JSON"| node_storage
node_notes_manager -->|"uses defaults"| node_defaults
node_notes_manager -->|"gets notes path"| node_paths
node_notes_manager -->|"returns note status"| node_status
node_notes_manager -->|"persists notes"| node_notes_data
node_settings_manager -->|"loads and saves JSON"| node_storage
node_settings_manager -->|"validates setting types"| node_metadata
node_settings_manager -->|"gets settings path"| node_paths
node_settings_manager -->|"returns status"| node_status
node_settings_manager -->|"persists settings"| node_settings_data
node_user_memory -->|"loads and saves JSON"| node_storage
node_user_memory -->|"persists user details"| node_user_data

click node_main "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/main.py"
click node_assistant "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/assistants.py"
click node_app_catalog "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/commands.py"
click node_scanner "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/scanner/file_scanner.py"
click node_notes_cli "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes_cli.py"
click node_notes_manager "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes_manager.py"
click node_settings_manager "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/settings_manager.py"
click node_user_memory "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/user_memory.py"
click node_storage "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/storage_manager.py"
click node_settings_data "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/data/settings.json"
click node_user_data "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/data/user.json"
click node_notes_data "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes.json"
click node_metadata "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/settings_metadata.py"
click node_defaults "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/defaults.py"
click node_paths "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/paths.py"
click node_status "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/status.py"
click node_app_info "https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/app_info.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_user,node_browser toneBlue
class node_assistant,node_app_catalog,node_scanner,node_notes_cli,node_notes_manager,node_settings_manager toneAmber
class node_user_memory,node_storage,node_settings_data,node_user_data,node_notes_data toneMint
class node_metadata,node_defaults,node_paths,node_status,node_app_info toneRose
class node_os_apps toneIndigo
```

## Components

### Assistant CLI

- [Startup and Menu](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/main.py): `main.py`

### User Features

- [Assistant Actions](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/assistants.py): `buddy/assistants.py`
- [App Catalog](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/commands.py): `buddy/commands.py`
- [File Scanner](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/scanner/file_scanner.py): `buddy/scanner/file_scanner.py`
- [Notes Menu](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes_cli.py): `buddy/notes/notes_cli.py`
- [Notes Operations](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes_manager.py): `buddy/notes/notes_manager.py`
- [Settings Manager](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/settings_manager.py): `buddy/memory/settings_manager.py`

### Persistence

- [User Memory](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/user_memory.py): `buddy/memory/user_memory.py`
- [JSON Storage](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/memory/storage_manager.py): `buddy/memory/storage_manager.py`
- [Settings Data](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/data/settings.json): `buddy/data/settings.json`
- [User Data](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/data/user.json): `buddy/data/user.json`
- [Notes Data](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/notes/notes.json): `buddy/notes/notes.json`

### Core Support

- [Settings Metadata](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/settings_metadata.py): `buddy/core/settings_metadata.py`
- [Default Values](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/defaults.py): `buddy/core/defaults.py`
- [Data Paths](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/paths.py): `buddy/core/paths.py`
- [Status Types](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/status.py): `buddy/core/status.py`
- [App Identity](https://github.com/bhavesh-patil-2302/buddy-ai/blob/main/buddy/core/app_info.py): `buddy/core/app_info.py`

### Other components

- **User**
- **Web Browser**
- **Operating System Apps**

## Connections

- User → Startup and Menu: chooses actions (evidence: `main.py`)
- Startup and Menu → Assistant Actions: dispatches actions (evidence: `main.py`)
- Startup and Menu → App Catalog: lists apps (evidence: `main.py`)
- Startup and Menu → File Scanner: requests listing (evidence: `main.py`)
- Startup and Menu → Notes Menu: opens notes (evidence: `main.py`)
- Startup and Menu → Settings Manager: loads settings (evidence: `main.py`)
- Startup and Menu → User Memory: loads and saves (evidence: `main.py`)
- Assistant Actions → App Catalog: looks up apps (evidence: `buddy/assistants.py`)
- Assistant Actions → Settings Manager: changes settings (evidence: `buddy/assistants.py`)
- Assistant Actions → User Memory: uses user data (evidence: `buddy/assistants.py`)
- Assistant Actions → Settings Metadata: reads setting definitions (evidence: `buddy/assistants.py`)
- Assistant Actions → App Identity: displays identity (evidence: `buddy/assistants.py`)
- Assistant Actions → Web Browser: opens website (evidence: `buddy/assistants.py`)
- Assistant Actions → Operating System Apps: launches programs (evidence: `buddy/assistants.py`)
- Notes Menu → Notes Operations: calls note actions (evidence: `buddy/notes/notes_cli.py`)
- Notes Operations → JSON Storage: loads and saves JSON (evidence: `buddy/notes/notes_manager.py`)
- Notes Operations → Default Values: uses defaults (evidence: `buddy/notes/notes_manager.py`)
- Notes Operations → Data Paths: gets notes path (evidence: `buddy/notes/notes_manager.py`)
- Notes Operations → Status Types: returns note status (evidence: `buddy/notes/notes_manager.py`)
- Notes Operations → Notes Data: persists notes (evidence: `buddy/notes/notes_manager.py`)
- Settings Manager → JSON Storage: loads and saves JSON (evidence: `buddy/memory/settings_manager.py`)
- Settings Manager → Settings Metadata: validates setting types (evidence: `buddy/memory/settings_manager.py`)
- Settings Manager → Data Paths: gets settings path (evidence: `buddy/memory/settings_manager.py`)
- Settings Manager → Status Types: returns status (evidence: `buddy/memory/settings_manager.py`)
- Settings Manager → Settings Data: persists settings (evidence: `buddy/memory/settings_manager.py`)
- User Memory → JSON Storage: loads and saves JSON (evidence: `buddy/memory/user_memory.py`)
- User Memory → User Data: persists user details (evidence: `buddy/memory/user_memory.py`)
