Automatically generate compelling product descriptions, meta titles, keywords, and SEO content using OpenAI's powerful language models. This Magento 2 extension seamlessly integrates AI content generation into your product workflow, improving SEO performance and customer experience while saving time on content creation.
- Product Descriptions: Generate both short and detailed product descriptions
- SEO Meta Data: Auto-create meta titles, descriptions, and keywords
- Smart Prompts: Customizable prompts with product variable substitution
- Bulk Processing: Mass enrich existing products with AI-generated content
- Real-time Generation: Generate content immediately when products are saved
- Asynchronous Processing: Queue-based background processing for better performance
- Safe Mode: Only fill empty fields, preserving existing content
- Override Mode: Replace all content with fresh AI-generated versions
- OpenAI Model Selection: Support for all OpenAI chat completion models (GPT-3.5, GPT-4, GPT-4o, etc.)
- Customizable Prompts: Tailor generation prompts for each content type
- Rate Limiting: Built-in backoff mechanisms for API rate limits
- Fine-tuning Controls: Temperature, frequency penalty, and presence penalty settings
- Enrichment Cache: Hash-based lookup prevents duplicate API calls for identical inputs, saving cost and time
- Admin Review Grid: "AI Enrichment Review" page listing all generated content with filters, sorting, and mass actions
- Approval Mode: Optionally hold AI-generated content for admin review before it's written to products
- Product Edit Indicators: Inline status notes below enriched fields (Pending / Approved / Modified / Denied) with "View details" links
- Mass Actions: Bulk enrich products from admin grid
- Queue Management: Scalable async processing with Magento's queue system
- Error Handling: Robust error handling with retry mechanisms
- Multi-store Support: Configure different settings per store scope
- PHP: 8.1 or higher
- Magento: 2.4.x (compatible with both Magento 2 and Mage-OS)
- OpenAI Account: Active OpenAI account with API access
- Composer: For installation
composer require mage-os/module-catalog-data-ai
php bin/magento setup:upgradeNavigate to Admin Panel β Stores β Configuration β Catalog β AI Data Enrichment
- Enable Module: Turn on/off the extension
- OpenAI API Key: Your OpenAI API key (required)
- OpenAI Organization ID: Your organization ID (optional)
- OpenAI Project ID: Your project ID (optional)
- Processing Mode: Choose between real-time or asynchronous processing
- OpenAI Model: Select your preferred model (recommended:
gpt-4o) - Max Tokens: Maximum tokens per request (default: 1000)
Under Product Fields Auto-Generation, configure any text-compatible product attribute for AI enrichment. The dynamic table lets admins add rows, pick a target attribute, and define its prompt. No code changes needed to enrich custom attributes.
Attribute dropdown is filtered to text, textarea, and texteditor frontend inputs.
Default prompts ship for short_description and description:
| Attribute | Default Prompt |
|---|---|
short_description |
"write a very short product description for {{name}} to highlight reasoning for purchase, under 100 words" |
description |
"write a detailed product description for {{name}} with features in bullet list, under 1000 words" |
Add rows for meta_title, meta_keyword, meta_description, or any custom attribute to extend coverage.
Fine-tune AI behavior:
- System Prompt: Instructions for AI behavior (default: "Be a content generator, just reply with the content, skip all introductions.")
- Temperature: Creativity level (0.0-1.0)
- Frequency Penalty: Reduce repetitive content (-2.0 to 2.0)
- Presence Penalty: Encourage variety (-2.0 to 2.0)
For better performance with high-volume stores:
- Enable "Asynchronous enrichment" in configuration
- Run the queue consumer:
bin/magento queue:consumers:start mageosEnrichProductProcessor
Under Settings, two options control the review workflow:
- Enrichment Cache: When enabled, every generation is logged to
mageos_catalogai_product_enrichmentand keyed by a SHA-256 hash of the prompt + system prompt + attribute + store. Subsequent calls with identical input reuse the cached result instead of calling the API. - Approval Workflow: Depends on the cache being enabled. Choose between
auto-approve(apply immediately) andrequire-approval(hold generated values until an admin reviews them in Catalog β AI Enrichment Review).
In require-approval mode, new enrichments are recorded with pending status and are not written to products until an admin approves them from the review grid.
Once configured, the extension automatically generates content for new products when saved, based on your settings:
- Real-time Mode: Content generated immediately during product save
- Async Mode: Content generated in background via queue system
For existing products without AI-generated content:
- Go to Catalog β Products
- Select products to enrich
- Choose from Actions dropdown:
- AI Enrich: Replace all content (overwrites existing)
- AI Enrich (Safe): Only fill empty fields
When the enrichment cache is enabled, go to Catalog β AI Enrichment Review to see every generation. The grid supports:
- Filtering by product SKU, attribute, status, timestamps
- Opening a record to see the full prompt, edit the applied value, add notes, and change status
- Mass-approve, mass-deny, and mass-delete actions
On the product edit form, enriched attribute fields show an inline status note beneath them:
- Pending review (orange): AI-generated, awaiting approval
- Approved (green): AI-generated and applied
- Modified (blue): AI-generated value was manually edited after the fact
- Denied (gray): Rejected by an admin
Each note includes a View details link that opens the full enrichment record in a new tab.
| Model | Best For | Speed | Cost | Quality |
|---|---|---|---|---|
| gpt-4o | Production use | Fast | Medium | Excellent |
| gpt-4-turbo | High-quality content | Medium | High | Excellent |
| gpt-3.5-turbo | Budget-conscious | Very Fast | Low | Good |
- Must support Chat Completions API
- Must support developer role messages
- Recommended: Models with function calling capability
Prompts support dynamic variables from product data:
Write a description for {{name}} priced at {{price}}. Key features: {{short_description}}
Any product attribute code can be referenced as {{attribute_code}} and will be substituted with that attribute's current value at generation time. Common examples:
{{name}}: Product name{{price}}: Product price{{sku}}: Product SKU{{short_description}}: Existing short description{{meta_keyword}}: Existing keywords- Custom attributes: any EAV attribute on the product
- Be Specific: Include detailed instructions about tone, length, and format
- Use Context: Reference product attributes to create relevant content
- Set Constraints: Specify word/character limits
- Define Format: Request bullet points, paragraphs, or specific structures
Example optimized prompt:
Create a compelling product description for {{name}}:
- Target audience: [your customer type]
- Tone: Professional yet engaging
- Length: 150-200 words
- Include key benefits and features
- End with a call-to-action
- Focus on {{category}} category specifics
API Key Errors
- Verify your OpenAI API key is correct and active
- Check your OpenAI account has sufficient credits
- Ensure API key has appropriate permissions
Rate Limiting
- The extension includes automatic backoff mechanisms
- Consider using async processing for bulk operations
- Monitor your OpenAI usage dashboard
Content Not Generating
- Ensure the module is enabled in configuration
- Check that product fields are empty (in safe mode)
- Verify prompts are configured for the desired attributes
Queue Processing Issues
- Ensure queue consumers are running
- Check Magento cron is functioning
- Monitor queue status in admin panel
- Use Async Processing for bulk operations
- Optimize Prompts or choose a faster model to reduce token usage
- Configure Rate Limits appropriately
- Monitor API Costs regularly
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Author: Ryan Sun (ryansun81@gmail.com)
- Website: Sunmerce
- Repository: mage-os-lab/module-catalog-data-ai
- Issues: GitHub Issues
- Documentation: This README and inline code comments
- Community: Mage-OS Discord