# Put molted.net inside your SaaS

> How a software company gives every one of its users an agent that adapts to them, step by step, and what the product gains.

**Ask your management agent:**

- "Create a Mue agent for my client Acme, size Small, tagged client=acme."
- "Send me a new invite link for the acme agent."
- "Create my branded app called Acme AI, with dark blue as the main colour."


> Integrating molted.net into a SaaS makes it exceptional, because the product adapts to each user. And it is
> hard to think of anything better than a product that adapts to its user.

Every SaaS has the same problem: one product for thousands of different people. Each of them wants a report
you do not have, an automation for their own way of working, a screen arranged their way. You cannot build all
of it. Their agent can.

With molted.net, each of your users gets **their own agent**, on its own machine, that knows your product and
works for them. It learns how they use it, builds the tools and routines they need with your API, and
becomes, over time, a version of your product made for them.

## What your product gains

- **It adapts to each user.** The agent turns "I wish the product did X" into something that exists that
  afternoon, for that user, without waiting for your roadmap.
- **It works while your users are away.** Routines run on schedule: daily reports, alerts, clean-ups, syncs
  with their other tools.
- **It connects your product to the rest of their world.** Through 1,500+ connected apps, their agent links
  your product to their email, CRM, calendar or spreadsheets.
- **Your users stay.** A product that has learned how someone works, and built their tools around them, is
  hard to leave.
- **A new line of revenue.** Sell the agent as an add-on or a higher plan; you pay molted.net per instance and
  per use, and set your own price.
- **No infrastructure to run.** Machines, updates, repairs, backups, the browser, connected apps and the
  models are ours to run.

## How it works, step by step

### 1. Create your account

[Sign up](quickstart.md), choose the region closest to your users, and add credit. For volume pricing, a
monthly invoice or a dedicated deployment, talk to us about [Enterprise](enterprise.md).

### 2. Build the agent your users will get

Start one Mue instance and make it the agent you want every user to have:

- **Instructions**: who it works for, what your product does, what it must never do.
- **Skills**: how to use your product's API (endpoints, examples, pitfalls), how to build a report, how to set
  up a common automation. Write them the way you would brief a new support engineer.
- **Your product's access**: the agent calls your API with a token of the user it works for. In the
  template, make this token a **variable** filled in at creation.

Talk to it as one of your users would, until it does the job well.

### 3. Turn it into a template

Turn what works into a [template](templates.md): the instructions, the skills and the variables (the
user's name, their language, their API token in your product). The easiest way is to ask your
[management agent](management-agent.md) to write the template from the files of your test agent. Leave out
what is specific to your test (memory, notes, secrets).

On Mue, a template can also carry **the agent's home screen and left bar**: the suggested missions shown under
the message field, the pages in the bar and their order, and custom pages. Each new agent is then born ready
for its user's job, with the right suggestions on its home screen before its first conversation. For example,
for a real-estate agency:

**Ask your management agent:**

- "Create a template for my real-estate agency clients: four home suggestions in French (Estimate a property / Write the listing / Follow up with the buyers / Plan the week's visits), the visite-bien skill, and the left bar with a custom page 'biens'. Show me the list first, then create an agent for Claire Martin from it."


To check it, open the new agent's home screen: the four cards are there before its first conversation.

### 4. Create an agent for each user, from your backend

When a user turns the agent on (at sign-up, or when they buy the add-on), your backend calls the API:

```bash
curl -X POST "https://api.<region>.molted.net/v2/instances" \
  -H "Authorization: Bearer $MOLTED_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "handle": "u-4821",
    "tenantId": "<your account id>",
    "instanceType": "small",
    "templates": [{
      "name": "yourproduct/1/agent",
      "plainValues": { "USER_NAME": "Claire", "PRODUCT_API_TOKEN": "<token for this user>" }
    }],
    "ownerPath": "/users/4821",
    "tags": [
      { "key": "user.id", "value": "4821" },
      { "key": "plan", "value": "pro" }
    ]
  }'
```

- The **tags** and the **ownerPath** let you find each user's agent again (`GET /v2/instances?tagKey=user.id&tagValue=4821`).
  See [Organise clients](organise-clients.md).
- Store the returned instance id next to the user in your own database.
- Set a monthly [usage cap](usage-caps.md) that matches the plan the user pays for.

### 5. Let users open their agent from your product

Two ways, often together:

- **Your branded app**: an app with your name, logo and colours, on your domain (for example
  `agent.yourproduct.com`). See [Your branded app and domains](branded-app.md).
- **An "Open my agent" button** in your product: your backend asks for a [sign-in link](access-links.md)
  (`POST /v2/instances/{id}/open-in-application`) and sends the user to it. They land in their agent, already
  signed in, without a second password.

For a user who has not signed in to your product recently, send an [invite link](access-links.md) by email
instead.

### 6. What the agent then does for each user

From the first conversation, the agent works for that one person:

- it answers questions about your product with their own data;
- it builds what they ask for: a report, a dashboard page, an automation, an export to their spreadsheet;
- it turns repeated requests into [routines](routines.md) that run without them;
- it connects your product to their other tools through [connected apps](connected-apps.md);
- it remembers their preferences, and gets better at working for them every week.

Two users of the same plan end up with two different agents, each shaped by its user.

### 7. Billing

- molted.net charges you per instance and per day (a Small instance costs $2.88 a month), plus the
  tools each agent uses, under its cap. See [Prepaid wallet](prepaid-wallet.md).
- Read what each user's agent cost (`GET /v2/instances/{id}/cost`) and bill it your way: included in a plan,
  as an add-on, or by usage. See [Resell and re-bill](resell-and-rebill.md).
- Users who bring their own ChatGPT or Claude subscription can connect it to their agent; otherwise Molted
  Flash is charged to your wallet.

### 8. The rest of the lifecycle

- **A user goes quiet**: stop their instance. It keeps everything and costs 10 times less;
  start it again when they come back.
- **A user leaves**: delete their instance. Its data is erased after 7 days.
- **You improve the agent**: publish a new version of your template for new users, and apply it to existing
  agents when you are ready.

## Products built this way

- **[Miakapp](https://miakapp.com)**, the smart home that builds itself, uses molted.net: each home gets an
  agent that finds the devices, writes the automations and designs an interface for everyone who lives there.
- **[TradingView-API](https://github.com/Mathieu2301/TradingView-API)**, the open-source market-data library,
  uses molted.net: an agent on molted.net works with the library to research, backtest and run its user's
  strategies, and reports back.
- **[TraCflux](https://tracflux.com)**, free software for designing traffic-signal plans, has a molted.net
  integration planned, which can already be tried: an agent that helps each engineer design and optimise their
  plans.
- **A possible case:** a lead-generation service such as [IGLeads.ai](https://igleads.ai) could give each
  customer an agent that qualifies new leads and drafts the follow-ups every day.

> **With Enterprise, on request:** we can build the integration with you, from the template and skills to the
> "Open my agent" button and your branded app, with volume pricing and a dedicated deployment if you need one.
> See [What Enterprise adds](enterprise.md#talk-to-us).
