> For the complete documentation index, see [llms.txt](https://docs.karini.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.karini.ai/agentic-ai-workshops/automotive-and-manufacturing/supplier-catalog-normalization.md).

# CatalogSync: Build a Deep Agent for Supplier Catalog Normalization

Build CatalogSync, a deep agent that maps any supplier's price catalog, pauses for your approval, validates every line against the ERP, and returns a normalized Excel file for ERP stagging.

**Lab time:** about 45 to 55 minutes, including two agent runs

## The Problem

Every supplier sends price updates in a different format: different column names, units, currencies, and file types. Before any of it reaches the ERP, someone has to map the columns, check every line against the item master, and flag prices or units that don't match. For a single catalog with thousands of lines, that's hours of spreadsheet work, repeated every time the supplier sends an update.

## What You Will Build

CatalogSync, a deep agent that turns any supplier's price catalog into a clean, validated file for the ERP . Upload a catalog and it will:

1. Profile the file and propose a column mapping
2. Pause and ask you to approve the mapping
3. Validate every line against the ERP item master, applying price, unit, currency, and duplicate rules
4. Return an HTML report with exception counts and a download link to a normalized Excel file.

## What You Will Learn

* Build a deep agent that pauses for human approval mid-task, then continues
* Give an agent tools (code Interperter, database) and skills (packaged instructions and scripts)
* Keep the agent on safe rails with predefined SQL calls and checksum-protected data loads
* Compare models side by side and pick a primary and fallback model
* Debug a multi-step agent with Traces
* Deploy the result as a copilot end users can open in a browser

## Build Order

Build the agent with its tools and skills first, then the recipe, and the copilot last. A recipe can only use prompts that are already published.

| Step | You create                   | Contains                                                                        |
| ---- | ---------------------------- | ------------------------------------------------------------------------------- |
| 1    | Agent: CatalogSync Agent     | 2 tools (ERP, code\_interpreter) and 2 skills (catalog-extract, catalog-report) |
| 2    | Recipe: catalogsync-workflow | Chat, Start, Deep Agent, End                                                    |
| 3    | Copilot: CatalogSync         | Chat page for end users                                                         |
| 4    | End-to-end test              | Two runs: first with approval, second reusing the saved mapping                 |

## Before You Start

Your instructor has prepared the following so you can focus on building the agent:

* Login to Karini AI at app.karini.ai
* The prompt template **CatalogSync Agent**, available in Prompt Playground → Prompt templates
* The skills **catalog-extract** and **catalog-report**, available in the Skills Library
* A test supplier catalog in (Excel, CSV, or PDF) formats will be provided by instructor in BOX folder.&#x20;
* PostgreSQL credentials for the ERP database: host, user name, and password

Every template and resource name in this guide matches what is set up in Karini. Search for them exactly as written.

## Words You Will See

* **Deep Agent:** an agent type for long, multi-step tasks. It can pause and ask the user a question, here to approve the column mapping, then continue.
* **Prompt template:** a ready-made prompt stored in Karini. You load it with Use template.
* **Tool:** something the agent can call. Here: a Python code Interpreter and the ERP database.
* **Skill:** a folder of instructions and scripts the agent reads when it needs them.
* **Column mapping:** which column in the supplier's file matches which ERP field, such as "Supplier Part No" to part number
* **Recipe:** the workflow that connects everything on a canvas.
* **Copilot:** the chat assistant end users open to use the recipe.
* **Publish:** saves a version that recipes can use. Saved but unpublished changes are not used.
* **Deploy:** makes a published recipe version live, so the copilot or webhook uses it. click Actions → Deploy after you publish.

## Step 1: Create the CatalogSync Agent

### 1.1 Create the prompt

1. From the left menu, open Prompt Playground.
2. Click Add new in the top right corner.
3. Click Prompt templates, Select **Name** from the dropdown next to the search field, search for **CatalogSync Agent**, select it, and click Use template.
4. Configure the prompt:

| Field             | Value             |
| ----------------- | ----------------- |
| Name              | CatalogSync Agent |
| Task              | Deep Agent        |
| Max State Updates | 50                |

5. Save the Deep Agent prompt and re-open prompt in prompt playground.
6. Scroll down to the Agent input box and paste the test catalog below.

{% code overflow="wrap" %}

```
Supplier Id - SUP-042
Supplier Part No    Description    Unit    Price    Currency    Effective Date    Lead Time (days)    Notes
GD-2001-RH    Door Hinge Assembly RH new    PCS    19.25    USD    11/1/2026    28    
gd-1001    Butt Hinge 2 in Steel    EACH    17.63    USD    11/1/2026    28    MOQ 100
hf-80505    Butt Hinge 2 in Stainless    EA    23.26    USD    11/1/2026    10    
gd-1003    Butt Hinge 3 in Steel    ea    44.42    USD    11/1/2026    14    
GD-1004    Butt Hinge 3 in Stainless    Each    $16.85     USD    11/1/2026    7    
GD-1006    Butt Hinge 4 in Stainless    ea    34.1    USD    11/1/2026    7    MOQ 100
GD-1008    Butt Hinge 6 in Stainless    EA    32.32    USD    11/1/2026    10    MOQ 100
GD-1009    Piano Hinge 2 in Steel (std pack)    EA    $14.32     USD    11/1/2026    28    MOQ 100
GD-1010    Piano Hinge 2 in Stainless new    ea    10.56    USD    11/1/2026    7
```

{% endcode %}

7. Click Save.

Save before you move to the Tools or Skills tab, or your changes are lost.

This sample is messy on purpose: mixed-case part numbers, four spellings of "each", dollar signs in some prices, and "new" in some descriptions. That is exactly what real supplier files look like, and what CatalogSync has to clean up.

### 1.2 Add tool 1: ERP

1. Open the CatalogSync Agent in prompt playground.
2. Open the Tools tab, click Add new, and select Agent tools.
3. Fill in:

| Field                          | Value                                                                    |
| ------------------------------ | ------------------------------------------------------------------------ |
| Name                           | ERP (exactly, no trailing space: the prompt calls the tool by this name) |
| Description                    | \<Copy the text below exactly>                                           |
| Type                           | Database                                                                 |
| Connector type                 | PostgreSQL                                                               |
| Host, User name, User password | From your instructor                                                     |
| Database                       | postgres                                                                 |
| Port                           | 5432                                                                     |

Description text:

{% code overflow="wrap" %}

```
Runs SQL on the ERP PostgreSQL database (catalog postgres, schema erp). Use it only for the predefined calls in the prompt: read or save the supplier's column mapping, load the catalog lines exactly as the extract script prints them, check the load progress, validate the lines against the ERP item master (price, unit, currency and duplicate rules), and roll back after an error. Never write other SQL and never change the ERP master tables.
```

{% endcode %}

3. Click Test and wait for PostgreSQL connection test passed.
4. Click Save.

### 1.3 Add tool 2: code\_interpreter

1. In the Tools tab, click Add new and select Agent tools.
2. Fill in:

| Field                               | Value                                                               |
| ----------------------------------- | ------------------------------------------------------------------- |
| Name                                | code\_interpreter (exactly: the prompt calls the tool by this name) |
| Description                         | \<Copy the text below exactly>                                      |
| Type                                | Code Interpreter                                                    |
| Input Schema and Input Test Payload | \<Copy the text below exactly>                                      |
| Internet Access                     | Enable Public Internet Access                                       |

Description text:

{% code overflow="wrap" %}

```
Runs Python code with AWS access. Use it to read the uploaded supplier catalog, run the catalog-extract and catalog-report skill scripts, and create the download link for the normalized Excel file.
```

{% endcode %}

Input Schema :

```
{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",		
  "properties": {
    "code": {
      "type": "string",
      "description": "The source code or code snippet to be processed"
    },
    "method": {
      "type": "string",
      "description": "The method or function name to be executed"
    },
    "Programming_language": {
      "type": "string",
      "description": "The programming language of the provided code"
    }
  },
  "required": ["code"]
}
```

Input Test Payload:

{% code overflow="wrap" %}

```
{"code": "import json\nresult = {'status': 'ok', 'value': round(55/8.0, 3)}\nprint(json.dumps(result))"}
```

{% endcode %}

3. Make sure Internet Access is enabled with Public internet access.
4. Click Test. The result should print `{"status": "ok", "value": 6.875}`. Then click Save.

### 1.4 Add the skills

1. Open the Skills tab, click Add new, and select Custom.
2. Search for **catalog-extract** and click Add. This skill reads the catalog, profiles its columns, and prepares the lines for the ERP load.
3. Follow the same step as before and Search for **catalog-report** and click Add. This skill builds the normalized Excel file and the HTML report.
4. make sure skills are at latest versions.

### 1.5 Test & Compare

1. Open the Test & Compare tab.
2. Select two models to compare: Claude Sonnet 5.5 and Claude Haiku 5.5.
3. Make sure prompt caching is enabled for each model.
4. Click Test.
5. After 1 to 2 minutes, the agent pauses with a proposed column mapping of 6 fields: supplier part number, unit price, description, unit of measure, currency, and effective date. Check it and approve it so the run continues. The rest of the run takes another 2 to 5 minutes.
6. Compare the outputs. Each should end with an HTML report showing Lines in catalog, Ready for ERP, Needs review, and Rejected, plus a Download normalized catalog (Excel) button. The Excel file has three sheets: Normalized, Exceptions, and Summary.
7. Click Select as best answer on the best output to set the Primary Model.
8. Optional: click Select as best answer on the other output to set the Fallback Model.
9. Click Save prompt run in the right corner.
10. Click Save, Reopen the CatalogSync Agent prompt then Publish.

Only published prompts are visible in the recipe, so do not skip Publish.

## Step 2: Create the Karini Recipe with Bedrock AgentCore Runtime

### 2.1 Create the recipe

1. From the left menu, open Recipes and click Add new in the top corner.
2. Configure the recipe:

| Field       | Value                                                                 |
| ----------- | --------------------------------------------------------------------- |
| Name        | catalogsync-workflow                                                  |
| Description | Normalizes supplier price catalogs and validates them against the ERP |
| Type        | Workflow                                                              |
| Runtime     | AgentCore                                                             |

### 2.2 Add and connect the nodes

Drag each element from Elements onto the canvas, Connect them in sequence as stated below then click it to fill in the right panel.

Connect them in a straight line: Chat → Start → CatalogSync Agent → End.

| # | Element    | Label             | Settings in the right panel                                                                                     |
| - | ---------- | ----------------- | --------------------------------------------------------------------------------------------------------------- |
| 1 | Chat       | Chat              | **Conversation history** - No History                                                                           |
| 2 | Start      | Start             | **None**                                                                                                        |
| 3 | Deep Agent | CatalogSync Agent | <p><strong>Prompt</strong> = CatalogSync Agent. 1) <strong>Document cache</strong> - Enable Checkbox</p><p></p> |
| 4 | End        | End               | **None**                                                                                                        |

