-
Notifications
You must be signed in to change notification settings - Fork 395
feat: Add AI E-Commerce Cart Recovery Agent kit #285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JoduVyshnavi17
wants to merge
3
commits into
Lamatic:main
Choose a base branch
from
JoduVyshnavi17:agentkit-challenge-cart-recovery
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,4 @@ | ||
| **/.DS_Store | ||
|
|
||
| venv/ | ||
| .env | ||
| .claude | ||
| REFACTOR_PLAN.md | ||
| scripts | ||
| __pycache__/ | ||
| *.pyc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| LAMATIC_API_URL="YOUR_API_ENDPOINT" | ||
| LAMATIC_PROJECT_ID="YOUR_PROJECT_ID" | ||
| LAMATIC_API_KEY="YOUR_API_KEY" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .lamatic/ | ||
| node_modules/ | ||
| .env | ||
| .env.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,150 @@ | ||
| # AI E-Commerce Cart Recovery Agent | ||
|
|
||
| ## About This Kit | ||
|
|
||
| AI E-Commerce Cart Recovery Agent is a Lamatic AgentKit kit designed to help e-commerce businesses recover abandoned shopping carts using AI and retrieval-augmented generation (RAG). | ||
|
|
||
| The agent combines customer and cart context with indexed business knowledge to generate relevant and personalized cart-recovery responses. Business information such as product details, store policies, FAQs, and approved promotional offers can be indexed into a vector database and retrieved when generating a response. | ||
|
|
||
| The cart-recovery flow can analyze the available customer and cart context, estimate purchase intent, generate an appropriate recovery message, and recommend an approved offer when the supplied eligibility information allows it. | ||
|
|
||
| ## Workflow | ||
|
|
||
| Customer Cart / Chat Input | ||
| ↓ | ||
| Cart Recovery RAG Flow | ||
| ↓ | ||
| Retrieve Relevant Business Knowledge | ||
| ↓ | ||
| Generate Personalized Recovery Response | ||
|
|
||
| ## Supported Data Sources | ||
|
|
||
| The kit includes eight source-specific indexation flows: | ||
|
|
||
| 1. Google Drive | ||
| 2. Google Sheets | ||
| 3. Microsoft OneDrive | ||
| 4. PostgreSQL | ||
| 5. Amazon S3 | ||
| 6. SharePoint | ||
| 7. Web Crawling | ||
| 8. Web Scraping | ||
|
|
||
| These flows prepare content for retrieval by extracting source data, transforming or chunking it where required, generating vector embeddings, and indexing the resulting content and metadata into the configured vector database. | ||
|
|
||
| ## Cart Recovery Flow | ||
|
|
||
| The main runtime flow is: | ||
|
|
||
| `flows/cart-recovery.ts` | ||
|
|
||
| It receives the cart-recovery request, retrieves relevant indexed knowledge using the configured RAG node, and generates the response using the cart-recovery prompts. | ||
|
|
||
| The flow uses: | ||
|
|
||
| - `prompts/cart-recovery-system.md` — defines the agent's cart-recovery behavior and response rules. | ||
| - `prompts/cart-recovery-user.md` — supplies the user and cart context required for the recovery request. | ||
| - `model-configs/cart-recovery.ts` — contains the RAG model and retrieval configuration. | ||
| - `triggers/widgets/cart-recovery-chat-widget.ts` — configures the chat widget trigger. | ||
| - `constitutions/default.md` — contains shared behavioral instructions for the kit. | ||
|
|
||
| ## Project Structure | ||
|
|
||
| The kit contains: | ||
|
|
||
| - `flows/` — cart recovery and source-specific indexation flows. | ||
| - `scripts/` — extraction, chunking, and metadata transformation scripts used by the indexation flows. | ||
| - `prompts/` — system and user prompts for cart recovery. | ||
| - `model-configs/` — model and retrieval configuration. | ||
| - `triggers/widgets/` — chat widget configuration. | ||
| - `constitutions/` — shared agent instructions. | ||
| - `lamatic.config.ts` — kit configuration and flow selection metadata. | ||
| - `agent.md` — detailed architecture and usage documentation. | ||
| - `.env.example` — placeholder environment configuration. | ||
|
|
||
| ## Setup | ||
|
|
||
| 1. Import or configure the kit in your Lamatic workspace. | ||
| 2. Select one of the supported data-source indexation flows. | ||
| 3. Configure the required source credentials and private inputs. | ||
| 4. Configure the destination vector database. | ||
| 5. Run the selected indexation flow to populate the vector store. | ||
| 6. Configure the embedding and generative models required by the cart-recovery flow. | ||
| 7. Configure the Cart Recovery chat widget. | ||
| 8. Test the complete retrieval and response workflow before deployment. | ||
|
|
||
| ## Usage | ||
|
|
||
| First run the appropriate indexation flow for the business knowledge source. | ||
|
|
||
| For example, product documentation or store information may be indexed from Google Drive, Google Sheets, S3, PostgreSQL, SharePoint, OneDrive, or web content. | ||
|
|
||
| After the content has been indexed, use the `cart-recovery` flow as the runtime conversational layer. | ||
|
|
||
| The flow retrieves relevant business knowledge from the configured vector database and uses it together with the supplied cart context to generate a personalized recovery response. | ||
|
|
||
| ## Example Use Case | ||
|
|
||
| A customer adds products to a shopping cart but does not complete checkout. | ||
|
|
||
| The Cart Recovery Agent can use the supplied cart context and indexed business knowledge to: | ||
|
|
||
| - Understand the available cart and customer context. | ||
| - Retrieve relevant product or store information. | ||
| - Estimate the customer's purchase intent. | ||
| - Generate a personalized recovery message. | ||
| - Use promotional offers only when approved offer and eligibility information is supplied. | ||
| - Recommend an appropriate next action. | ||
|
|
||
| The agent should not invent coupon codes, discounts, or promotional eligibility that were not provided by the configured business data. | ||
|
|
||
| ## Security and Privacy | ||
|
|
||
| - Do not commit API keys, passwords, access tokens, or other credentials. | ||
| - Store credentials using the appropriate Lamatic integrations or environment configuration. | ||
| - `.env.example` must contain placeholder values only. | ||
| - Avoid sending customer information to unnecessary external services. | ||
| - Do not include unnecessary personally identifiable information in model prompts. | ||
| - Promotional recommendations should use only supplied and approved offer information. | ||
|
|
||
| ## Development | ||
|
|
||
| Before submitting changes, verify that the kit structure and configuration follow the AgentKit contribution requirements. | ||
|
|
||
| Check that: | ||
|
|
||
| - The cart-recovery flow matches the `cart-recovery` step configured in `lamatic.config.ts`. | ||
| - All referenced prompt, model-config, trigger, script, and flow files exist. | ||
| - No test webhooks, private URLs, credentials, or debug logging remain. | ||
| - Indexation flows preserve vector and metadata alignment. | ||
| - Documentation describes the files and behavior actually included in this kit. | ||
|
|
||
| ## Contributing | ||
|
|
||
| This kit is part of the Lamatic AgentKit ecosystem. | ||
|
|
||
| When contributing improvements: | ||
|
|
||
| 1. Make changes on a dedicated branch. | ||
| 2. Keep the contribution limited to this kit. | ||
| 3. Validate the project locally. | ||
| 4. Commit and push the changes to your fork. | ||
| 5. Update the existing pull request. | ||
| 6. Address GitHub Actions and CodeRabbit review comments before requesting another review. | ||
|
|
||
| ## Support | ||
|
|
||
| For questions or issues: | ||
|
|
||
| - Review the relevant flow and integration configuration. | ||
| - Check the Lamatic documentation. | ||
| - Review `agent.md` for detailed architecture and flow information. | ||
|
|
||
| ## Tags | ||
|
|
||
| AI, E-Commerce, Cart Recovery, RAG, AgentKit, Automation | ||
|
|
||
| --- | ||
|
|
||
| *AI E-Commerce Cart Recovery Agent for Lamatic AgentKit* | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Normalize the shared documentation encoding.
Both diagrams contain the same mojibake sequence (
↓) instead of arrows.kits/ai-ecommerce-cart-recovery-agent/README.md#L13-L19: replace the three corrupted workflow arrows with valid UTF-8 or ASCII markers.kits/ai-ecommerce-cart-recovery-agent/agent.md#L60-L74: replace the seven corrupted architecture arrows with valid UTF-8 or ASCII markers.🧰 Tools
🪛 LanguageTool
[grammar] ~19-~19: Ensure spelling is correct
Context: ...edge ↓ Generate Personalized Recovery Response ## Supported Data Sources The kit include...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
📍 Affects 2 files
kits/ai-ecommerce-cart-recovery-agent/README.md#L13-L19(this comment)kits/ai-ecommerce-cart-recovery-agent/agent.md#L60-L74🤖 Prompt for AI Agents