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

# Architecture

> Why the platform holds no domain, and what that buys you.

## The split

The platform is the AI layer. Your product is the system of record. Neither
reaches into the other's database.

```
  Customer                ImpelLabs platform                Your product
 ─────────               ─────────────────              ──────────────
  WhatsApp  ──────────►  identity, channel
                         conversation, memory
                         retrieval, budget
                         the turn
                               │
                               │  tools/call        ┌──────────────────┐
                               └───────────────────►│  MCP server      │
                               ◄────────────────────│  your DB, your   │
                                    result          │  business rules  │
                                                    └──────────────────┘
```

The platform learns that a server offers a tool called `search_products` with
a JSON schema, and that this workspace may call it. It does not learn what a
product is, what a colourway is, or how you price one.

## Why it is built this way

The platform used to hold products, carts and orders. Two things went wrong,
and both are the reason for this contract:

<Steps>
  <Step title="Domain logic leaked upward">
    Fields like `fabric`, `colours`, `moq` and `set_info` ended up in the
    platform's generic catalogue type — one customer's trade shaping the
    layer every customer runs on.
  </Step>

  <Step title="The model could not express the domain">
    A "five colour set" was a free-text string, not a structure. No
    per-colour SKU, no per-colour stock. The vertical needed a data model the
    horizontal layer had no business owning.
  </Step>

  <Step title="So the domain moved out">
    Products, carts and orders were removed from the platform entirely. What
    replaced them is this bridge.
  </Step>
</Steps>

## What each side owns

| Concern                               | Platform | Your product |
| ------------------------------------- | -------- | ------------ |
| Channel transport, delivery windows   | ✅        |              |
| Customer identity across channels     | ✅        |              |
| Conversation state, summary, memory   | ✅        |              |
| Knowledge retrieval                   | ✅        |              |
| Tool execution, idempotency, metering | ✅        |              |
| Your data model                       |          | ✅            |
| Pricing, eligibility, stock           |          | ✅            |
| Business rules and validation         |          | ✅            |
| Fulfilment, invoicing, integrations   |          | ✅            |

<Warning>
  **Pricing and eligibility are yours, and must stay yours.** The platform
  passes an opaque `buyer_ref`; your server decides what that buyer is
  entitled to. Never accept a price, a tier or a discount as a tool argument
  — a language model would then be choosing it.
</Warning>

## The transport

[MCP](https://modelcontextprotocol.io) over Streamable HTTP: JSON-RPC 2.0 to a
single endpoint. The platform implements three methods — `initialize`,
`tools/list` and `tools/call` — and speaks protocol version `2025-06-18`.

Nothing else is required of you. No SDK, no webhook back, no polling.
