Automation

FileManagerAI

Natural language file organizer with a chat-based GUI, smart content classification, and a custom Ollama model that sorts your mess for you.

Python CustomTkinter Ollama Qwen 2.5 14B httpx

In Plain English

FileManagerAI is a desktop app where you tell an AI to organize your files in plain English. Say "clean up my Downloads" or "move screenshots to Pictures" and it scans the folder, shows you a plan, asks for your permission, then moves, renames, or deletes files for you. It understands what kind of file each one is (screenshot, wallpaper, receipt, etc.) and knows where it should go, but nothing happens without you clicking "confirm" first.

Problem

Download folders accumulate hundreds of files (installers, screenshots, PDFs, images, temp files) with no structure. Manually sorting them takes time and discipline. Existing file managers require you to know exactly what you want to do and where things should go. FileManagerAI lets you skip all that: describe what you want in plain English, the AI figures out the plan, and the system runs it with hard-coded protections for critical paths and mandatory confirmation before anything destructive happens.

Architecture

GUI LAYER (CustomTkinter) AI LAYER SAFETY LAYER SMART CLASSIFICATION FILE OPERATIONS ORGANIZATION STYLES CONSTITUTION & MODEL filemanager_gui.py Chat interface + sidebar Chat Bubbles Quick Actions Follow-up Pills Confirm Dialogs Operation History + Undo (50 ops) filemanager.py Core engine + NLP router query_model() Ollama API, JSON extract think_about_folder() Deep creative analysis Rolling 5-exchange history is_protected(path) Hard-coded path blocklist confirm=True Mandatory for all writes Size thresholds 100MB warn, 1GB block 9 protected paths enforced classify_content() Name + size + ext heuristics 15+ subcategories Confidence score screenshot | wallpaper | receipt | ebook | photo | art ... execute_move / execute_delete execute_bulk_move (by type) execute_subcategory_move By Type (default) Minimal By Date Aesthetic (nested) FILE_CONSTITUTION.md 400+ line knowledge base Modelfile.file-manager Qwen 2.5 14B fine-tune Ollama (localhost:11434) temp=0.2, ctx=8192 JSON action protocol: {"actions": [{"fn": "bulk_move", "args": {...}}], "message": "Moving 47 images"}
Scroll to explore diagram

Three-layer architecture: the GUI sends natural language to the AI engine, which generates JSON action plans. Every file operation passes through the safety layer before execution. Smart classification enriches scan results with subcategory insights.

Features

Natural Language Commands

Any phrasing works

Say "clean up my Downloads," "move screenshots to Pictures," or "what's taking up space?" The custom Ollama model parses your intent, detects folder references, and returns a structured JSON action plan with function calls and arguments.

Smart Content Classification

15+ subcategories

Beyond basic extension matching, the classifier detects screenshots, wallpapers, receipts, ebooks, memes, avatars, recordings, and more using filename patterns, file size heuristics, and extension combinations. Each classification includes a confidence score and suggested destination folder.

Creative "Think" Mode

AI-powered deep analysis

The "Think About" feature performs a deep scan that detects filename themes, date clusters, potential projects (files with shared prefixes), collections, anomalies, and size distributions. The AI then generates a personalized organization strategy with a "vibe check" and creative folder suggestions.

Hard Safety Enforcement

9 protected paths

Critical directories (Obsidian vault, AppData, system folders) are protected at the server level with hard-coded path checks that cannot be bypassed by the LLM. All destructive operations require explicit GUI confirmation, and every move is logged with full undo support.

Organization Style Selector

4 styles, content-aware

Choose between By Type, Minimal, By Date, or Aesthetic organization. Each style is content-aware: it scans what is actually in the folder and only creates subfolders for file types that exist, avoiding empty placeholder directories.

Operation History & Undo

50-operation rolling log

Every file move is recorded with source, destination, size, and timestamp. Undo reverses the last move with a single click. The operation log persists across sessions in a JSON file, so you can review and reverse changes even after restarting.

How It Works

01

User Types a Request

The CustomTkinter chat interface accepts natural language input. The request is dispatched to the core engine, which first checks for direct commands (scan, help, quit) and auto-detects if the user mentions a known folder like Downloads or Pictures.

02

Auto-Scan & Context Building

If a folder is mentioned, the engine silently scans it, counting files by type, running smart classification on each file, identifying cleanup candidates, large files, and old files. This scan data, plus rolling conversation history, is injected into the LLM prompt as context.

03

LLM Generates an Action Plan

The custom "file-manager" model (Qwen 2.5 14B with a baked-in system prompt from FILE_CONSTITUTION.md) returns a JSON object with an array of actions (scan_folder, bulk_move, delete_file, create_structure, think_about, rename_file, or none) along with a human-readable message.

04

Safety Check & Confirmation

Each action passes through the enforcement layer: protected path check, size threshold evaluation, and mandatory confirmation dialog. The GUI shows exactly what will happen (source, destination, file size) and waits for the user to approve or cancel.

05

Execution & Follow-up

Approved operations are executed and logged to the operation history. The GUI displays results and generates contextual follow-up suggestion pills ("Move screenshots to Screenshots," "Scan again," "Undo last move") based on what was just done.

Tech Stack

GUI Framework

CustomTkinter (dark theme, 1100x700)

LLM Inference

Ollama, Qwen 2.5 14B (custom Modelfile)

HTTP Client

httpx (sync for CLI, async-compatible)

File Operations

pathlib, shutil (move, rename, delete)

Persistence

JSON operation history (50-entry log)

Knowledge Base

FILE_CONSTITUTION.md (400+ lines of routing rules)