展示HN:CommerceTXT – 一种用于AI购物上下文的开放标准(类似于llms.txt)
Show HN: CommerceTXT – An open standard for AI shopping context (like llms.txt)

原始链接: https://commercetxt.org/

## CommerceTXT:赋能精准AI电商 CommerceTXT 是一项新标准,旨在为AI代理(如LLM)提供可靠的、可用于交易的电商数据。与侧重内容发现的llms.txt不同,CommerceTXT 直接向AI提供实时定价、库存和运输政策等关键信息。 主要特性包括指令,如 `@INVENTORY`(减少“缺货”幻觉)、`@SUBSCRIPTION`(用于定期支付)和 `@REVIEWS`(大幅减少评论数据的使用量,高达99.7%)。它专为准确性、法律合规性(映射到Schema.org)以及全球电商(支持多语言和货币)而设计。 CommerceTXT 具有显著优势:改善AI购物回复、减少错误、在AI电商领域获得先发优势,并通过最大限度地减少数据传输来降低AI的碳足迹。它优先采用只读模型作为v1.0版本,在引入交易能力之前,侧重于数据完整性和用户安全。 该协议是一个开放标准,由开放商家上下文工作组维护,旨在确保AI准确反映商家的产品和政策。

## CommerceTXT:AI购物数据的新标准 CommerceTXT的作者推出了一项开放标准,旨在改进AI代理(例如由LLM驱动的AI)访问电子商务信息的方式。目前,AI花费大量资源解析复杂的HTML产品页面,经常导致不准确的数据,例如错误的价格或库存状态。 CommerceTXT提供了一个简单、只读的文本协议——灵感来自`robots.txt`和`llms.txt`——为AI提供确定性的“真相”。它利用分形架构来传递必要的数据,从而大大减少token的使用量(380个token与HTML的8,500个token相比)。主要功能包括库存时间戳和评论验证,以对抗AI的“幻觉”。 该项目是开源的,并寻求反馈,尤其是在其“信任与验证”概念方面。一位评论者建议使用`.well-known`命名空间进行文件注册,而不是网站根目录。 更多信息请访问[https://commercetxt.org](https://commercetxt.org) 和规范[https://github.com/commercetxt/commercetxt](https://github.com/commercetxt/commercetxt)。
相关文章

原文
CommerceTXT Protocol - AI-Ready Commerce Standard

Transaction-ready context for AI agents

Like llms.txt, but for e-commerce

TL;DR: llms.txt is for content discovery. CommerceTXT is for commerce transactions. If AI needs to know your price, inventory, or shipping policy—you need CommerceTXT.

Key Features

CommerceTXT includes powerful directives for transaction-ready commerce:

@INVENTORY

Real-time stock levels eliminate "Is it available?" hallucinations.

Stock: 42
LowStockThreshold: 10
RestockDate: 2025-12-20

Impact: AI can say "Only 3 left" instead of guessing.

@SUBSCRIPTION

Handle recurring payments for SaaS and subscription products.

Plans:
  - Monthly: 29.99
  - Annual: 299.00
Trial: 7 Days Free

Impact: AI compares one-time vs. subscription pricing accurately.

@REVIEWS

Aggregated review data in 50 tokens instead of scraping 15,000.

Rating: 4.7 / 5.0
Count: 1243
TopTags: "Great battery"

Impact: 99.7% token reduction for review queries.

CommerceTXT vs llms.txt

Both protocols help AI understand websites, but they solve different problems:

llms.txt

Use case: Content & Documentation

  • 📄 Links to blog posts and docs
  • 🔍 Discovery focused
  • 💬 "What does this company do?"
  • 📊 Static content

CommerceTXT

Use case: E-commerce & Transactions

  • 💰 Live pricing and inventory
  • 🛒 Transaction ready
  • 🤖 "Can I buy this? How much? When ships?"
  • ⚡ Dynamic commerce data

Detailed Comparison

