Blue background with pattern

Magento AI agent - Automating troubleshooting with a digital assistant

Peter Jaap BlaakmeerOrange dotJan 29, 2025

Training an AI agent for Magento 2

To explore the possibilities of AI in Magento 2 development, we trained an LLM in a number of layers. The standard LLM, then a layer with Magento documentation and code examples, then Hyva best practices and documentation, then the same but from Elgentos. To finally add the project context. This resulted in several GBs of data that gave the model a deep understanding of the framework, its structure and best practices. This knowledge the model can apply to the project.

Given the sensitive information on which this LLM is trained, we obviously chose not to host this LLM in the USA or in a way where this data can be used outside our scope. Therefore, we have chosen a local AI hosting party.

Once the model was trained, we built an AI agent around it and integrated it into our GitLab workflow. The goal? Automating the process from issue creation to deployment-minimizing the need for human intervention while maintaining quality.

How it works

This is the workflow of how the AI agent works. We will describe the steps further below.

1. Customer opens an issue
The process begins when a customer submits a new issue. This can be a request for a bug fix, a minor feature or another change within the Magento 2 shop.

2. AI agent takes over.
The AI agent analyzes the issue, generates code and opens a merge request. It then commits the changes to a new branch and triggers a GitLab pipeline.

3. Automated review environment.
The pipeline sets up a unique review environment that allows the client to verify AI-generated changes before a developer is involved.

4. Code review by developer.
If the customer is satisfied with the modification, a developer can review the merge request, ensuring that the changes meet our coding standards and business rules before it is merged.

5. Implementation of modifications.
After approval and merge request, the modification is deployed to the live environment.

Current capabilities and future improvements

Currently, the AI agent handles simple development tasks effectively. It can modify and generate simple Magento 2 and Hyvä code, such as:

  • Minor bug fixes
  • Minor layout or template changes
  • Basic configuration updates

However, we are still testing how to improve the capabilities. Currently it runs on the Llama 3.3 model with a Magento 2 and Hyvä dataset, but we plan to test DeepSeek R1 to compare results. Over time, we expect it to take on more complex tasks, possibly implementing larger features and deeper integrations.

The future of AI in Magento development

While AI will not replace developers, it is already proving to be a valuable assistant. Automating routine tasks allows developers to focus on more complex problems, architecture decisions and high-level optimizations. As AI models continue to evolve, we could see them take on more and more advanced responsibilities.

The potential is huge, and this AI-driven workflow is just the beginning. By integrating AI into Magento development, we are not only making our workflows more efficient, but also redefining how our teams communicate with customers and their requests.