PHPackages                             rkd/module-llms-txt - 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. [API Development](/categories/api)
4. /
5. rkd/module-llms-txt

ActiveMagento2-module[API Development](/categories/api)

rkd/module-llms-txt
===================

Generate llms.txt and llms-full.txt files for Magento 2 stores. Makes your e-commerce catalog discoverable by AI assistants.

1.0.0(1mo ago)212MITPHPPHP &gt;=8.1CI passing

Since Apr 17Pushed 1mo agoCompare

[ Source](https://github.com/iamrobindhiman/magento2-module-llms-txt)[ Packagist](https://packagist.org/packages/rkd/module-llms-txt)[ RSS](/packages/rkd-module-llms-txt/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (3)Used By (0)

RKD LLMs.txt Generator for Magento 2
====================================

[](#rkd-llmstxt-generator-for-magento-2)

Generate `llms.txt` and `llms-full.txt` files for your Magento 2 store, making your product catalog discoverable by AI assistants like ChatGPT, Claude, and Perplexity.

What is llms.txt?
-----------------

[](#what-is-llmstxt)

[llms.txt](https://llmstxt.org/) is an emerging standard (like robots.txt for search engines) that helps Large Language Models understand your website content. This module automatically generates structured, AI-optimized files from your Magento catalog.

Features
--------

[](#features)

- **llms.txt + llms-full.txt** generation (both files, spec-compliant)
- **Inventory-aware** output: excludes out-of-stock products (SQL-level filtering)
- **Variant intelligence**: configurable product options (color, size), bundle items, grouped products, customizable options
- **Niche-adaptive**: admin selects which product attributes to expose (gender for apparel, specs for electronics, ingredients for food)
- **Rich product data**: price, SKU, descriptions, custom attributes
- **Category breadcrumbs**: hierarchical category paths with product counts
- **Spec validation**: checks output against the llms.txt standard
- **Built-in sanitization**: HTML entities decoded, whitespace normalized, tables converted to markdown
- **Multi-store &amp; multi-language**: one file set per store view with automatic cross-language discovery — each language's llms.txt links to its siblings so AI crawlers find them all
- **Cron-based auto-regeneration** with change detection (dirty flags)
- **Manual generation**: admin button, CLI command, REST API
- **Robots.txt integration**: auto-injects llms.txt references
- **Performance optimized**: cursor-based pagination (no OFFSET degradation) + batched EAV queries. Tested on catalogs up to 100K products.

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

[](#requirements)

- Magento 2.4.7 or later (tested on 2.4.7-p1 and 2.4.8)
- PHP 8.1 or later (developed on PHP 8.3)

Installation
------------

[](#installation)

### Via Composer (recommended)

[](#via-composer-recommended)

```
composer require rkd/module-llms-txt
bin/magento module:enable RKD_LlmsTxt
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

### Manual Installation

[](#manual-installation)

1. Create `app/code/RKD/LlmsTxt/` directory
2. Copy module files into it
3. Run:

```
bin/magento module:enable RKD_LlmsTxt
bin/magento setup:upgrade
bin/magento setup:di:compile
bin/magento cache:flush
```

Configuration
-------------

[](#configuration)

Navigate to **Stores &gt; Configuration &gt; RKD &gt; LLMs.txt Generator**

### General Settings

[](#general-settings)

FieldDescriptionDefaultEnable ModuleEnable/disable the moduleYesAuto-RegenerationRegenerate files on a cron scheduleYesRegeneration ScheduleHow often to regenerateDailyStore Description for AIDescribe your store for AI assistants (1-2 sentences)Auto-generatedGenerate NowButton to trigger immediate generation—### Content Sections

[](#content-sections)

FieldDescriptionDefaultInclude CMS PagesInclude CMS pages in outputYesInclude CategoriesInclude product categoriesYesCategory Depth LimitMaximum category tree depth3Include ProductsInclude products in outputYesProduct LimitMaximum number of products. Set to 0 for unlimited (full catalog).0 (unlimited)Product Sort OrderHow to sort productsBest SellersInclude Store MetadataInclude store info sectionYesExclude Out-of-StockFilter out unavailable productsYes### Product Data

[](#product-data)

FieldDescriptionDefaultInclude PricesShow product pricesYesInclude SKUShow product SKUYesInclude Short DescriptionShow product descriptionsYesAdditional Product AttributesSelect extra attributes for your niche—### llms-full.txt Settings

[](#llms-fulltxt-settings)

FieldDescriptionDefaultGenerate llms-full.txtGenerate the complete content fileYesMax File Size (MB)Size limit for llms-full.txt5 MBContent DepthHow much detail per productDetailedUsage
-----

[](#usage)

### CLI Command

[](#cli-command)

```
# Generate both files
bin/magento rkd:llmstxt:generate

# Generate for a specific store
bin/magento rkd:llmstxt:generate --store=1

# Preview without writing files
bin/magento rkd:llmstxt:generate --dry-run

# Generate and validate
bin/magento rkd:llmstxt:generate --validate
```

### REST API

[](#rest-api)

```
POST /V1/rkd/llmstxt/generate    # Trigger generation
GET  /V1/rkd/llmstxt/preview     # Preview output
GET  /V1/rkd/llmstxt/validate    # Validate existing file

```

### URLs

[](#urls)

After generation, the files are served at:

- `https://yourstore.com/llms.txt`
- `https://yourstore.com/llms-full.txt`

### Admin Panel

[](#admin-panel)

- **Marketing &gt; LLMs.txt &gt; Generate Files** — trigger generation
- **Marketing &gt; LLMs.txt &gt; Preview Output** — preview without writing
- **Marketing &gt; LLMs.txt &gt; Configuration** — module settings

How It Works
------------

[](#how-it-works)

1. **SectionProviders** collect data from Magento (metadata, CMS pages, categories, products)
2. **Generator** orchestrates providers, builds markdown output
3. **Validator** checks spec compliance
4. **FileWriter** writes to `var/rkd_llmstxt/` with atomic writes
5. **Router** serves the files at `/llms.txt` with proper UTF-8 headers
6. **Observers** detect entity changes and set dirty flags
7. **Cron** checks dirty flags and regenerates when needed

### Performance

[](#performance)

The module uses **cursor-based pagination** (`WHERE entity_id > :lastId` — no OFFSET performance cliff) combined with **PHP generators** (`yield`) so each batch is processed and released before the next is loaded. Batch-level memory is bounded; total memory scales with catalog size because the final output is assembled before writing. Write-up of the technique: [Paginating Magento catalogs without OFFSET](https://devrob.in/blog/paginating-magento-catalogs-without-offset).

Catalog SizePeak MemoryTimeRecommended PHP `memory_limit`1,000 products~60 MB~0.2s256M10,000 products~120 MB~2s512M (default cap)100,000 products~400 MB~15–20s1024M (raise `product_limit` in admin)By default `Product Limit` is **0 (unlimited)** — the full visible catalog is included. You can optionally cap it via `Stores > Configuration > RKD > LLMs.txt > Product Limit` (for example, to generate a smaller "top products" file). When a configured cap is hit, the generation result surfaces a clear warning telling you how many products were excluded. For very large catalogs (50K+ products), ensure PHP `memory_limit` is sized accordingly using the table above.

Multi-Store and Multi-Language Support
--------------------------------------

[](#multi-store-and-multi-language-support)

Multi-language is a first-class feature, not an afterthought. The module generates **one file set per store view** and makes every language discoverable by AI crawlers from any entry point.

### How it works

[](#how-it-works-1)

For each active store view, the module writes:

- `var/rkd_llmstxt/{store_code}/llms.txt`
- `var/rkd_llmstxt/{store_code}/llms-full.txt`

…served at the store view's public URL:

URL an AI fetchesWhat it gets`https://example.com/llms.txt`Default store view's file (set in Magento's store configuration)`https://example.com/et/llms.txt`Estonian store view`https://example.com/ru/llms.txt`Russian store view`https://example.com/de/llms.txt`German store view### Automatic cross-language discovery

[](#automatic-cross-language-discovery)

Each file includes an **"Available in Other Languages"** section listing sibling store views on the same website:

```
## Available in Other Languages

This store is also available in other language versions. Each language has its own AI-readable catalog:

- [Russian](https://example.com/ru/llms.txt)
- [German](https://example.com/de/llms.txt)
```

An AI that fetches any one language's llms.txt will find the others automatically — no external sitemap or registry needed.

### Language handling internals

[](#language-handling-internals)

Content resolution follows Magento's native EAV store-scope fallback:

- Product, category, and CMS fields load at the requested store view's scope
- When a field isn't translated for that store view, the default (admin-scope) value is used — identical to Magento's storefront behavior
- UTF-8 is preserved end-to-end: Cyrillic, Greek, Chinese, Arabic, emoji, and extended Latin (`ä`, `õ`, `ß`, `ü`) all render correctly

> **Note:** For AI output to be fully localized per language, merchants should translate product names, descriptions, and attribute values for each store view. If content isn't translated, the fallback (default-scope) value appears — accurate to what the storefront serves, but potentially mixing languages in the output. This is a content-translation responsibility, not a module limitation.

Supported Product Types
-----------------------

[](#supported-product-types)

TypeOutputSimpleName, URL, SKU, Price, DescriptionConfigurable+ Available options (Color, Size, etc.)Bundle+ Included items per bundle optionGrouped+ Associated products with pricesVirtual+ "Digital" labelDownloadable+ "Download" labelCustomizable Options+ Add-on options with pricesChange Detection
----------------

[](#change-detection)

The module tracks changes via Magento events:

- `catalog_product_save_after` — product changes
- `cataloginventory_stock_item_save_after` — stock changes
- `cms_page_save_after` — CMS page changes
- `catalog_category_save_after` — category changes

When a change is detected, a dirty flag is set. The next cron run regenerates the files.

License
-------

[](#license)

MIT License. See [LICENSE.txt](LICENSE.txt).

Support
-------

[](#support)

- **Bug reports and feature requests:** [GitHub Issues](https://github.com/iamrobindhiman/magento2-module-llms-txt/issues)
- **Questions and discussion:** [GitHub Discussions](https://github.com/iamrobindhiman/magento2-module-llms-txt/discussions)
- **Author:** [Robin Dhiman](https://devrob.in) — senior web engineer, fifteen years in Magento 2 and Hyvä. More writing at [devrob.in/blog](https://devrob.in/blog); contact  for engagements.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/09416613d2fc6c06d39aa0beb821d26c34950d2e85c685ed49fe0de8bafb653f?d=identicon)[iamrobindhiman](/maintainers/iamrobindhiman)

---

Top Contributors

[![iamrobindhiman](https://avatars.githubusercontent.com/u/2010204?v=4)](https://github.com/iamrobindhiman "iamrobindhiman (5 commits)")

---

Tags

ai-ecommerceai-seochatgptclaudecomposer-packagee-commerceecommercegenerative-aihyvallms-txtllms-txt-generatormagento-extensionmagento-modulemagento2open-sourceperplexityphpseostructured-dataaie-commerceseoclaudemagento2ChatGptperplexityllmsllms-txt

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/rkd-module-llms-txt/health.svg)

```
[![Health](https://phpackages.com/badges/rkd-module-llms-txt/health.svg)](https://phpackages.com/packages/rkd-module-llms-txt)
```

###  Alternatives

[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68353.9k](/packages/run-as-root-magento2-prometheus-exporter)[mollie/magento2

Mollie Payment Module for Magento 2

1131.8M12](/packages/mollie-magento2)[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8054.6M39](/packages/smile-elasticsuite)[magento/module-upward-connector

Magento module used for routing all frontend requests through UPWARD-PHP.

24427.4k1](/packages/magento-module-upward-connector)[dotdigital/dotdigital-magento2-extension

Dotdigital for Magento 2

50390.4k20](/packages/dotdigital-dotdigital-magento2-extension)[swissup/module-search-mysql-legacy

Legacy mysql search for magento 2.4

10486.4k](/packages/swissup-module-search-mysql-legacy)

PHPackages © 2026

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