Feature llms.txt CommerceTXT
Primary Use Case Content discovery Commerce transactions
Data Type Static URLs Dynamic pricing, inventory, policies
Structure Flat list Hierarchical (Root → Category → Product)
Updates Needed When new content published When inventory/prices change
Schema.org Mapping No Yes (legal compliance)
Multi-regional Support No Built-in (@LOCALES)
Real-time Inventory No @INVENTORY directive
Subscription Pricing No @SUBSCRIPTION directive

Why Merchants Need CommerceTXT

🎯 Transaction-Ready

llms.txt is for content. CommerceTXT is for commerce. Price, inventory, shipping, returns—everything AI needs to help customers buy.

⚖️ Legal Compliance

Maps to Schema.org. When AI quotes your price or return policy, it's pulling from the same structured data that Google uses. Defensible, verifiable.

🌍 Built for Global Commerce

Not just multi-language—multi-currency, multi-shipping, multi-policy. German customers see EUR prices and GDPR-compliant terms.

💰 ROI is Clear

Every AI shopping query that gets the right answer = potential sale. Wrong price/availability = lost customer. CommerceTXT ensures accuracy.

Real-World Impact

  • AI Visibility: Your products appear correctly in ChatGPT, Claude, and Gemini shopping responses
  • Reduced Errors: 95% fewer hallucinated prices and policies with @INVENTORY and @REVIEWS
  • First-Mover Advantage: Be discoverable in AI commerce before your competitors
  • Control Your Narrative: Guide how AI presents your products, policies, and brand voice

Efficiency & Ecology

The current web is built for humans, not agents. Rendering a typical e-commerce page to extract a single price requires massive compute resources.

Metric Standard HTML Scraping CommerceTXT Impact
Payload Size ~2.5 MB / page ~0.005 MB / file 500x Smaller
Token Count (Product) ~8,500 tokens ~380 tokens 95% Reduction
Token Count (Reviews) ~15,000 tokens ~50 tokens 99.7% Reduction
Compute Cost High (JS execution) Zero (Static Text) CPU Saved
Data Integrity Probabilistic (Hallucinations) Deterministic (Ground Truth) Transaction Ready

🌱 Sustainable AI

Every token processed by an LLM consumes energy. By stripping away the HTML presentation layer and serving pure context, CommerceTXT can reduce the carbon footprint of AI commerce crawling by over 99% (based on internal payload benchmarks). Adopting this standard is a direct contribution to Scope 3 emissions reduction for tech platforms.

How It Works

The protocol uses a Fractal Architecture to minimize token usage. Agents start at the Root and traverse deeper only when user intent requires it.

Level 1: The Root (Store Identity)

Contains store identity, locales, payments, and shipping rules.

# commerce.txt
Version: 1.0

# @IDENTITY
Name: Demo Store
Currency: USD

# @LOCALES
en-US: /commerce.txt (Current)
de-DE: /de/commerce.txt

# @PAYMENT
Methods: Visa, MasterCard, PayPal, ApplePay

# @SHIPPING
- Standard: Free over $50 | 3-5 Days
- Express: $15.00 | 1-2 Days

# @POLICIES
Returns: 30 Days

# @SUPPORT
Email: [email protected]
Chat: Available 9am-5pm EST

# @CATALOG
- Electronics: /categories/electronics.txt

Level 2: The Category (Filters & Promos)

# electronics.txt

# @FILTERS
Brands: Sony, Samsung
Type: Wireless

# @PROMOS
- SAVE10: 10% Off (Expires 2025-12-31)

# @ITEMS
- Sony XM5: /products/xm5.txt

Level 3: The Product (Transaction Data)

# xm5.txt

# @PRODUCT
GTIN: 027242919412
SKU: WH1000XM5

# @OFFER
Price: 348.00
Availability: InStock

# @INVENTORY
Stock: 42
LowStockThreshold: 10
StockStatus: InStock
LastUpdated: 2025-12-14T15:30:00Z

# @SPECS
Battery: 30 Hours
ANC: True

# @IN_THE_BOX
- Sony WH-1000XM5 Headphones
- USB-C charging cable (1.2m)
- Carrying case
Note: AC adapter NOT included

# @REVIEWS
Rating: 4.7
RatingScale: 5.0
Count: 1243
TopTags: "Great battery", "Comfortable"

