← Writing

GraphRAG for e-commerce — why product catalogs break naive RAG

Yunseop Im · Software engineer · M.S. CS, Georgia Tech · 2026 · ~18 min read

Contents 1. The shopping questions that demos can't answer 2. Why chunk-and-embed fails on catalogs 3. What a product graph actually buys you 4. Architecture: from catalog to cited answer 5. Multi-tenancy and the catalog graph 6. Honest limits 7. Reference implementation

1. The shopping questions that demos can't answer

Every "AI shopping assistant" demo works the same way: embed the product descriptions, retrieve the top-k similar chunks, let the LLM write a nice paragraph. It demos beautifully — and then a real user asks something the demo never covered:

None of these are questions about what a product says. They're questions about how products relate — to devices, to each other, to inventory state, to other customers' outcomes. The catalog is a relational database wearing a text corpus's clothing, and chunk-and-embed retrieval reads it like prose. That's the gap.

I ran an LLM shopping assistant in production for a Korean e-commerce community — thousands of members asking exactly these kinds of questions — and the failure pattern was consistent: the system answered what products are, while users asked what products work with, replace, contain, and cost right now.

2. Why chunk-and-embed fails on catalogs

Four mechanical failures, not a "bad embeddings" problem:

2.1 Variants explode the chunk

A single product page describes a product family: "Winter Jacket — navy/S/¥89,000, black/M/¥89,000, olive/L/¥92,000." Chunked and embedded as text, the SKU-level distinctions — which colorway is in stock, which size runs small per reviews — smear into one undifferentiated blob. The model answers about "the jacket" when the user asked about "the navy S."

2.2 Compatibility is a relation, not a description

"Fits iPhone 15 Pro" rarely appears verbatim in the case's description — it lives in a compatibility table, a structured attribute, or a fitment note buried in spec sheet row 14 of 22. Embedding similarity can't join "iPhone 15 Pro" to "Model A2849, A3089, A3090" — those are identifier lookups, and dense retrieval is famously weak on identifiers.

2.3 State changes faster than text

Price, stock, and promotions are mutable state. An embedding indexed last week confidently describes a jacket at ¥89,000 that's now ¥109,000 and sold out in the user's size. Retrieval returns descriptions of the past while the user needs the present.

2.4 Bundle and alternative questions are set operations

"Everything in the bundle except X" or "cheaper alternatives that share the charger spec" are not similarity searches — they're intersections, differences, and joins over product relationships. No amount of chunk tuning produces a set operation.

The pattern: catalog questions are relational queries — compatibility joins, set differences, state lookups. Naive RAG answers "what does this product say." Shopping asks "what works with this, costs this, and exists right now." Different problem, different machinery.

3. What a product graph actually buys you

Represent the catalog as entities and edges instead of text spans:

Product("Winter Jacket") ──has_variant──▶ SKU("navy-S")
SKU("navy-S") ──priced_at──▶ ¥89,000 · stock: 14
Product("Phone Case X") ──compatible_with──▶ Device("iPhone 15 Pro")
Product("Camera Bundle") ──contains──▶ Lens("50mm") + Body + Strap
Product("Laptop A") ──uses_charger──▶ ChargerSpec("65W USB-C")
Product("Laptop B") ──uses_charger──▶ ChargerSpec("65W USB-C")
SKU("navy-S") ──mentioned_in──▶ Review("runs small")

The failing queries become traversals and joins:

Same principle as the engineering-data version of this problem: the graph produces the candidate set retrieval can't reach; the LLM then answers over assembled, current, cited context. The graph handles relations; a separate live lookup handles mutable state (price/stock) — conflating the two is how you get confident answers about yesterday's inventory.

4. Architecture: from catalog to cited answer

Catalog data SKUs · specs · reviews Normalize + link variants → SKUs attrs → entities fitment → edges Product graph entities + edges compatibility · bundles tenant-scoped Hybrid retrieval BM25 + dense + graph traversal + live state join LLM cited answer

4.1 Ingestion: SKUs and relations before embeddings

4.2 Retrieval: relations first, similarity second

  1. Entity resolution. Map the query's product/device/brand mentions to graph nodes — "iPhone 15 Pro" must resolve to the canonical device node, or every downstream traversal is wrong.
  2. Graph traversal for relational intent. Compatibility, bundle membership, shared specs, review aggregation — these are edge walks with filters, executed as queries, not searches.
  3. Hybrid text retrieval for the rest. BM25 for exact model numbers and SKUs (dense retrieval is weak on identifiers); dense embeddings for semantic queries ("warm winter jacket under ¥100k").
  4. Live state join. Price/stock/promotions are fetched at answer time from the source of truth — never from the index.

4.3 Generation: schema-constrained, cited, honest

The serving layer uses vLLM's structured-output machinery — xgrammar-backed JSON-schema constraints via response_format — so every answer is {recommendations[], citations[], caveats[]} where citations point into retrieved context. Two rules that matter in commerce specifically:

5. Multi-tenancy and the catalog graph

Commerce catalogs are multi-tenant by nature: marketplaces host thousands of sellers, each with private inventory, pricing rules, and sometimes confidential supplier terms. The graph inherits the boundary problem — and commerce raises the stakes, because a cross-tenant traversal doesn't just leak data, it can leak pricing strategy.

The working pattern is the same discipline as multi-tenant RAG generally:

6. Honest limits

The honest summary: GraphRAG earns its complexity in commerce when questions are relational — compatibility, bundles, comparisons, aggregates. For single-product descriptions, it's overhead. And the part everyone underestimates isn't the graph — it's the join discipline: relations from the graph, state from the live store, and never the twain confused.

7. Reference implementation

The retrieval mechanics — entity extraction, graph expansion fused with BM25, tenant-scoped traversal — are implemented in graphrag-lab, a zero-dependency Python/SQLite reference you can run against any structured corpus. The e-commerce mapping is an application of the same mechanism: change the entity types and edge semantics, keep the retrieval discipline.

Repo: github.com/signalgap9-del/graphrag-lab
Related: Per-tenant RAG isolation · Running LLM inference on customer GPUs · The production AI open-source stack · profile
Sources: graphrag-lab · vLLM documentation — structured outputs · Microsoft GraphRAG research (edge-centric retrieval over knowledge graphs)