--- title: AI Workflow Agent M1 emoji: 🤖 colorFrom: blue colorTo: purple sdk: streamlit sdk_version: "1.31.0" python_version: "3.11" app_file: app.py pinned: false --- # AI Workflow Agent - M1 (Milestone 1) 🤖 **Core AI Decision Making System** - Analyzes automation needs and generates intelligent workflows. ## Features - 🧠 **AI Analysis**: Uses Gemini 2.5 Flash to understand your automation requirements - ⚙️ **Workflow Generation**: Creates n8n and ComfyUI workflows from natural language - 🔍 **Smart Search**: GitHub repository search and web search (DuckDuckGo) - 💬 **AI Chat**: Conversational assistant for workflow planning - ⚡ **Dual Mode**: Fast keyword matching or intelligent LLM analysis - 🌐 **Bilingual**: Full English + Spanish support ## How to Use 1. **Enable AI Mode**: Toggle "🧠 Intelligent AI Mode" in sidebar for Gemini analysis 2. **Choose Language**: Select English or Spanish 3. **Navigate Tabs**: - 🏠 **Home**: Overview and getting started - 🧠 **AI Analysis**: Analyze automation needs - ⚙️ **Build Workflow**: Generate n8n/ComfyUI JSON - 🔍 **GitHub Search**: Find open source projects - 🌐 **Web Search**: Search with DuckDuckGo - 💬 **Chat**: Conversational AI assistant 4. **Try Examples**: Each tab has pre-filled examples ## Technology Stack - **LLM**: Google Gemini 2.5 Flash (REST API) - **Workflow Tools**: n8n (automation) + ComfyUI (AI image generation) - **Search**: DuckDuckGo (no API key) + GitHub API - **Framework**: Streamlit 1.31.0 - **Python**: 3.11 ## Configuration **Required for AI Mode:** - `GEMINI_API_KEY`: Get free key from [Google AI Studio](https://aistudio.google.com/app/apikeys) **Optional:** - `GITHUB_TOKEN`: For higher GitHub API rate limits ### Setting Secrets in HuggingFace Spaces: 1. Go to Space Settings → Variables and secrets 2. Add secret: `GEMINI_API_KEY` = your_key_here 3. Restart the Space ## Fast vs Intelligent Mode - **⚡ Fast Mode** (AI disabled): <100ms, uses keyword pattern matching, perfect for testing - **🧠 Intelligent Mode** (AI enabled): 2-3s, uses Gemini for deep analysis and complex workflow generation ## Example Workflows **Customer Support Automation:** Generate workflows that receive tickets, classify urgency, check knowledge base, create Jira tickets, and send notifications. **Image Generation:** Create ComfyUI workflows for txt2img, img2img, upscaling, inpainting, and ControlNet. ## Notes - **No Docker Required**: Runs entirely on HuggingFace infrastructure - **No Training**: Uses pre-trained Gemini model (no GPU needed) - **Minimal Dependencies**: Only 8 packages for fast startup - **Free Tier**: Works with free Gemini API (15 requests/minute) --- Built for **Milestone 1** of the AI Workflow Agent project.