# @COMPATIBILITY
WorksWith: iPhone 15, iPad Pro

Subscription Products

# @PRODUCT
Name: Premium Membership

# @SUBSCRIPTION
Plans:
  - Monthly: 29.99 | BilledAs: "$29.99/month"
  - Annual: 299.00 | BilledAs: "$299/year" | Savings: "Save 17%"
Trial: 7 Days Free
CancelAnytime: True

Product Variants (Optional)

# @VARIANTS
Type: Storage
Options:
  - 128GB: 999.00 | SKU: GA05843-128
  - 256GB: 1099.00 | SKU: GA05843-256
  - 512GB: 1299.00 | SKU: GA05843-512

Type: Color
Options:
  - Obsidian: +0.00
  - Bay: +50.00 | Note: "Limited Edition"

For the formal specification, refer to the Full RFC Spec (v1.0).

Future Vision

The following features are proposed for future versions but require community discussion before inclusion:

@ACTIONS EXPERIMENTAL - v2.0+

Vision: Enable AI agents to perform transactional actions—but ONLY with explicit user confirmation (user-in-the-loop).

Example concept:

# @ACTIONS
CheckInventory: GET https://api.example.com/inventory/{sku}
  # Read-only, no auth needed
  
AddToCart: POST https://api.example.com/cart/add
  # Requires OAuth2 + user confirmation
  UserConfirmation: Required before execution

⚠️ CRITICAL: Safety Requirements

  • NO autonomous purchases: AI cannot complete transactions without explicit user approval
  • Payment isolation: AI MUST NEVER access payment credentials
  • Full transparency: Users review cart, price, shipping before authorizing
  • Fraud prevention: Rate limiting, audit trails, abuse detection

Why discussion is needed:

  • Security frameworks: CSRF protection, OAuth standards, session management
  • User consent mechanisms: How to ensure informed, explicit approval
  • Liability frameworks: Who is responsible for AI transaction errors?
  • Fraud prevention: Preventing malicious agents from abusing APIs
  • Should CommerceTXT remain read-only in v1.0? (Recommended: YES)

Recommendation: CommerceTXT v1.0 should remain read-only. Transactional capabilities only after Trust Score system is proven and security standards are established.

Join the discussion: GitHub Discussions

@SUSTAINABILITY RFC Needed

Vision: Verified environmental and ethical claims to reduce greenwashing and help consumers make informed choices.

Example concept:

# @SUSTAINABILITY
CarbonNeutral: Yes
  Verified: https://climatepartner.com/cert/12345
  Certificate: ClimatePartner ID 12345-2024
  
Packaging: 100% Recycled Materials
  Certification: FSC-C123456
  
RepairProgram: Available
  Duration: 7 years of spare parts

Why discussion is needed:

  • Verification requirements: Should third-party proof be mandatory?
  • Which certification bodies are globally recognized?
  • How to handle regional differences in sustainability standards?
  • Anti-greenwashing policies: flagging unverified claims

Join the discussion: GitHub Discussions

Trust & Verification

CommerceTXT minimizes hallucinations by design, but trust must be earned. The protocol includes a verified trust model.

🛡️ Cross-Verification

AI agents periodically verify commerce.txt data against visible HTML and Schema.org. Discrepancies >5% trigger Trust Score penalties.

⏱️ Freshness Check

Agents validate @INVENTORY timestamps. Data older than 24h is flagged; older than 72h is treated as "Unknown".

✅ Verified Reviews

Review data is trusted only if backed by a verifiable Source URL (e.g. Trustpilot, Google Reviews).

Quick Start

For Merchants

Add a single text file to your root directory.

curl -O https://raw.githubusercontent.com/commercetxt/commercetxt/main/templates/commerce.txt

Edit with your details and upload to yourdomain.com/commerce.txt

For Developers

Parse deterministic data, not HTML soup.

# Python Example
import requests
# ... parser logic ...
print(data['@OFFER']['Price'])

View Parsers →

CommerceTXT is an open standard dedicated to the public domain (CC0).

Maintained by the Open Merchant Context Workgroup.

v1.0.0 Stable • Last Updated: Dec 16, 2025

联系我们 contact @ memedata.com