add D2C Reorder Nudge Agent for subscription-free retention#104
add D2C Reorder Nudge Agent for subscription-free retention#104bhavya-ops21 wants to merge 2 commits intoLamatic:mainfrom
Conversation
Added README for the D2C Reorder Nudge Agent detailing its functionality, input/output formats, and technologies used.
Add README for D2C Reorder Nudge Agent
📝 WalkthroughWalkthroughA new README document has been added to the reorder-nudge-agent kit that documents the D2C Reorder Nudge Agent's purpose, operational flow, API request/response schemas, implementation technologies, and usage examples. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
kits/automation/reorder-nudge-agent/README.md (1)
27-33: Use a stable machine-readable date format in API output.
reorder_dateis shown as"Mon Mar 31 2026"while input uses ISO (YYYY-MM-DD). Consider returning ISO-8601 for downstream automation consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5c075adc-0437-4551-86e2-561470b5c897
📒 Files selected for processing (1)
kits/automation/reorder-nudge-agent/README.md
| # 🔁 D2C Reorder Nudge Agent | ||
|
|
||
| **Built for A_Mowglies** — a pre-launch D2C disposable underwear brand. | ||
|
|
||
| ## Problem Statement | ||
| D2C brands selling consumable/repeat-purchase products lose revenue when customers forget to reorder. There's no automated way to calculate when a customer will run out and send a personalized nudge — without a human in the loop. | ||
|
|
||
| ## What This Agent Does | ||
| 1. Takes customer purchase data as input (name, purchase date, quantity, daily usage) | ||
| 2. Calculates exactly when they'll run out of stock | ||
| 3. Generates a personalized WhatsApp reorder nudge via LLM | ||
| 4. Returns the message + reorder date instantly via API | ||
|
|
||
| ## Flow | ||
| API Request → Code (calculates restock date) → Generate Text (LLM nudge) → API Response | ||
|
|
||
| ## Input | ||
| ```json | ||
| { | ||
| "customer_name": "Priya", | ||
| "purchase_date": "2026-03-01", | ||
| "quantity": 30, | ||
| "daily_usage": 1 | ||
| } | ||
| ``` | ||
|
|
||
| ## Output | ||
| ```json | ||
| { | ||
| "message": "Hey Priya! Just a friendly reminder...", | ||
| "reorder_date": "Mon Mar 31 2026", | ||
| "days_remaining": 6 | ||
| } | ||
| ``` | ||
|
|
||
| ## Built With | ||
| - Lamatic.ai (flow builder + deployment) | ||
| - Google Gemini 2.5 Flash | ||
| - JavaScript (date calculation logic) | ||
|
|
||
| ## Use Case | ||
| Applicable to any high-repeat-purchase D2C brand — disposables, supplements, pet food, skincare etc. |
There was a problem hiding this comment.
Add missing Setup and Environment Variables sections.
This README explains flow and I/O, but it does not document installation/setup steps or required env vars, which makes kit onboarding incomplete.
📌 Suggested README patch
# 🔁 D2C Reorder Nudge Agent
@@
## Flow
API Request → Code (calculates restock date) → Generate Text (LLM nudge) → API Response
+
+## Setup
+1. Import this kit into your Lamatic workspace.
+2. Configure the `agent.json` workflow in your project.
+3. Connect your outbound channel integration (e.g., WhatsApp/SMS provider, Klaviyo).
+4. Test with sample payloads from the **Input** section below.
+
+## Environment Variables
+Document and configure the required secrets before deployment:
+
+```bash
+GEMINI_API_KEY=<your_google_ai_api_key>
+LAMATIC_API_KEY=<your_lamatic_api_key_if_required>
+WHATSAPP_API_TOKEN=<token_if_whatsapp_delivery_is_enabled>
+KLAVIYO_API_KEY=<key_if_klaviyo_sync_is_enabled>
+```
+
+> Keep only the variables your workflow actually uses, and remove unused entries.As per coding guidelines, kits/**/README.md: Every kit must have a README.md that documents setup, environment variables, and usage.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # 🔁 D2C Reorder Nudge Agent | |
| **Built for A_Mowglies** — a pre-launch D2C disposable underwear brand. | |
| ## Problem Statement | |
| D2C brands selling consumable/repeat-purchase products lose revenue when customers forget to reorder. There's no automated way to calculate when a customer will run out and send a personalized nudge — without a human in the loop. | |
| ## What This Agent Does | |
| 1. Takes customer purchase data as input (name, purchase date, quantity, daily usage) | |
| 2. Calculates exactly when they'll run out of stock | |
| 3. Generates a personalized WhatsApp reorder nudge via LLM | |
| 4. Returns the message + reorder date instantly via API | |
| ## Flow | |
| API Request → Code (calculates restock date) → Generate Text (LLM nudge) → API Response | |
| ## Input | |
| ```json | |
| { | |
| "customer_name": "Priya", | |
| "purchase_date": "2026-03-01", | |
| "quantity": 30, | |
| "daily_usage": 1 | |
| } | |
| ``` | |
| ## Output | |
| ```json | |
| { | |
| "message": "Hey Priya! Just a friendly reminder...", | |
| "reorder_date": "Mon Mar 31 2026", | |
| "days_remaining": 6 | |
| } | |
| ``` | |
| ## Built With | |
| - Lamatic.ai (flow builder + deployment) | |
| - Google Gemini 2.5 Flash | |
| - JavaScript (date calculation logic) | |
| ## Use Case | |
| Applicable to any high-repeat-purchase D2C brand — disposables, supplements, pet food, skincare etc. | |
| # 🔁 D2C Reorder Nudge Agent | |
| **Built for A_Mowglies** — a pre-launch D2C disposable underwear brand. | |
| ## Problem Statement | |
| D2C brands selling consumable/repeat-purchase products lose revenue when customers forget to reorder. There's no automated way to calculate when a customer will run out and send a personalized nudge — without a human in the loop. | |
| ## What This Agent Does | |
| 1. Takes customer purchase data as input (name, purchase date, quantity, daily usage) | |
| 2. Calculates exactly when they'll run out of stock | |
| 3. Generates a personalized WhatsApp reorder nudge via LLM | |
| 4. Returns the message + reorder date instantly via API | |
| ## Flow | |
| API Request → Code (calculates restock date) → Generate Text (LLM nudge) → API Response | |
| ## Setup | |
| 1. Import this kit into your Lamatic workspace. | |
| 2. Configure the `agent.json` workflow in your project. | |
| 3. Connect your outbound channel integration (e.g., WhatsApp/SMS provider, Klaviyo). | |
| 4. Test with sample payloads from the **Input** section below. | |
| ## Environment Variables | |
| Document and configure the required secrets before deployment: | |
Description
This PR adds the D2C Reorder Nudge Agent, built for A_Mowglies .
The agent solves a major pain point for repeat-purchase D2C brands: Revenue leakage due to forgotten reorders. It automates the calculation of a customer's "stock-out" date and generates a personalized WhatsApp/SMS nudge without requiring a subscription model.
Features
purchase_dateanddaily_usage.Tech Stack
Changes
d2c-reorder-nudgeexample folder.agent.jsonworkflow configuration.Verification
kits/automation/reorder-nudge-agent/kit with documentation