
Free and open source AI chat module for Magento 2
We built an AI ordering layer for Magento over the last months and have now open sourced the storefront chat part of it. OSL-3.0.
The customer writes in normal language, the module searches the catalogue by meaning instead of keywords, checks stock and the price for that customer's group, and can put things in the cart or place the order through Magento's normal services. The model returns structured tool calls, and every tool (add to cart, checkout, coupon, wishlist, address changes and so on) can be switched off individually in the admin.
Things that took the most work and are probably the interesting part:
- Search results are enriched with live stock and tier prices before they go into the prompt, so it does not recommend something that is out of stock or quote a price the customer will not actually get.
- It keeps conversation context and detects topic changes, so a short "yes, ten of those" resolves against the previous turn instead of drifting back to some older product.
- Every model call is logged with tokens and cost.
- The widget works on Luma and Hyvä, and is FPC safe.
One thing people do not expect from a chat widget: you can drop a file into it. Someone uploads a PDF quote, an Excel order list or a Word document with 30 positions, and the module pulls the line items out of it, matches each one against the catalogue and builds the cart from that. Excel and Word get parsed to text, PDFs are handed to the model as native document blocks so it reads the positions itself. Built that because our B2B customers order from spreadsheets and never want to see a product page.
What it does not do: anonymous visitors. The chat requires a logged in customer, because most of what makes it useful comes from knowing their order history, addresses and cart. You also need your own API keys, Anthropic for the model and Voyage plus Pinecone for the search.
It is v1.0.1, tested with Magento 2.4.8. Our catalogue is B2B with a lot of near identical variants, so I would be curious how the search behaves on catalogues that are built differently.