> ## Documentation Index
> Fetch the complete documentation index at: https://betterdatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Platform architecture

> Four product layers and an operational signal chain — complementary to the canonical layered ecosystem model (C5/C8).

# Platform architecture

How the four **product** layers connect: **Loop Engine**, **Commerce Gateway**, **SCM/DCM modules**, and **Signal Tags**.

<Note>
  **Canonical layered messaging** (Infrastructure → Protocol → Reference → Control → Platform) lives in [Core Concepts — Layered ecosystem](/getting-started/concepts#layered-ecosystem-model-canonical). **MCP surface roles** (Gateway Console vs Commerce Gateway vs Registry MCP): [MCP surfaces](/reference/mcp-surfaces). **Full C8 contract:** [Surface contract](/reference/surface-contract).

  The ASCII diagram below is the **operational signal chain** across those product layers — not a second competing “flat stack of products,” and not the same as the MCP deployment table.
</Note>

## The four layers

| Layer                | What it does                                  | OSS                                                                                    | Hosted                                                 |
| -------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| **Loop Engine**      | Governs decisions — AI, human, and automation | `@loop-engine/*` · [loopengine.io](https://loopengine.io)                              | [loops.betterdata.co](https://loops.betterdata.co)     |
| **Commerce Gateway** | Connects LLMs to commerce data                | `@commercegateway/commerce-gateway` · [commercegateway.io](https://commercegateway.io) | [gateway.betterdata.co](https://gateway.betterdata.co) |
| **SCM/DCM modules**  | Supply and demand chain operations            | `@betterdata/scm-*`, `@betterdata/dcm-*`                                               | [app.betterdata.com](https://app.betterdata.com)       |
| **Signal Tags**      | Physical product authentication               | `@signal-tags/*` · [tagd.sh](https://tagd.sh)                                          | [verify.betterdata.co](https://verify.betterdata.co)   |

## How they connect

```
Signal Tags scan
      ↓
Loop Engine          ← decision governance
      ↓
Commerce Gateway     ← LLM commerce data
      ↓
SCM/DCM modules      ← supply / demand operations
      ↓
Better Data platform ← AI, compliance, analytics
```

A tag scan, procurement approval, or order event can **open or advance a loop**. The gateway exposes **tooling to LLMs** against the same operational data the SCM/DCM modules maintain.

### Agent composition (C12)

**Agents** are not an autonomous platform or a separate “agent SKU.” They use **Registry MCP** to discover, **Commerce Gateway** to act, and **Loop Engine** to govern — the same layers as the rest of the system:

```
Agent
  ↓
Registry MCP
  ↓
Commerce Gateway
  ↓
Loop Engine
  ↓
Demo / UI
```

→ [Commerce Agent pattern](/reference/commerce-agent-pattern) · [Build an agent](/guides/build-an-agent)

## OSS vs hosted

Every layer is available as **Apache-2.0** open source (self-hostable). The hosted platform adds:

* Multi-tenant isolation
* AI-assisted demand intelligence and forecasting
* **Industry Pack** policy overlays (Healthcare, Pharma, Retail, Manufacturing, Food & Beverage, Construction)
* Compliance reporting (DSCSA, EU FMD, FDA UDI/FSMA, and related regimes)
* Enterprise SLA and support

Industry Packs and parts of the control plane are **proprietary**; domain packages and loop definitions remain OSS.

## The loop model

Everything important in the platform is modeled as a **loop**: a governed workflow with named **actors**, **guard policies**, **evidence**, and an **audit trail**.

Examples:

* **Procurement loop** — AI recommends → guard evaluates → human approves → PO executes
* **Quality loop** — Signal Tag scan → verification → quarantine or release
* **Returns loop** — RMA request → inspection → disposition

See [Loops](/platform/loops) and [Hosted Loop Engine](/hosted/loops).

## Where to go next

* [SCM workspace (`apps/scm`)](/reference/scm-workspace-app) — tenant app; **SCM vs DCM** split and **usage-based** billing in Settings → Billing
* [Loops](/platform/loops)
* [Signal Tags (platform)](/platform/signal-tags)
* [Commerce Gateway integration](/integrations/commerce-gateway)
* [SCM packages](/oss/scm-packages)
* [DCM packages](/oss/dcm-packages)
* [Signal Tags OSS](/oss/signal-tags)
* [Loop definitions](/oss/loop-definitions)
