# 🖼️ Media Assistant

> Generate, edit, and upscale images using AI, then manage them in your WordPress media library. Set featured images, fix alt text, and check credit balance.

| Field | Value |
|-------|-------|
| Slug | `media-assistant` |
| Version | 1.0.0 |
| Category | Media |
| Author | Agentic Tech LLC |
| Required Capabilities | `upload_files` |

## What It Does

Media Assistant is an AI-powered image generation, editing, and media library management agent. It connects to the Agentic Image Generation service (backed by Vertex AI Imagen 4) to generate images from text prompts, edit existing images with natural language instructions, and upscale images to 2x or 4x resolution. All results are saved directly to your WordPress media library.

Beyond generation, Media Assistant handles practical media library tasks: setting featured images on posts and pages, updating alt text for accessibility and SEO, and searching the media library by keyword, MIME type, or date range. It can check your credit balance before starting large batches.

Image generation requires an active Vector Store Pro licence and prepaid credits. Credits are shared with the Vector Store / RAG service. Costs range from 3 credits (imagen-4-fast) to 9 credits (imagen-4-ultra) per image. Supported aspect ratios: 1:1, 16:9, 9:16, 4:3, 3:4.

## Tools

| Tool | Risk | Description |
|------|------|-------------|
| `get_image_credits` | None | Check the current Agentic Image Generation credit balance. Credits are shared with the Vector Store service. |
| `search_media_library` | None | Search the WordPress media library for images and files by keyword, MIME type, or date range. |
| `generate_image` | Low | Generate one or more images from a text prompt and save them to the WordPress media library. Consumes paid credits. |
| `edit_image` | Low | Edit an existing image from the media library using AI. Describe what to change — the result is saved as a new media library item. Consumes paid credits. |
| `upscale_image` | Low | Upscale an existing media library image to 2x or 4x resolution using AI. Saved as a new media library item. Costs 9 credits. |
| `set_featured_image` | Medium | Set a media library image as the featured image (post thumbnail) for a post or page. |
| `update_attachment_alt_text` | Low | Update the alt text, title, caption, or description of a media library attachment. |

## Example Prompts

- "Generate a hero image for my About page — modern office, warm lighting"
- "Upscale attachment #42 to 4x resolution"
- "Set the latest generated image as the featured image for post #15"
- "Fix the alt text on all images missing descriptions"
- "How many image credits do I have left?"
- "Edit attachment #88 to remove the background and make it transparent"
- "Search my media library for images uploaded this month"
- "Generate 3 product photos of a leather bag on a white background"

---

_Generated by Agent Builder for WordPress_
