DEV Community

Cover image for I Built a Context-Aware RAG Plant Assistant for Magento 2 — and Added AI Photo Analysis
johan
johan

Posted on

I Built a Context-Aware RAG Plant Assistant for Magento 2 — and Added AI Photo Analysis

I've spent the past few months building two custom AI tools for Introgreen, my multilingual online plant store running on Magento 2.

Instead of installing a generic chatbot extension, I wanted to develop something that understands which products visitors are viewing, retrieves relevant information from our own plant knowledge library and helps people choose suitable plants.

The result is Plantcoach, a context-aware RAG assistant, and Plant Finder, an AI-powered recommendation tool with photo analysis.

Both are now publicly available, with photo analysis still in beta.

1. Plantcoach: RAG with Magento page context

Plantcoach uses Retrieval-Augmented Generation (RAG) to retrieve relevant information from our own plant advice library instead of relying entirely on the model's general knowledge.

The library covers plant care, diseases, pests, growing conditions and plant selection for different environments.

What makes it interesting is its integration with Magento 2.

Plantcoach works through a dedicated page and as a chat popup on the homepage, category pages and product pages.

The assistant adapts to the page context.

For example, when someone visits a Monstera product page and asks, "Why are the leaves turning yellow?", Plantcoach can use the current product context and retrieve relevant plant-specific advice.

It also combines plant knowledge with Magento product information, including plant characteristics and availability.

The challenge is providing useful advice without turning every conversation into a sales pitch.

2. Plant Finder: AI photo analysis

My second tool, Plant Finder, recently gained a photo-analysis feature.

Visitors can:

  • Upload a photo of a room or another space.
  • Indicate where they would like to place a plant.
  • Have AI analyse the image.
  • Answer additional questions about lighting, pets and maintenance preferences.
  • Receive recommendations connected to our Magento catalogue.

A photograph alone cannot reliably determine everything. For example, it can't tell us how much natural light a room receives throughout the day.

That's why the tool combines image analysis with follow-up questions.

The photo feature is currently available as a public beta.

3. The technical challenges

Our Magento store operates in five languages: Dutch, German, English, French and Spanish.

Building these tools has involved combining several different sources of information:

  • A multilingual plant knowledge library.
  • RAG-based retrieval for relevant advice.
  • Context from Magento category and product pages.
  • Structured product attributes and availability.
  • AI image analysis and additional user input.

One challenge is handling different common names for the same plant across languages.

Another is ensuring recommendations remain relevant to both the user's situation and the actual product catalogue.

There's still plenty to improve, particularly around multilingual retrieval and recommendation quality.

4. Try the tools

Both tools are available on our English-language store.

Plantcoach — Context-Aware RAG Assistant

https://introgreen.eu/plantcoach/

Ask questions about plant care or try the contextual chat popup on a product page.

Plant Finder — AI Photo Analysis (Beta)

https://introgreen.eu/plant-finder

Upload a photo and try the plant recommendations yourself.

5. I'd love your feedback

I'm particularly interested in hearing from other developers:

  • How do you combine RAG retrieval with structured e-commerce product data?
  • How do you manage page context in AI assistants?
  • Does the photo-upload workflow feel intuitive, especially on mobile?

Both tools are custom-built for Introgreen, and I'm continuing to improve them.

I'd love to hear your experiences with similar projects or suggestions for improvement.

Thanks for reading!

Johan

Top comments (1)

Collapse
 
suppdevbot profile image
DEV SUPPORTS •
You need to verify your account.
Enter fullscreen mode Exit fullscreen mode

tr.ee/dev-to