PHPackages                             navindbhudiya/module-product-recommendation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. navindbhudiya/module-product-recommendation

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

navindbhudiya/module-product-recommendation
===========================================

AI-Powered Product Recommendations using ChromaDB Vector Database for Magento 2

1.0.0(8mo ago)102MITPHPPHP ^8.1 || ^8.2 || ^8.3CI failing

Since Dec 12Pushed 1mo agoCompare

[ Source](https://github.com/navindbhudiya-code/magento2-ai-product-recommendations)[ Packagist](https://packagist.org/packages/navindbhudiya/module-product-recommendation)[ Docs](https://github.com/navindbhudiya-aws/magento2-ai-product-recommendations)[ GitHub Sponsors](https://github.com/sponsors/navindbhudiya)[ RSS](/packages/navindbhudiya-module-product-recommendation/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (14)Versions (2)Used By (0)

NavinDBhudiya\_ProductRecommendation
====================================

[](#navindbhudiya_productrecommendation)

[![CI](https://github.com/navindbhudiya/magento2-product-recommendation/actions/workflows/ci.yml/badge.svg)](https://github.com/navindbhudiya/magento2-product-recommendation/actions/workflows/ci.yml)

AI-powered product recommendations for Magento 2 — semantic *related*, *cross-sell*, and *up-sell* suggestions driven by vector embeddings, with optional LLM re-ranking and behaviour-based personalization.

> This README describes **only what the code does today**. Planned and partially-built features live in [ROADMAP.md](ROADMAP.md); an honest feature-by-feature breakdown is in [dev/demo/AUDIT.md](dev/demo/AUDIT.md).

Status
------

[](#status)

Productization phases 0–4 are implemented and **unit-tested** (128 unit + 3 integration tests, phpcs-clean on all new code). The pluggable vector store and the never-empty fallback are wired into the live serving path (`RecommendationService`). Items that require a running stack — admin analytics dashboard UI + JS beacon, GDPR export/erase framework wiring, and all live-environment gate evidence (Luma indexing, hit-rate, CI-green-on-PR) — are listed in [ROADMAP.md](ROADMAP.md).

What it does
------------

[](#what-it-does)

- **Semantic related / cross-sell / up-sell** via nearest-neighbour search over product embeddings, injected into the native Magento blocks through plugins.
- **Pluggable vector store** behind `Api/VectorStoreInterface`:
    - **ChromaDB** (existing).
    - **Search Engine** — your store's OpenSearch/Elasticsearch via k-NN (**no extra infra**).
- **Pluggable embeddings** behind `Api/EmbeddingProviderInterface`:
    - **Hosted API** (OpenAI-compatible, e.g. `text-embedding-3-small`) — recommended default.
    - **ChromaDB embedding-service** (self-hosted Python, `all-MiniLM-L6-v2`).
- **Never-empty block**: a fallback chain (primary → same-category → Magento native) keeps the slot populated even when the AI backend is down (`Service/Fallback/FallbackSelector`).
- **Personalized recommendations** (browsing / purchase / wishlist / "Just for you") with REST + GraphQL APIs.
- **Optional LLM re-ranking** (Claude / OpenAI) — **off by default**.

Requirements
------------

[](#requirements)

- Magento **2.4.6–2.4.8**, PHP **8.1–8.3**.
- A vector store: either OpenSearch/Elasticsearch (already required by Magento) **or** ChromaDB.
- For hosted embeddings: an API key (OpenAI/Voyage/compatible).

Install in 3 minutes (no extra infra)
-------------------------------------

[](#install-in-3-minutes-no-extra-infra)

Uses your existing OpenSearch + a hosted embeddings API — no ChromaDB, no Python container.

```
# 1. Add the module (or copy into app/code/NavinDBhudiya/ProductRecommendation)
bin/magento module:enable NavinDBhudiya_ProductRecommendation
bin/magento setup:upgrade
bin/magento setup:di:compile

# 2. Configure (Stores > Configuration > NavinDBhudiya > AI Product Recommendation):
#    - Embedding > Embedding Provider = "Hosted API"; set API key + model (text-embedding-3-small)
#    - Vector Store > Backend = "Search Engine (OpenSearch/Elasticsearch k-NN)"
#      (set host/port if not the defaults opensearch:9200)

# 3. Index + verify
bin/magento recommendation:index
bin/magento recommendation:health     # expect green + X/Y coverage
```

Prefer ChromaDB? Set Vector Store = ChromaDB and Embedding Provider = ChromaDB, then run the embedding-service container (see `docker/`) — see [CLAUDE.md](CLAUDE.md) for the ChromaDB path.

CLI commands
------------

[](#cli-commands)

All commands use the `recommendation:*` namespace.

CommandPurpose`recommendation:health`Ping embedding provider + vector store; show index coverage.`recommendation:index`Embed and store the catalog.`recommendation:test`Test the ChromaDB / embedding-service connection.`recommendation:similar `Show similar products for a product (or `--query`).`recommendation:clear`Clear the vector collection.`recommendation:personalized`Personalized recommendations for a customer.`recommendation:trending:refresh`Refresh the trending table.`recommendation:refresh-profiles`Refresh customer behaviour profiles.`recommendation:demo:baseline`Measure hit-rate@10 + latency over the ground-truth pairs.Architecture
------------

[](#architecture)

```
Product save / recommendation:index
        │
        ▼
EmbeddingProviderInterface  ──►  VectorStoreInterface  (ChromaDB | Search Engine k-NN)
 (Hosted API | ChromaDB)
        ▲                                 │
        │                                 ▼
PDP / cart blocks ──► RecommendationService ──► nearest neighbours
                              │
                              ├─ optional LLM re-rank (off by default)
                              └─ FallbackSelector: primary → same-category → native

```

- `Api/VectorStoreInterface` — `upsert / query / delete / count / ping`. Implementations: `Service/VectorStore/ChromaVectorStore`, `Service/VectorStore/SearchEngineVectorStore`(selected by config via `VectorStoreFactory`).
- `Api/EmbeddingProviderInterface` — implementations: `ApiEmbeddingProvider`, `ChromaDBEmbeddingProvider` (selected via `EmbeddingProviderFactory`).
- REST: `etc/webapi.xml`. GraphQL: `etc/schema.graphqls`.

APIs
----

[](#apis)

- **REST** — e.g. `GET /V1/recommendation/personalized/justforyou`.
- **GraphQL** — `personalizedRecommendations(type: JUST_FOR_YOU, limit: 8) { items { sku name } }`.

Testing
-------

[](#testing)

No Warden required:

```
bash dev/demo/run-tests.sh            # unit + integration + phpcs
bash dev/demo/run-tests.sh --unit
composer test                          # if composer is available
```

See [CLAUDE.md](CLAUDE.md) for the PHPUnit-10 / Magento classmap caveat and the test launcher.

License
-------

[](#license)

MIT. Author: Navin Bhudiya.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance77

Regular maintenance activity

Popularity3

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

249d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/18b8c30f0537efcf8a0ce7b3862b904922f7a962509115577cba8761463cc4af?d=identicon)[navindbhudiya](/maintainers/navindbhudiya)

---

Top Contributors

[![navindbhudiya-code](https://avatars.githubusercontent.com/u/246432367?v=4)](https://github.com/navindbhudiya-code "navindbhudiya-code (25 commits)")[![navinmagento](https://avatars.githubusercontent.com/u/49339423?v=4)](https://github.com/navinmagento "navinmagento (1 commits)")

---

Tags

aiopenaimachine learningclaudellmmagento2magento 2embeddingschromadbvector-databasepersonalizationrelated productscross-sellproduct recommendationup-sell

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/navindbhudiya-module-product-recommendation/health.svg)

```
[![Health](https://phpackages.com/badges/navindbhudiya-module-product-recommendation/health.svg)](https://phpackages.com/packages/navindbhudiya-module-product-recommendation)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1142.0M17](/packages/mollie-magento2)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

69362.0k](/packages/run-as-root-magento2-prometheus-exporter)[buckaroo/magento2

Buckaroo Magento 2 extension

32426.0k8](/packages/buckaroo-magento2)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50406.2k23](/packages/dotdigital-dotdigital-magento2-extension)[loki/magento2-components

Core module for defining Alpine.js components with advanced AJAX features

1015.1k29](/packages/loki-magento2-components)[yireo/magento2-emailtester2

Preview transactional emails and test send them in your backend

34441.8k](/packages/yireo-magento2-emailtester2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
