# someplus/module-mage-assist-smart-query

> MageAssist - AI-powered admin assistant for Adobe Commerce with OpenAI, Claude, and OpenRouter support

`composer require someplus/module-mage-assist-smart-query`

Canonical URL: https://packagento.com/someplus/module-mage-assist-smart-query

## At a glance

- **Vendor**: Some Plus (https://packagento.com/someplus.md)
- **Latest version**: 1.0.3 — released 2026-07-25
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/someplus/module-mage-assist-smart-query and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require someplus/module-mage-assist-smart-query:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

MageAssist - AI-powered admin assistant for Adobe Commerce with OpenAI, Claude, and OpenRouter support

## README

MageAssist is an AI-powered assistant for your Magento 2 admin panel. Query orders, customers, products, and generate reports using natural language.

### Features

#### Multi-Provider AI Support
- **OpenAI** - GPT-4o, GPT-4, GPT-3.5 + Custom Models
- **Anthropic Claude** - Claude 3.5 Sonnet, Claude 3 Opus + Custom Models
- **OpenRouter** - Access to 100+ AI models + Custom Models

#### Query Capabilities
- **Orders**: Search, filter, view details, status distribution
- **Customers**: Lookup, order history, statistics
- **Products**: Search, stock levels, low stock alerts
- **Reports**: Sales reports, revenue trends, top products

#### Visual Analytics
- Interactive charts powered by Chart.js
- Line, bar, pie, and doughnut charts
- Revenue trends, order distributions, product performance

#### User Experience
- Floating chat widget on all admin pages
- Fullscreen mode for detailed analysis
- Chat history per admin user
- Quick action buttons for common queries

### Requirements

- Magento 2.4.4 or higher / Adobe Commerce 2.4.4+
- PHP 8.1 or higher
- API key from OpenAI, Anthropic, or OpenRouter

### Installation

#### Via Composer (Recommended)

```bash
composer require someplus/module-mage-assist-smart-query
bin/magento module:enable SomePlus_AdminChatbot
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

#### Manual Installation

1. Create directory: `app/code/SomePlus/AdminChatbot`
2. Extract package contents to that directory
3. Run Magento commands:

```bash
bin/magento module:enable SomePlus_AdminChatbot
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:clean
```

### Configuration

1. Go to **Stores > Configuration > SomePlus > MageAssist**
2. Select your AI Provider (OpenAI, Anthropic, or OpenRouter)
3. Enter your API key
4. Choose your preferred model (or use Custom Model option)
5. Configure advanced settings if needed
6. Save configuration

### Usage

#### Basic Queries

Ask questions in natural language:

- "How many orders came in today?"
- "Show me pending orders"
- "Find customer john@example.com"
- "What's the stock for SKU-123?"
- "Give me this week's sales report"

#### Report Queries

For visual reports:

- "Show revenue trend for the last month"
- "What are the top selling products?"
- "Show order status distribution"
- "Customer statistics for this week"

#### Quick Actions

Use the quick action buttons for common tasks:
- Today's Orders
- Weekly Report
- Low Stock Products
- New Customers

### API Providers

#### OpenAI
Get your API key from [OpenAI Platform](https://platform.openai.com/api-keys)

Recommended models:
- **gpt-4o** - Best performance (recommended)
- **gpt-4o-mini** - Faster and cheaper

#### Anthropic Claude
Get your API key from [Anthropic Console](https://console.anthropic.com/settings/keys)

Recommended models:
- **claude-3-5-sonnet** - Best balance
- **claude-3-opus** - Most capable

#### OpenRouter
Get your API key from [OpenRouter](https://openrouter.ai/keys)

Access to multiple providers through one API.

#### Custom Models
All providers support custom model names. Select "Custom Model" from the dropdown and enter any valid model identifier.

### Security

- All API keys are encrypted in the database
- READ-ONLY access to store data
- No data modification capabilities
- Admin ACL resource controls
- Rate limiting per user

### Support

- Documentation: https://docs.someplus.work/mageassist
- Support: support@someplus.work
- Issues: https://github.com/someplus/mageassist/issues

### Changelog

See [CHANGELOG.md](CHANGELOG.md) for version history.

### License

Commercial License - See [LICENSE.txt](LICENSE.txt)

Copyright (c) 2024 SomePlus

## Changelog

All notable changes to MageAssist will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### [1.0.2] - 2026-04-26

#### Changed
- Composer package name: `someplus/module-mage-assist-smart-query` (avoids duplicate Marketplace SKU; differs only by a hyphen: `mage-assist`)

### [1.0.1] - 2026-04-26

#### Changed
- Product renamed to "Mage Assist – Smart Query"
- Version bump to 1.0.1 for Adobe Commerce Marketplace (resolves duplicate 1.0.0)

#### Fixed
- PHP 8.4 compatibility added to composer.json
- Replaced md5() with sha256 hash for improved security

### [1.0.0] - 2024-11-25

#### Added
- Initial release of MageAssist
- Multi-provider AI support (OpenAI, Anthropic Claude, OpenRouter)
- Custom model name support for all providers
- Order queries: search, filter by status/date/customer, view details
- Customer queries: lookup by email/ID/name, order history, statistics
- Product queries: search by name/SKU, stock information
- Inventory management: low stock alerts, stock levels
- Sales reporting: daily/weekly/monthly reports, revenue trends
- Chart.js integration for visual analytics
- Line, bar, pie, and doughnut chart support
- Floating chat widget for admin panel
- Fullscreen mode
- Chat history per admin user
- Quick action buttons
- Rate limiting
- Admin ACL integration
- Encrypted API key storage
- Multi-language support (English default)

#### Security
- Read-only data access
- CSRF token validation
- Admin session validation
- Rate limiting per user (configurable)
- Encrypted API credentials

### [Unreleased]

#### Planned
- Webhook notifications
- Custom function definitions
- Export chat history
- Voice input support
- Additional chart types
- Custom report templates

## Recent Versions

| Version | Released |
|---|---|
| 1.0.3 | 2026-07-25 |
| 1.0.2 | 2026-07-25 |

## Dependencies

### Require

| Package | Constraint |
|---|---|
| magento/framework | 103.0.*\|\|104.0.* |
| magento/module-backend | 102.0.* |
| magento/module-catalog | 104.0.* |
| magento/module-catalog-inventory | 100.4.* |
| magento/module-customer | 103.0.* |
| magento/module-sales | 103.0.* |
| magento/module-store | 101.1.* |
| php | ^8.1 |

## Quality

Latest release (1.0.3) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Warning | 92 | 92 warnings (ruleset: Magento2), 51 auto-fixable with phpcbf |
| PHPMD | Warning | 49 | 49 rule violations (UnusedPrivateField:49) |
| Cpd | Warning | 1 | 1 duplicated chunk spanning 75 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 5 | 5 | – | – |
| 2.4.8 | – | 5 | 5 | – |
| 2.4.9 | – | – | 5 | 5 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["someplus/module-mage-assist-smart-query"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

Some Plus is a Magento 2 vendor on Packagento. See https://packagento.com/someplus.md for their full catalogue.

