"A production-grade, AI-powered system designed to transform digital chaos into structured intelligence."
Developed by Syed Shaheer Hussain | 2026 Β©
Streamlining file management with the power of Rust, Machine Learning, and Deterministic Rules.
The AI File Organizer is a high-performance, cross-platform utility engineered to solve the "Digital Hoarding" crisis. Built with the memory safety and speed of Rust, this tool goes beyond simple extension sorting. It employs a hybrid classification strategyβcombining deterministic JSON rules with OpenAI's Large Language Models (LLM) and local ONNX runtimesβto understand the context of your files.
Whether you're a photographer with thousands of RAW files, a developer with scattered repositories, or a professional managing finance documents, this engine automates the sorting, renaming, and deduplication process with surgical precision.
#Rust #AI #MachineLearning #FileManagement #Automation #OpenAI #Deduplication #SafetyFirst
ai_file_organizer/
βββ .agent/ # AI Agent workspace state
βββ config/ # Centralized configuration
β βββ default_rules.json # Dynamic classification rules
βββ models/ # Local ONNX models (optional)
βββ src/
β βββ main.rs # Entry point & Orchestrator
β βββ cli.rs # Clap-based command definitions
β βββ gui.rs # GUI implementation (egui)
β βββ config.rs # App settings & environment
β βββ constants.rs # Global constants & versioning
β βββ models/
β β βββ file_info.rs # Core data structures (FileInfo, Metadata)
β βββ organizer/ # Logic Engine
β βββ mod.rs # The Organizer Trait & Pipeline
β βββ scanner.rs # Parallel file traversal
β βββ classifier.rs# Hybrid classification logic
β βββ rules.rs # Deterministic pattern matching
β βββ ai.rs # LLM/ONNX interface
β βββ renamer.rs # Safe IO & Collision handling
β βββ duplicates.rs# BLAKE3 hash-based deduplication
β βββ metadata.rs # Deep file inspection (EXIP, PDF)
β βββ undo.rs # JSON-backed state reversal
β βββ archives.rs # Zip/Tar extraction
β βββ watcher.rs # Real-time 'Notify' service
β βββ utils.rs # Formatting & Logic helpers
βββ Cargo.toml # Dependency manifest
βββ README.md # You are here!
graph TD
A[Start: CLI/GUI] --> B{Action?}
B -->|Scan| C[Parallel Traversal]
B -->|Organize| D[Metadata Extraction]
D --> E[Classification]
E --> F{Rule Match?}
F -->|Yes| G[Use Rule Path]
F -->|No| H[AI Inference]
H --> I[Category Defined]
G --> I
I --> J[Renaming Patterns]
J --> K[Safe Move Operation]
K --> L[Save History to JSON]
L --> M[Done]
- Parallel Hashing: Uses
Rayonto hash large file sets in parallel, making duplicate detection near-instant. - Deterministic Rules: Regex-based sorting for invoices, screenshots, and specific work files.
- LLM Classification: Sends file context to OpenAI to categorize files rules can't catch (e.g., "Personal Notes" vs "Code snippets").
- Hardware-Accelerated GUI: A dark-mode desktop app for those who prefer drag-and-drop over the terminal.
- Infinite Undo: Every "Organize" run creates a
.undo_history.jsonsnapshot. Revert any mistake instantly. - Real-time Watcher: Monitor your Downloads folder; as soon as a file hits the folder, it is moved to its permanent home.
- Deep Metadata Inspection: Reads EXIF dates from photos and PDF metadata for smarter grouping.
git clone https://github.com/SyedShaheerHussain/AI-File-Organizer-Offline-CLI-GUI-
cd ai_file_organizer
cargo build --release
Lists files and calculates potential savings.
cargo run -- scan ./Downloads
The heavy lifter. Moves files into categories.
cargo run -- organize C:\Users\User\Downloads
cargo run -- organize ./folder --ai
cargo run -- organize ./folder --dry-run
Find and eliminate redundant data.
cargo run -- duplicates ./MyPhotos
cargo run -- duplicates ./MyPhotos --remove
cargo run -- undo ./folder
cargo run -- watch ./Downloads
cargo run -- gui
I saw my "Downloads" folder becoming a graveyard of PDFs, screenshots, and zip files. Manual sorting was a 2-hour chore. I realized that Rules handle 80% of files, but AI is needed for the other 20% where naming is ambiguous. I chose Rust because handling thousands of I/O operations and high-speed hashing requires a language that doesn't have a Garbage Collector pause.
- What: A hybrid deterministic/AI file manager.
- When: Created in February 2026 to solve modern digital clutter.
- Where: Runs on Windows, Linux, and macOS.
- How: Built using
Tokiofor async andeguifor the frontend. - Why: Because your time is better spent creating, not moving files.
Caution
- Warning: AI Mode sends file names and metadata to OpenAI. Do not use AI mode on folders containing sensitive/classified filename data if you do not want it sent to an external API.
- Caution: Duplicate removal is permanent (unless you use a Recycle Bin wrapper). Always perform a
--dry-runfirst. - Disclaimer: This software is provided "as is". While we have implemented an Undo system, I recommend backing up mission-critical data before massive organization operations.
- OCR Integration: Read text inside images to categorize them.
- Cloud Connectors: Organize files directly in Google Drive/Dropbox.
- Perceptual Hashing: Detect "similar" images, not just identical ones.
- Mobile Port: A companion app for Android/iOS.
If you find this repository useful or insightful, please consider:
- β Starring the repository
- π Sharing it within your network
- π€ Following my GitHub profile for future projects and updates
Your support helps drive continued innovation and open-source contributions.
β Syed Shaheer Hussain
Important
- Custom Rules: Edit
config/default_rules.jsonto add your own regex. - Performance: For folders with >100k files, use the CLI for maximum speed.
- Privacy: Rule-based mode is 100% offline.
Developed with β€οΈ by Syed Shaheer Hussain
Building the future of Desktop Automation.
License: MIT | Version: 0.1.0-alpha
Β© 2026 Syed Shaheer Hussain. All Rights Reserved.