AI Chatbot for Magento 2 Documentation
Give shoppers fast, grounded product guidance from a storefront assistant that uses your product, category, CMS, and sitemap context—without sending them away from the buying journey.
Overview
AI Chatbot for Magento 2 is a customer-facing product assistant for merchants who want 24/7 conversational product discovery. It adds a responsive floating widget, enriches prompts with storefront catalog context, returns relevant product cards, and gives administrators a searchable conversation log.
Catalog-aware answers
Uses visible product details, options, attributes, categories, CMS snippets, and relevant sitemap URLs.
Product discovery
Suggests eligible products available to order with Magento-generated storefront links. The widget shows up to six product cards, prioritizing items mentioned in the answer.
Conversation review
Stores question, answer, SKU, URL, and timestamp in a Magento admin grid.
MAGENTO ADMINDashboard
Marketing
› Chatbot Logs
Stores
Chatbot Logs
| Created | Question | Answer | SKU |
|---|---|---|---|
| Aug 31, 14:22 | Compact standing desk? | Try the Lift Mini… | LIFT-MINI |
| Aug 31, 13:58 | Does this come in oak? | Yes, choose Oak… | DESK-04 |
Requirements & compatibility ★
Confirm your platform and deployment workflow before purchasing.
| Component | Supported / tested | Notes |
|---|---|---|
| Magento Open Source | Supported | 2.4.6, 2.4.7, and 2.4.8 |
| Adobe Commerce | Compatible | 2.4.6, 2.4.7, and 2.4.8; Commerce-only features are not used. |
| PHP | 8.1–8.4 | PHP 8.4 requires a Magento release that supports it. |
| Database | MySQL 8.0 / MariaDB 10.6 | Adds one InnoDB log table. No direct search-engine dependency. |
| Search | Elasticsearch 8 / OpenSearch 2 | Uses Magento catalog data; does not query search directly. |
| Composer | 2.2+ | Composer 2.7+ recommended. |
| Store scope | Multi-website, multi-store, multi-language | Configuration inherits by Magento scope; AI output language follows prompt and shopper. |
| Frontend | Luma/Blank Supported | Hyvä requires a compatibility implementation. PWA Studio/headless requires a custom client integration. |
default.xml, block inline JSON, or suppress the form key may require configuration. Page Builder content is reduced to plain text when used as context.Installation
Composer (recommended)
- Get your private repository access.Sign in to your NSPlug customer account and copy the Composer authentication instructions shown for your purchase. Keep the token in Composer authentication storage outside the Magento repository; never commit credentials or
auth.json. - Add the NSPlug repository and review the install.Run these commands from the Magento project root. The released package is
nsplug/aichatbotand installs tovendor/nsplug/aichatbot.composer config repositories.nsplug composer https://www.nsplug.com/composer
composer require nsplug/aichatbot:^1.2 --no-update
composer update nsplug/aichatbot --with-dependencies --dry-run
composer update nsplug/aichatbot --with-dependencies - Deploy the Magento module.Enable
NS_AiChatbot, then run setup upgrade, dependency compilation, static-content deployment, and cache flush using the commands below.
Manual / ZIP (alternative)
- Extract to the exact module path.Place the contents at
<magento-root>/app/code/NS/AiChatbot. The directory must containregistration.php, not another nested package folder. - Register the manual namespace and dependencies.Add
"NS\\AiChatbot\\": "app/code/NS/AiChatbot/"to the Magento rootautoload.psr-4mapping, confirm the root project satisfies the runtime requirements in the module’scomposer.json, and runcomposer dump-autoload -o. - Run the Magento setup commands.Run them as the filesystem owner—not root—using the PHP binary for the store.
bin/magento module:enable NS_AiChatbot
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush - Configure the provider.Go to Stores → Configuration → General → AI Chatbot → Settings.
Developer mode
You may omit setup:di:compile. Static assets can be symlinked/generated on demand, but deploying them is still a reliable verification step.
Production mode
Keep maintenance mode and a tested backup in your release workflow. Compilation and static-content deployment are required before traffic resumes.
Upgrading to version 1.2.1
Back up the module, database, and configuration, then replace the manual-install files with the 1.2.1 package. When upgrading older module code, run the setup, compilation, and static-content commands above as part of your normal deployment process. The upgrade patch clears legacy shared answer-cache entries. Purge old FPC/Varnish/CDN pages so shoppers receive the updated widget.
After the final cache flush, save AI Chatbot configuration at the applicable scope or allow the next scheduled license refresh, then verify the widget and Test AI Prompt. Magento cron must be running. The first load clears older browser chat transcripts once. Every eligible question and retry now makes a fresh provider request, which can increase usage compared with earlier cached replies.
Verify installation
bin/magento config:show aichatbot/general/enabled
Expect “Module is enabled” and value 1. Load a storefront page, find the floating chat toggle, and use Test AI Prompt after saving credentials. If the module is absent, confirm the folder case, filesystem permissions, Composer autoload, and registration.php; then rerun composer dump-autoload and setup:upgrade.
License activation
- Copy all three values from your purchase email/account.You need the license key, license token, and license server URL.
- Open the extension settings.At the correct website scope, enter the values under Stores → Configuration → General → AI Chatbot.
- Save and verify the license.Saving AI Chatbot configuration refreshes a signed license for the selected storefront domain. Storefront requests use the verified license cache; the background job refreshes it every five minutes. A full cache flush clears cached licenses, so save configuration again or allow the next scheduled refresh before checking the widget. To move domains, deactivate the old production domain in your customer account, then save configuration on the new one.
★ Staging
One non-production domain is included with an active production license. Localhost and .test development hosts do not consume an activation. Contact support before using a public staging hostname.
★ If renewal lapses
NS AIChatbot for Magento 2 costs $99 USD per year and renews automatically unless canceled. Cancel anytime to stop future renewals. You may continue using the version already installed after cancellation or expiry. Downloads, updates, compatibility releases, and support end after the paid term. A failed renewal does not disable the already installed version. AI-provider usage is billed separately.
NS\AiChatbot\Helper\Data at Helper/Data.php; the server verifies signed status and domain payloads using a public key, and the module contains no remote code loader.Download the exact source archive for any version licensed during your term from Account → Downloads → AI Chatbot. Keep the archive with your deployment artifacts.
AI provider setup
OpenAI setup ★
- Create a project.Sign in to the OpenAI Platform, open the project selector, and create or select a dedicated production project.
- Add billing and a budget.In organization billing, add a payment method. In project limits, set a monthly budget and notification thresholds.
- Create a secret key.Open API keys → Create new secret key, restrict it to the project, copy it once, and store it in a secrets manager.
- Save and test.Select OpenAI in Magento, enter your provider-issued API key, select a model, save configuration, then click Test AI Prompt.
Magento production
API keys · Limits · Usage
Magento storefront
sk-proj-•••••••••••• Active
Anthropic setup ★
- Create or select a workspace.Sign in to the Anthropic Console and use a dedicated production workspace for the Magento storefront.
- Configure billing and limits.Add billing credits or a payment method, then review the workspace spend limit and the organization rate limits before launch.
- Create an API key.Open Settings → API keys, create a key for the production workspace, copy it once, and store it securely. Use a standard workspace API key—not an Admin API key.
- Save and test.Select Anthropic in Magento, enter your provider-issued API key, select an available Claude model, save configuration, then click Test AI Prompt.
Google Gemini setup ★
- Create or import a project.Sign in to Google AI Studio, open Dashboard → Projects, and create or import the Google Cloud project dedicated to the Magento storefront.
- Create an API key.Open Dashboard → API Keys, create a key for that project, copy it once, and store it securely. Restrict the key to the Gemini API when the option is available.
- Configure billing and usage controls.For production or higher limits, use Set up billing to link Cloud Billing and fund the paid tier. Review usage in the AI Studio dashboard and configure billing alerts for the linked project.
- Save and test.Select Google Gemini in Magento, enter your provider-issued API key, select an available Gemini model, save configuration, then click Test AI Prompt.
| Provider | Selectable models | Good starting point |
|---|---|---|
| OpenAI | GPT-6 Astra; GPT-5.6 Sol, Terra, Luna, chat-latest | Sol |
| Anthropic | Claude Sonnet 4.5, Haiku 4.5, Opus 4.1 | Haiku 4.5 |
| Google Gemini | Gemini 2.5 Pro, Flash, Flash-Lite | Flash |
On timeout, API failure, rate limit, or exhausted quota, the widget displays an error or fallback response and may still show locally matched products. Failures are recorded through Magento logging. The next question makes a fresh provider request. There is no automatic failover to another provider; configure its key and select it in Magento when switching.
Configuration reference ★
Catalog
Customers
AI Chatbot
Settings
Enable Chatbot
AI Provider
Model
Chatbot Name
Header Color
| Admin field | Purpose | Default / valid value |
|---|---|---|
| Enable Chatbot | Shows the storefront widget. | Yes · Yes/No |
| AI Provider | Routes new requests. | OpenAI · OpenAI/Anthropic/Google Gemini |
| Provider API Key | Encrypted credential for selected provider. | Empty · provider-issued secret |
| Model | Provider-specific chat model, including GPT-6 Astra for OpenAI. Existing selections are preserved. | GPT-5.6 Sol; Claude Sonnet 4.5; Gemini 2.5 Flash |
| Chatbot Name | Widget display name and %1 replacement. |
Max · plain text |
| Intro Text | First message once per browser session. | Welcome copy · text; %1 = name |
| Chat Header Title | Replaces the text shown in the widget header. | Ask Us Anything · plain text |
| Chat Header Icon | Uploads a custom transparent PNG or GIF for the widget header; leave empty for the bundled blue-sparkle chat-bubble avatar. | Empty · PNG/GIF |
| Chat Toggle Icon | Uploads a custom transparent PNG or GIF for the floating open-chat button; leave empty for the bundled speech-bubble icon. | Empty · PNG/GIF |
| Header / Body / Header Font Color | Widget palette. | #1cc09a / #FFFFFF / #FFFFFF · 3/6-digit hex |
| System Prompt | Tone, policy, scope, and handoff guidance. | Empty · plain text |
| Sitemap Path | Catalog URL source relative to Magento root. | pub/media/sitemap.xml · readable XML path |
| License Key / Server URL / Token | Signed domain entitlement. | Empty · purchase values |
| Max Product Links | Caps extra product URLs from sitemap context; catalog matching is limited separately. | 20 · integer 1–100 |
| Max Category Links | Caps extra category URLs from sitemap context. | 12 · integer 1–100 |
| Test AI Prompt | Tests saved provider, key, model, prompt, and license settings at the selected scope. Default and website tests use that scope’s default storefront domain. | Button · default/website/store-view scope |
Small · <5k SKUs
20 product links, 12 categories, fast/low-cost model. Keep a focused system prompt.
Medium · 5–50k
12 product links, 8 categories. Use split sitemaps and review logs weekly.
Large · 50k+
8 product links, 5 categories. Load-test traffic and prefer a fast model with strict budgets.
ns_aichatbot_refresh_licenses job refreshes licenses every five minutes through Magento cron. Configuration saves also refresh the affected enabled stores. Storefront rendering and chat requests read a verified cached license and never contact the license server. Cached validity lasts at most 24 hours and never beyond the signed expiry; a failed refresh cannot extend it. Keep Magento cron running and check cron_schedule when troubleshooting. Sitemap context remains cached for 12 hours.Catalog knowledge & storefront operation
What the bot can see
Current-product facts reloaded by SKU from the active Magento storefront, including descriptions, visible attributes, options, displayed starting price, currency, and availability; up to 20 eligible catalog matches; supplied categories; up to eight enabled CMS page excerpts; relevant same-store sitemap URLs; and up to eight recent user/assistant messages. Browser-supplied product facts and privileged history roles are ignored. Comparisons cover the retrieved matches, and selected options can change the total.
Long option lists: groups and values matching the shopper’s question take priority, including sizes or LED choices that appear after long finish lists. The AI is told when the supplied selection is incomplete; omitted options must not be treated as unavailable. Confirm exact combinations and additional charges on the product page.
What it cannot see
Customer account records, carts, orders, payment data, unpublished admin data, external websites, inventory-source details, or real-time human-agent status. It does not know every catalog fact or every possible option combination.
Refresh and corrections
- Correct the Magento source data.Update product text, attributes, stock, category, CMS content, or sitemap—not the generated answer.
- Reindex and clean cache.
bin/magento indexer:reindex && bin/magento cache:clean. Each question reloads eligible catalog matches and current-product details through the answer endpoint. The widget sends one answer request per question; the separate product-search endpoint remains available for custom integrations. Answers and temporary provider failures are not cached or shared, so every eligible question and retry makes a fresh AI request. Sitemap URL context remains cached for 12 hours. If you perform a full cache flush, refresh the chatbot configuration or allow the next license cron run. - Constrain behavior.Add verified policy and escalation instructions to the System Prompt. Review Marketing → Chatbot Logs, delete obsolete rows, and retest in an incognito session.
For human escalation, add a support URL, phone number, or email to the System Prompt, for example: “If confidence is low or the shopper asks about an order, link to /contact and do not guess.” There is no native agent queue.
Placement, styling, language
The widget is injected through view/frontend/layout/default.xml; product context is added on catalog product pages. Override templates in app/design/frontend/<Vendor>/<theme>/NS_AiChatbot/templates/, layout in the theme’s NS_AiChatbot/layout/, and CSS/JS via standard Magento theme fallback. Use the admin color pickers for no-code changes: the header color also controls the send button, while the header font color controls both header text and the close icon. The header title, header avatar, and floating toggle icon can each be customized independently; empty image fields use the bundled defaults. Set tone/language in System Prompt; configure each store view independently for localized greetings and policy.
Security & privacy ★
| Destination | Data sent / stored | Retention |
|---|---|---|
| Selected AI provider | System prompt, shopper question, up to eight recent user/assistant messages, relevant product/category/CMS facts, displayed prices and selected options, storefront URLs, and selected model. | Controlled by your provider account and contract. |
| Magento database | Question, answer, timestamp, current SKU and product URL in ns_chatbot_logs. |
No automatic expiry in v1.2.1; administrator deletes rows. |
| Magento cache | Verified license envelope (up to 24 hours, bounded by its signed expiry), sitemap URL cache (12 hours), and per-IP rate counter (about 70 seconds). Chat answers are not cached. | TTL shown; cache backend policy also applies. |
| Browser session | Widget state and recent conversation needed for the experience. | Session/browser lifecycle. |
| License server | License key and normalized store domain; authenticated by license token. | Per your license-account policy. |
Performance
Page delivery
Widget HTML/CSS/JS is rendered with the page. No AI call occurs until a shopper submits, and page rendering uses the verified license cache without contacting the license server. Validate against your theme and network before publishing.
Async request
Each question uses one AJAX answer request with fresh catalog context. Provider latency affects the reply. Repeated questions and retries make fresh AI requests; answers and provider failures are not cached.
Magento cache
Compatible with FPC/Varnish. Same-origin validation supports cached form-key conditions. Sitemap data caches for 12 hours.
Each provider request occupies one PHP worker while awaiting the provider and performs catalog/context preparation plus one log insert. On shared or low-memory hosting, start with a fast model, 8–12 product links, 5–8 categories, and a short prompt; cap concurrent traffic upstream and ensure at least 512 MB PHP memory according to your Magento release requirements.
Ten common problems ★
1. Widget is missing
default.xml.2. “AI service is busy” or generic fallback
var/log/system.log / exception.log.3. 401 / invalid API key
4. 429 / quota exceeded
5. Wrong or invented answer
6. Product links are absent or wrong
7. Static files return 404
8. “Invalid Form Key” / AJAX 400
9. License validation fails
10. Logs are empty
setup:upgrade, inspect table and application logs.For developers
| Surface | Reference |
|---|---|
| PHP namespace/module | NS\AiChatbot / NS_AiChatbot |
| Frontend route | POST /aichatbot/ajax/ask; storefront AJAX action, not a versioned public REST API |
| Templates | view/frontend/templates/chatbot.phtml and chatbot/*_js.phtml |
| Layouts | view/frontend/layout/default.xml, catalog_product_view.xml |
| Assets | view/frontend/web/js/chatbot.js, web/css/chatbot.css |
| Database | ns_chatbot_logs: log_id, created_at, question, answer, sku, product_url |
| Admin ACL | NS_AiChatbot::config, NS_AiChatbot::logs |
| REST / GraphQL | None declared in v1.2.1 |
| Custom events | None dispatched in v1.2.1; standard Magento controller/model events still apply where applicable. |
Extend with a theme override, layout XML, DI preference/plugin, or observer in a separate module. Prefer a plugin around public methods and a dedicated frontend integration over copying controller logic. Do not edit files under vendor/nsplug/aichatbot; Composer upgrades replace them. Keep overrides narrow and regression-test prompt data, escaping, CSP, CSRF, caching, and provider errors.
Upgrading & uninstalling
Upgrade
bin/magento maintenance:enable
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento setup:static-content:deploy -f
bin/magento cache:flush
bin/magento maintenance:disable
Database configuration survives a normal upgrade. Back up code, database, composer.lock, and config before starting. Review breaking changes and test provider calls, the widget, CSP, and store scopes in staging.
Downgrade
There is no automated downgrade path. Restore the pre-upgrade database and composer.lock together; do not install old code over a migrated database unless release notes explicitly permit it.
Disable or fully remove
composer remove nsplug/aichatbot
bin/magento setup:upgrade
bin/magento cache:flush
# Optional irreversible data cleanup (run after a verified backup):
mysql -e 'DROP TABLE IF EXISTS ns_chatbot_logs;' <database>
Remove app/code/NS/AiChatbot instead of composer remove for a manual install. Magento config values remain unless explicitly deleted from core_config_data where path LIKE 'aichatbot/%'. The table/config deletion is permanent; export logs and back up first.
Changelog ★
1.2.1 · September 12, 2026
Availability wording Describes purchasable products as “available to order” instead of inferring physical stock from Magento salability.
Grounded fulfillment claims Requires explicit product facts before claiming stock, immediate shipment, production time, or delivery time. Confirmed catalog facts remain usable.
Optimized artwork Preserves the selected blue-sparkle chat-bubble avatar as a 256×256 transparent PNG while reducing the bundled file from 873 KB to 57 KB. Custom header images remain supported.
1.2.0 · September 5, 2026
Added GPT-6 Astra in the OpenAI model selector, with compatible completion-token limits. Existing model selections and the GPT-5.6 Sol default are preserved.
Product answers Current storefront prices, stock, descriptions, attributes, and options are loaded directly from Magento. Long option lists prioritize the shopper’s requested groups and values, and the AI is told when its selection is incomplete. Up to six product cards prioritize items mentioned in the answer.
Conversation and request fixes Shared answer caching and cached provider failures have been removed. Each eligible question and retry receives a fresh AI response. Chat rendering, product links, user/assistant history, and same-origin/form-key validation have been hardened, including cached pages with stale form keys.
License availability Storefront requests use a verified license cache. Configuration saves and a five-minute background job refresh licenses; temporary failures never extend validity past its existing expiry.
Admin and upgrades Test AI Prompt uses saved settings at the selected default, website, or store-view scope. An upgrade patch clears legacy shared answers. Review the 1.2.0 upgrade steps, refresh cached storefront pages, and verify the license after the final cache flush.
Verification Release checks passed on Magento 2.4.8-p2 with PHP 8.3.33. Astra connectivity, the admin selector, storefront widget, catalog context, and regression checks were verified. Compatibility with each merchant’s complete setup should be checked in staging.
1.1.0 · August 31, 2026
Added Anthropic and Google Gemini provider routing, provider-specific encrypted keys and model selectors, signed domain license verification, configurable intro/palette, CMS context, product/category link caps, graceful product fallback, and same-origin support for cached storefronts.
Changed Provider-specific payload/response handling; sitemap context caches for 12 hours; answer caching considers provider, model, SKU, question, and stock signature.
Fixed GPT-5 token parameter selection, unsafe chat-history values, foreign sitemap URLs, out-of-stock recommendations, and stale form-key behavior behind FPC.
Post-release documentation update · September 3, 2026 Added the configurable chat header title, transparent PNG/GIF header icon, independent floating toggle icon, admin color pickers, send-button color synchronization, refreshed default robot artwork, and on-demand catalog product search notes.
Compatibility Magento Open Source / Adobe Commerce 2.4.6, 2.4.7, 2.4.8; PHP 8.1–8.4 subject to Magento support.
Product details: View product page ↗. Release dates describe this package’s documentation baseline; validate available downloads in your account.
Support
Email & portal
support@nsplug.com
Customer account → Support
Hours
Monday–Friday
09:00–17:00 UTC
Excluding published holidays
Response target
1 business day for first response; complex reproduction or third-party conflicts may take longer.
Included: installation defects, reproducible extension bugs, documented compatibility, license/download access, and clarification of shipped features. Paid customization: theme/headless/Hyvä builds, prompt or catalog strategy, data migration, provider account management, integrations, custom endpoints, performance tuning, and changes to third-party code.
Review the refund policy ↗ before purchase. Compatibility or scope questions are best resolved before ordering—send your exact Magento, PHP, theme, and hosting versions.
