This API powers an AI-driven shopping assistant that thinks, adapts, and interacts like a human sales professional.
- 📘 Introduction
- ⚙️ Tech Stack
- ⭐ Features
- 🚀 Quick Start
- 📡 API Endpoints
- 📸 Demo
- 🔗 Links
- 📝 License
Smart E-commerce AI Agent API is a powerful, AI-driven shopping assistant designed to enhance the online shopping experience. It understands user queries and offers personalized recommendations using multi-step reasoning. Moreover, it interacts naturally with customers just like a human sales associate.
🧠 Intelligent Decision Making: The AI agent makes decisions autonomously, understands context, and performs multi-step reasoning to assist users effectively.
🔍 Advanced Search Capabilities: Provides accurate results using vector-based semantic search, and real-time inventory checks.
💬 Natural Conversations: Remembers past conversations, keeps thread-based context, and interacts naturally for a smooth user experience.
Prerequisites
Clone the repository
git clone https://github.com/Sumit-531/ecommerce-ai-agent.git
cd ecommerce-ai-agentInstallation
Install the project dependencies using npm:
npm installSet Up Environment Variables
Create a file named .env.local inside the /server directory and add the required environment variables as shown below:
# PORT
PORT=3001
# ENVIRONMENT
NODE_ENV=development
# DATABASE
DB_URI=
# GOOGLE
GOOGLE_API_KEY=Seed the Database
npm run seedRunning the Project
npm run devTest the API
After starting the server, the API will be accessible at: http://localhost:3001 Requests can be made through a web browser or any HTTP client (e.g., Insomnia, Postman) to verify the endpoints.
Base URL : http://localhost:3001/api/v1
| Method | Endpoint | Description | Example |
|---|---|---|---|
POST |
/chat |
Initiates a new conversation | Returns a new threadId along with the agent's response |
POST |
/chat/:threadId |
Continues an existing conversation | Returns a context-aware response based on conversation history |
Initial Chat Example
Example response returned by the API when sending a message to the Smart E-commerce AI Agent.
Product Inquiry Example
Example response returned by the API when asking about product variations.
Follow-up Chat Example
Example response returned by the API after a user thanks the Smart E-commerce AI Agent.
- Node.js - https://nodejs.org/en
- MongoDB - https://www.mongodb.com/
- LangGraph - https://www.langchain.com/langgraph
📝 License
This project is licensed under the MIT License. See the LICENSE file for full details.