sndsabin / module-embedding
This module is responsible to generate the embedding vectors.
Package info
github.com/sndsabin/magento2-embedding
Type:magento2-module
pkg:composer/sndsabin/module-embedding
Requires
- guzzlehttp/guzzle: *
- openai-php/client: 0.19.1
This package is auto-updated.
Last update: 2026-04-30 17:53:09 UTC
README
`sndsabin/module-embedding`
Main Functionality
This module generates product embeddings for Magento 2 catalogs using OpenAI-compatible models.
⚠️ This is not a standalone module. It is intended to be used together with a Semantic Search module.
Installation
- Install the module via composer:
composer require sndsabin/module-embedding
- Enable the module:
bin/magento module:enable SNDSABIN_Embedding bin/magento setup:upgrade
Configuration
Navigate to Stores → Configuration → Embedding → Settings
General
- API Key
- Required for most providers
- If your provider does not require a key, enter any placeholder value
Advanced
-
Base URI of Model
- Example:
https://api.openai.com/v1
- Example:
-
Model
- Example:
text-embedding-3-small
- Example:
-
Embedding Dimension
- Example:
1536(fortext-embedding-3-small)
- Example:
-
Index Name
- Example:
product_embedding_v1 - When changing model or dimensions, update index version
(e.g.product_embedding_v1 → product_embedding_v2)
- Example:
-
Attributes for Embedding
- Product attributes used to generate embeddings
- Note: Name, SKU, Short Description, and Description are always included
⚠️ After configuration, Generate product embeddings. This process may take some time depending on catalog size.
Generate Product Embedding
1. Queue embedding generation
bin/magento sndsabin:catalog_product:embedding:generate
This command queues embedding jobs for all products.
⚠️ This command is usually run once during initial setup.
Embeddings for new or updated products are generated automatically.
2. Run the consumer
bin/magento queue:consumers:start catalogProductEmbeddingConsumer --batch-size=100
This consumer processes queued messages and generates embeddings. Use cronjob or supervisor to start the consumer.
Tested On:
- Magento 2.4.8
- PHP 8.4
- RabbitMQ 4.1
- OpenSearch 3.3