Utilising a 3-phase pipeline for Data, AI Generation, and Live Deploy
Capable of processing hundreds of products simultaneously
Offering preview, approve, and revert functionalities for enhanced control
Supporting various languages and store views effortlessly
Keep track of progress and token usage in real-time
The stack I use here, a Laravel backend with a modular architecture, connected directly to the Magento database. AI integration is powered by OpenAI’s GPT-4o and GPT-4o-mini models, enabling fast and scalable content generation.
With this setup, we have cut content creation and translation time from weeks to just a few hours for large number of items. The architecture is built for internal needs but is designed to scale and adapt easily.
Suppose you have a product in Magento where the description under a specific store view is set to “Use Default Value.” The admin wants a localised version of the description, translated while preserving technical terms and HTML formatting.
Normally, this would take hours of manual work. With our AI content generator, it only takes minutes.
The AI content generator is built into our Laravel application (used for managing Magento data). It works in the following stages:
Request Creation → Scheduling → Backup → AI Content Generation → Live Update
Select products by SKU or upload a bulk CSV file.
Choose the target store view (e.g., Dutch).
Define the value source (default store or store-specific values).
Select attributes (e.g., description) and link them with AI prompts.
As shown above, I have used the “Selection Method” called “Upload CSV”.
Once the file is uploaded, we need to select which store to apply this operation to. In this example, I am applying it to the store named “Dutch”. Therefore, I am selecting store ID 1, which is located under Website ID 1.
As you can see, when I select the destination store, the system prompt message section is updated and the locale is changed. Whenever we send information to the AI, we use “system” and “user” prompts. In this application, I use the system prompt shown below. This message is constant, and only the locale is updated each time based on the destination store selection.
Below is my system prompt:
“You are a professional content generator. Follow the user’s instructions precisely. IMPORTANT: ALL output must be in {locale} language. Never use any other language. Only output the requested content without any additional explanations or formatting.”
Now, we must choose the “Value Source” (as shown above). The Value Source refers to the “original value.” However, in Magento, this original value can reside in either the destination store or the default store. For example, we might use a single value from the admin store for all items, or we might use a separate value for the same item under specific store views, such as for translation or different content. The Value Source determines which value to use when sending information to the AI.
Use Default Store Values Only: This option is used when the admin wants to use only the default value. Even if a value exists for the destination store view, the system will consider the default stored value if this option is selected.
Use Selected Store Values (fallback to default if empty): If this option is selected, the system will first check for a store-specific value. If none is found, it will fall back to the default value.
Please note that this selection is required for preparing the user prompt message.
Next, we need to choose the attributes. We must inform the AI that content generation is required for these attributes. To perform the content generation, the system will use the user prompt messages associated with each attribute.
As part of the next setup, we need to choose the attributes and define their prompt messages. As you can see in the screenshot above, when I select an attribute, the prompt message appears automatically. This is made possible through Prompt Management.
I have created a separate section for Prompt Management to facilitate this.
Prompts are customisable per attribute.
Example for translations: “Translate the given content without adding or removing information. Preserve all HTML structure.”
Reference attributes can be inserted via auto-suggestions.
Token limits per request can be configured.
With this Prompt Management feature, we will be able to configure each attribute and set up a corresponding prompt message for it.
Below is the prompt message for the Description attribute.
And if we analyse this message, I am clearly stating, “Translate the given content by following these strict rules:” This means I only want a translation. Additionally, within the strict rules, I have specified: “Do not add new information or remove any information from the original text,” and “Preserve all HTML tags and attributes, formatting, and structure exactly as provided.” Therefore, my requirement is solely to TRANSLATE the existing content without making any alterations. Based on multiple tests, this is working effectively for me, even with large and complex content generation.
When editing a prompt message, we can also reference other attributes. To assist the admin in placing an attribute, I have added a suggestion box. Whenever we type {, an auto-suggestion list of attributes appears, and the user can select the required attribute, as shown below:
Besides this, we can set the maximum number of tokens that can be consumed by a request for this attribute.
Once we have finalised the attributes, we can proceed by creating the request. However, there is one more custom option available: the ability to choose a custom language. While the system prompt is designed to create output using the destination store’s locale, this option allows us to select a different language if needed.
Once the request is submitted and created, it will be in a “pending” status. At this point, the admin user can either schedule the request or create additional requests for other store views.
Options:
Generate Only (No Live Update): For review before publishing.
Generate + Live Update: Direct publish if prompts are already validated.
Requests are picked up by a Laravel cron job for background processing.
Once the request is created, we can proceed with scheduling it.
A “Schedule All” button has been added. Upon clicking it, a popup will appear requesting a choice between two options: “Generate Only (No Live Update)” or “Generate + Live Update”.
We have two processing modes, “Generate Only” and “Generate + Live Update,” for an important reason. In most cases, we must carefully review AI-generated content before publication. It is not recommended to push content directly to the live system without a review process.
The “Generate Only” mode allows us to review the data safely. Once we are satisfied with the results, an “Apply to Live” button will be available against the scheduler to perform the live update manually.
If we are confident in the results and our prompt is proven to be correct, we can later use the “Generate + Live Update” mode for efficiency.
Once the request is scheduled, its status changes to “scheduled.” For this demo, I am selecting the “Generate + Live Update” option.
Now, a CRON job running in the background will pick up the scheduled task and begin processing the requests.
Since this is built on Laravel, I have created a custom console command to handle this process.
Once processing has started, you can see the progress updated live on the UI.
Once the requests have completed processing, you can view the details for each one. The system allows you to see both the “old value” and the “new value,” enabling you to compare them directly within the interface.
If we review the value in the Magento admin, we will see that it has been updated.
Once the content has been generated, you have the option to REVERT it.
There is one more option available: to “Regenerate” the request.
As you can see, the regeneration options include “Regenerate All” or “Regenerate only the incorrect items.” For individual requests, I have added a “Mark as Incorrect” option. This feature helps avoid regenerating all content unnecessarily, preventing unwanted token consumption for requests that have already been generated correctly.
If you would like to set up the same or a similar operation for your Magento store, feel free to contact me via LinkedIn at https://www.linkedin.com/in/jickson-koottala-60553449/ or contact me at jickson@bypos.ae