# classic298/prune-open-webui architecture

> Architecture diagram of the GitHub repository classic298/prune-open-webui, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/classic298/prune-open-webui
- Repository: https://github.com/classic298/prune-open-webui

## Overview

This legacy standalone Open WebUI maintenance tool offers interactive and automation-friendly CLI modes. Users configure retention and orphan-cleanup options, inspect a dry-run preview (optionally exporting it to CSV), then explicitly execute destructive cleanup. The documented cleanup spans users, chats and channels, workspace records, uploads and storage, vector data, audio cache, and database optimization. Source excerpts show the entry-point dispatch, configuration models, vector cleaners, and portions of operation handling; several detailed subsystem links are documented capabilities rather than inspected implementations.

Main entry points: [`prune_cli_interactive.py`](https://github.com/classic298/prune-open-webui/blob/main/prune_cli_interactive.py) (Interactive mode), [`standalone_prune.py`](https://github.com/classic298/prune-open-webui/blob/main/standalone_prune.py) (Automation mode), [`prune_operations.py`](https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py) (Database cleanup), [`prune.py`](https://github.com/classic298/prune-open-webui/blob/main/prune.py) (CLI router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry and modes"]
  node_cli["CLI router<br/>[prune.py]"]
  node_interactive["Interactive mode"]
  node_automation["Automation mode"]
end

subgraph group_planning["Configuration and preview"]
  node_settings["Prune settings<br/>[prune_models.py]"]
  node_preview["Preview analysis"]
  node_csv["CSV audit export<br/>[prune_export.py]"]
end

subgraph group_cleanup["Pruning operations"]
  node_records["Database cleanup"]
  node_vector["Vector cleanup<br/>[prune_core.py]"]
  node_uploads["Orphaned file cleanup"]
  node_storage[("Storage backends")]
  node_audio["Audio cache cleanup"]
  node_vacuum["Database optimization"]
end

subgraph group_compat["Open WebUI integration"]
  node_compatibility["Import compatibility<br/>[prune_imports.py]"]
end

node_operator(("Operator"))
node_webui[("Open WebUI models and services")]

node_operator -->|"starts"| node_cli
node_cli -->|"dispatches"| node_interactive
node_cli -->|"dispatches"| node_automation
node_interactive -->|"configures"| node_settings
node_automation -->|"configures"| node_settings
node_interactive -->|"analyzes"| node_preview
node_automation -->|"previews"| node_preview
node_interactive -->|"exports preview"| node_csv
node_interactive -->|"uses"| node_records
node_automation -->|"uses"| node_records
node_interactive -->|"uses"| node_vector
node_automation -->|"uses"| node_vector
node_records -->|"cleans files"| node_uploads
node_records -->|"deletes vectors"| node_vector
node_uploads -.->|"removes objects"| node_storage
node_interactive -.->|"cleans cache"| node_audio
node_interactive -.->|"can optimize"| node_vacuum
node_interactive -->|"imports"| node_compatibility
node_automation -->|"imports"| node_compatibility
node_compatibility -->|"loads integrations"| node_webui

click node_cli "https://github.com/classic298/prune-open-webui/blob/main/prune.py"
click node_interactive "https://github.com/classic298/prune-open-webui/blob/main/prune_cli_interactive.py"
click node_automation "https://github.com/classic298/prune-open-webui/blob/main/standalone_prune.py"
click node_settings "https://github.com/classic298/prune-open-webui/blob/main/prune_models.py"
click node_preview "https://github.com/classic298/prune-open-webui/blob/main/prune_cli_interactive.py"
click node_csv "https://github.com/classic298/prune-open-webui/blob/main/prune_export.py"
click node_records "https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py"
click node_vector "https://github.com/classic298/prune-open-webui/blob/main/prune_core.py"
click node_uploads "https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py"
click node_audio "https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py"
click node_vacuum "https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py"
click node_compatibility "https://github.com/classic298/prune-open-webui/blob/main/prune_imports.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_cli,node_interactive,node_automation toneBlue
class node_settings,node_preview,node_csv,node_webui toneAmber
class node_records,node_vector,node_uploads,node_storage,node_audio,node_vacuum toneMint
class node_compatibility toneRose
class node_operator toneIndigo
```

## Components

### CLI entry and modes

- [CLI router](https://github.com/classic298/prune-open-webui/blob/main/prune.py): `prune.py`
- [Interactive mode](https://github.com/classic298/prune-open-webui/blob/main/prune_cli_interactive.py): `prune_cli_interactive.py`
- [Automation mode](https://github.com/classic298/prune-open-webui/blob/main/standalone_prune.py): `standalone_prune.py`

### Configuration and preview

- [Prune settings](https://github.com/classic298/prune-open-webui/blob/main/prune_models.py): `prune_models.py`
- [Preview analysis](https://github.com/classic298/prune-open-webui/blob/main/prune_cli_interactive.py): `prune_cli_interactive.py`
- [CSV audit export](https://github.com/classic298/prune-open-webui/blob/main/prune_export.py): `prune_export.py`

### Pruning operations

- [Database cleanup](https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py): `prune_operations.py`
- [Vector cleanup](https://github.com/classic298/prune-open-webui/blob/main/prune_core.py): `prune_core.py`
- [Orphaned file cleanup](https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py): `prune_operations.py`
- **Storage backends**
- [Audio cache cleanup](https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py): `prune_operations.py`
- [Database optimization](https://github.com/classic298/prune-open-webui/blob/main/prune_operations.py): `prune_operations.py`

### Open WebUI integration

- [Import compatibility](https://github.com/classic298/prune-open-webui/blob/main/prune_imports.py): `prune_imports.py`

### Other components

- **Operator**
- **Open WebUI models and services**

## Connections

- Operator → CLI router: starts (evidence: `README.md`)
- CLI router → Interactive mode: dispatches (evidence: `prune.py`)
- CLI router → Automation mode: dispatches (evidence: `prune.py`)
- Interactive mode → Prune settings: configures (evidence: `prune_cli_interactive.py`)
- Automation mode → Prune settings: configures (evidence: `standalone_prune.py`)
- Interactive mode → Preview analysis: analyzes (evidence: `prune_cli_interactive.py`)
- Automation mode → Preview analysis: previews (evidence: `standalone_prune.py`)
- Interactive mode → CSV audit export: exports preview (evidence: `prune_cli_interactive.py`)
- Interactive mode → Database cleanup: uses (evidence: `prune_cli_interactive.py`)
- Automation mode → Database cleanup: uses (evidence: `standalone_prune.py`)
- Interactive mode → Vector cleanup: uses (evidence: `prune_cli_interactive.py`)
- Automation mode → Vector cleanup: uses (evidence: `standalone_prune.py`)
- Database cleanup → Orphaned file cleanup: cleans files (evidence: `prune_operations.py`)
- Database cleanup → Vector cleanup: deletes vectors (evidence: `prune_operations.py`)
- Orphaned file cleanup → Storage backends: removes objects (evidence: `README.md`)
- Interactive mode → Audio cache cleanup: cleans cache (evidence: `README.md`)
- Interactive mode → Database optimization: can optimize (evidence: `README.md`)
- Interactive mode → Import compatibility: imports (evidence: `prune_cli_interactive.py`)
- Automation mode → Import compatibility: imports (evidence: `standalone_prune.py`)
- Import compatibility → Open WebUI models and services: loads integrations (evidence: `prune_imports.py`)