### 2.3 Recipe settings, test, and deploy

1. Click an empty area of the canvas and set Number of state updates to 50.
2. Click Save, then reopen the **catalogsync-workflow** recipe and Publish.
3. Then Click on Action and Deploy the recipe.
4. For later versions, click Actions → Deploy after you publish.

{% embed url="<https://www.loom.com/share/e2c81e11298548ddaee36602dae9a5bb>" %}

## Step 3: Create the CatalogSync Copilot

Make sure catalogsync-workflow is published before you start.

1. On the recipe page, click Actions in the top right corner and select Create Copilot.
2. On the Copilots page, click Add new and fill in:

| Field           | Value                                                                                                                                                                          |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Copilot name    | CatalogSync                                                                                                                                                                    |
| Welcome message | I'm CatalogSync. Upload a supplier price catalog and I'll map its columns, validate every line against the ERP, and give you a normalized Excel file ready for the ERP update. |
| Description     | Maps, validates, and normalizes supplier price catalogs for the ERP                                                                                                            |
| Seed questions  | <p>Click on Add button and add <br> - Normalize this catalog</p>                                                                                                               |
| Error message   | Something went wrong while processing your catalog. Please try again, or contact your instructor.                                                                              |
| Feedback        | Thumbs up and thumbs down - Enable Checkbox, custom feedback on (To add custom feedback Click on Add Buttom and Give it name and type according to custom Feedback you need.)  |
| Show traces     | Enable Checkbox                                                                                                                                                                |

3. Click Save.

## Step 4: Test CatalogSync End to End

1. From the left menu, open Copilots and select CatalogSync.
2. Click the attachment icon and upload the test supplier catalog provided by instructor.
3. Type **Normalize this catalog** and send it.
4. When CatalogSync shows the proposed column mapping, check it and click Approve. Approve within a few minutes, In few minutes agent will generate the Normalized catalog Excel file for ERP stagging.&#x20;
5. When the report appears, click Download normalized catalog (Excel).
6. Verify the Sheets in Excel as Normalized, Exceptions and Summary.
