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

# Restock recommendations

> Monitor stock levels daily and generate reorder suggestions before stockouts happen

Stockouts cost you sales. Overstock ties up cash and leads to markdowns. Most retail teams rely on weekly manual reviews or simple min/max thresholds that miss demand changes. By the time someone notices a problem, the shelf is already empty or the warehouse is already full.

Wayak connects your inventory and POS data, calculates days of supply based on actual sell-through rates, and runs a daily playbook that generates reorder recommendations for every SKU at every location. The agent factors in supplier lead times so you know not just what to order, but when the order needed to go out.

***

## What you need

<CardGroup cols={2}>
  <Card title="Data sources" icon="database">
    * **Inventory management system** — Stock levels table with SKU, location, quantity on hand, and quantity in transit
    * **POS database** — Transaction line items with SKU, quantity sold, date, and location
    * **Supplier database** — Supplier lead times, minimum order quantities, and cost per unit
  </Card>

  <Card title="Knowledge spaces" icon="book-open">
    * **Reorder policies** — Safety stock rules, target days of supply by category, and seasonal adjustment guidelines
    * **Vendor agreements** — Minimum order quantities, volume discount tiers, and delivery schedules
  </Card>
</CardGroup>

**Semantic layer:** Define these in your ontology before setting up the agent.

| Component | Name              | Definition                                                                                 |
| --------- | ----------------- | ------------------------------------------------------------------------------------------ |
| Object    | `SKU`             | Maps to the inventory SKU master table. Represents a unique product at a specific location |
| Object    | `Supplier`        | Maps to the supplier database. Represents a vendor with lead time and ordering constraints |
| Metric    | `DaysOfSupply`    | Current stock on hand divided by the trailing 14-day average daily sales rate              |
| Metric    | `SellThroughRate` | Units sold divided by units received over a given period, expressed as a percentage        |
| Dimension | `Category`        | Product categorization: apparel, electronics, home goods, grocery, seasonal                |

<Tip>
  See [building a semantic layer](/quickstart/build-semantic-layer) for a step-by-step guide.
</Tip>

***

## Agent setup

<Steps>
  <Step title="Create the agent">
    Go to **Agent Space** → **New agent**.

    | Field    | Value                                                   |
    | -------- | ------------------------------------------------------- |
    | **Name** | Inventory Analyst                                       |
    | **Role** | Stock and demand planning specialist                    |
    | **Goal** | Prevent stockouts and reduce overstock across locations |
  </Step>

  <Step title="Set the description">
    > You monitor inventory levels and demand signals. Lead with the data — show current stock levels, sell-through rates, and days of supply before making recommendations. Use concise, action-oriented language. When recommending reorders, specify quantities, supplier lead times, and expected delivery dates. Flag slow-moving inventory that may need markdowns. Never round numbers — precision matters in inventory management.
  </Step>

  <Step title="Scope data access">
    Grant access to:

    * Inventory management system (stock levels, receipts, transfers)
    * POS database (transaction line items)
    * Supplier database (lead times, order constraints)
    * Reorder policies knowledge space
    * Vendor agreements knowledge space
    * `SKU`, `Supplier` objects and `DaysOfSupply`, `SellThroughRate` metrics
  </Step>

  <Step title="Add skills">
    <AccordionGroup>
      <Accordion title="Generate restock recommendation">
        **Trigger:** Daily schedule or stock drops below safety threshold

        1. Pull current stock levels for all SKUs at the specified location (or all locations).
        2. Calculate days of supply for each SKU using the trailing 14-day average daily sales rate.
        3. Identify any SKU with fewer days of supply than the category safety threshold (default: 7 days).
        4. For each flagged SKU, calculate the recommended reorder quantity: target 30 days of supply minus current stock on hand minus quantity in transit.
        5. Retrieve the supplier lead time and minimum order quantity for each flagged SKU.
        6. Flag any SKU where the supplier lead time exceeds the remaining days of supply — these are urgent.
        7. Output a reorder table: SKU, location, current stock, days of supply, recommended order quantity, supplier, lead time, and urgency flag.
      </Accordion>

      <Accordion title="Identify overstock risks">
        **Trigger:** User asks about slow-moving inventory or weekly review

        1. Pull all SKUs with more than 60 days of supply based on the trailing 30-day sales rate.
        2. For each overstocked SKU, calculate the carrying cost (quantity x unit cost x daily holding cost rate).
        3. Check whether the SKU is seasonal and if the selling season is approaching or has passed.
        4. Rank by total carrying cost in descending order.
        5. Recommend an action for each: hold, transfer to a higher-demand location, markdown, or return to vendor.
      </Accordion>
    </AccordionGroup>
  </Step>
</Steps>

***

## Automation

### Playbook: Daily restock scan

<Steps>
  <Step title="Set the trigger">
    Schedule: **Daily at 6:00 AM** (runs before the store operations team starts their day).
  </Step>

  <Step title="Build the workflow">
    1. **Query** the inventory management system for current stock levels across all locations.
    2. **Query** the POS database for sales volume by SKU over the trailing 14 days.
    3. **Loop** through each SKU-location combination:
       * Calculate days of supply.
       * Compare against the category safety threshold.
       * If below threshold, calculate the recommended reorder quantity and check supplier lead time.
    4. **Condition:** If the supplier lead time exceeds remaining days of supply, mark the reorder as "critical."
    5. **Aggregate** results into two tables: critical reorders (need immediate action) and standard reorders (need action this week).
  </Step>

  <Step title="Configure delivery">
    Send an email to the inventory planning team with the subject line: "Daily restock report — \[date]". Critical reorders appear at the top in a highlighted section. Also send a Slack message to `#inventory-alerts` for any critical items.
  </Step>

  <Step title="Test and activate">
    Click **Run now** to test with live data, then toggle to **Active**.
  </Step>
</Steps>

***

## What's next

<CardGroup cols={2}>
  <Card title="Promotion performance" icon="arrow-right" href="/use-cases/retail/promotion-performance">
    Once your inventory is stable, measure whether your promotions are driving profitable demand.
  </Card>

  <Card title="All retail use cases" icon="list" href="/use-cases/retail">
    See the full list.
  </Card>
</CardGroup>
