Uses an AI agent (powered by Google Gemini via the Agno framework) to intelligently propose and execute a plan for organizing files within a specified directory on your computer.
# AI File Organizer Agent
This Python script uses an AI agent (powered by Google Gemini via the Agno framework) to intelligently propose and execute a plan for organizing files within a specified directory on your computer.
## Features
* **AI-Powered Planning:** Leverages a Gemini language model to analyze the current file structure and suggest a logical organization plan.
* **User Interaction:** Presents the proposed plan for review, allowing the user to approve, reject, or provide feedback for revisions.
* **Robust Filesystem Interaction:** Uses the Model Context Protocol (MCP) and the standard `@modelcontextprotocol/server-filesystem` for safe and sandboxed file operations (listing directories, creating directories, moving files/folders).
* **Configurable Target Directory:** Allows setting a default directory or prompts the user, ensuring operations stay within a defined top-level boundary.
* **Rate Limit Handling:** Includes basic handling for API rate limits (429 errors) with an automatic pause.
* **Debug Mode:** Includes a `DEBUG` flag for more verbose output during execution.
## Requirements
* Python 3.x
* Node.js and `npx` (comes with npm, usually installed with Node.js). Required to run the MCP filesystem server.
* Google API Key with Gemini API access. Get one from [Google AI Studio](https://aistudio.google.com/app/apikey).
* Required Python packages (see `requirements.txt`):
* `agno`
* `mcp`
* `google-genai`
* `python-dotenv`
## Setup
1. **Clone/Download:** Get the `file_organizer_agent.py`, `requirements.txt`, and `.env` files.
2. **Install Node.js:** If you don't have it, download and install Node.js LTS from [nodejs.org](https://nodejs.org/). This will include `npm` and `npx`.
3. **Create Python Virtual Environment (Recommended):**
```bash
python3 -m venv .venv
source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
```
4. **Install Python Dependencies:**
```bash
Google's AI-powered research notebook that ingests your documents and becomes an expert on your content. Generates audio overviews, study guides, FAQs, and interactive discussions from uploaded sources.
Google DeepMind's experimental AI agent that can navigate websites, fill forms, and complete multi-step browser tasks autonomously. Uses Gemini's multimodal understanding to interact with web interfaces.
Google DeepMind's universal AI assistant prototype that can see, hear, and respond in real-time through your device camera and microphone. Demonstrates the future of multimodal AI interaction.
Google Cloud's enterprise platform for building, deploying, and managing AI agents powered by Gemini. Supports multi-agent orchestration, tool integration, and enterprise governance.
Gemini's agentic research capability that autonomously browses the web, synthesizes information from dozens of sources, and produces comprehensive research reports on any topic.
Interactive coding and content creation agent that generates, previews, and iterates on code, documents, and interactive applications in a side panel. Supports HTML/CSS/JS, Python, and more.