This project simulates a sales call between an AI sales agent (Sara) and a customer (John) who abandoned a shirt in their shopping cart. The AI interacts with the customer to complete the purchase, and a supervisor agent evaluates the conversation at the end to determine the next steps.
- AI-powered sales agent (Sara) that engages with the customer.
- Customer intent detection using a language model.
- Supervisor agent that analyzes the conversation after it ends.
- Automatic handling of objections:
- Price concerns → 10% discount.
- Shipping concerns → Free shipping.
- Quality concerns → Free returns.
- Completed purchase → Send cart link.
- Conversation timeout after 5 minutes.
- Python 3.x
requests
library- Local instance of an LLM API (e.g., DeepSeek) running at
http://localhost:1234
- Clone this repository:
git clone https://github.com/asantosca/dual-agent-sales.git cd dual-agent-sales
- Install dependencies:
pip install requests
- Run the script:
python abandoned_cart.py
- The sales agent (Sara) calls the customer and engages in a natural conversation.
- Sara responds to objections and tries to close the sale.
- If the customer says "goodbye" or 5 minutes pass, the conversation ends.
- The supervisor agent analyzes the conversation and determines:
- Whether to send an email with the cart link.
- Whether a discount, free shipping, or free returns were applied.
- Whether the customer abandoned the cart.
- The final action is printed to the console.
Hi John, this is Sara from ShirtsAndBelts. I noticed you left a blue medium shirt in your cart. Is there anything I can help you with?
John: It's too expensive.
Sara: I understand! I can offer you a 10% discount. Would that help?
John: Yes, that works.
Sara: Great! I’ll send a link to your email to complete the purchase.
Supervisor: Sending email with cart link.