An open API service indexing awesome lists of open source software.

https://github.com/dsaikiran01/e-commerce-chat-assistant

AI Shopping Assistant built with LangGraph.js, MongoDB, and React. An intelligent agent that searches, reasons, and adapts like a real sales associate—powered by vector search, multi-turn memory, and dynamic tool use.
https://github.com/dsaikiran01/e-commerce-chat-assistant

agentic-ai gemini langgraph langgraph-js mern vector-search

Last synced: 10 months ago
JSON representation

AI Shopping Assistant built with LangGraph.js, MongoDB, and React. An intelligent agent that searches, reasons, and adapts like a real sales associate—powered by vector search, multi-turn memory, and dynamic tool use.

Awesome Lists containing this project

README

          

# 🤖 AI Shopping Assistant with LangGraph.js & MongoDB

![AI Agent](https://img.shields.io/badge/AI-Agent-blue?style=for-the-badge&logo=openai)
![LangGraph.js](https://img.shields.io/badge/LangGraph-JS-green?style=for-the-badge)
![MongoDB](https://img.shields.io/badge/MongoDB-Atlas-green?style=for-the-badge&logo=mongodb)
![React](https://img.shields.io/badge/React-Frontend-blue?style=for-the-badge&logo=react)

**An AI-powered shopping assistant that interacts, reasons, and adapts like a real sales associate.**

---

## 🎯 Overview

This project is an advanced **AI Agent** for e-commerce, designed using an **agentic architecture**. Unlike traditional chatbots, this agent:

- 🧠 **Thinks**: Determines the best course of action for a user's request
- 🔍 **Acts**: Searches product catalogs using semantic vector embeddings
- 🔄 **Adapts**: Falls back to keyword-based search if needed
- 💬 **Remembers**: Maintains context over long conversations

---

## 📽️ Demo

https://github.com/user-attachments/assets/1043b1d9-15c2-48fd-a4b5-d89daf41c0f3

---

## 🤔 Why Agentic AI?

| 🤖 Traditional Chatbot | 🧠 Agentic AI System |
| ---------------------- | ----------------------------- |
| Static replies | Autonomous decision-making |
| No real tools | Real-world API + search tools |
| Single-turn dialogs | Contextual, multi-turn memory |
| No learning | Adaptive and flexible |

---

## 📚 Topics

### 🧠 **Conceptual Knowledge**
- Agentic AI architectures
- LangGraph.js orchestration flows
- Vector-based search using MongoDB Atlas
- Multi-turn conversation design

### 🛠️ **Technical Skills**
- Node.js backend with REST APIs
- AI integrations (OpenAI, Gemini)
- React frontend with live AI chat
- Seeding and embedding product data

---

## 🚀 Prerequisites

### 📦 Software Requirements
- [Node.js](https://nodejs.org/) (v18+)
- Git & Terminal

### 🔐 API Access
- [Google AI API Key](https://aistudio.google.com/app/apikey)
- [MongoDB Atlas URI](https://www.mongodb.com/cloud/atlas)

---

## ⚡ Quick Start

### 1️⃣ Clone & Install Dependencies

```bash
git clone https://github.com/dsaikiran01/E-commerce-Chat-Assistant.git
cd E-commerce-Chat-Assistant/server
npm install
````

### 2️⃣ Setup Environment Variables

Create a `.env` file in the `/server` directory:

```env
PORT=8000
GOOGLE_API_KEY=your_google_api_key
MONGODB_ATLAS_URI=your_mongodb_uri
```

### 3️⃣ Seed the Database

```bash
npm run seed
```

🔍 What This Does

* Generates synthetic product data
* Embeds item descriptions for vector search
* Stores everything in MongoDB

### 4️⃣ Start the Backend

```bash
npm run dev
```

The backend will be running on `http://localhost:8000`.

---

## 🧪 Try the Agent

### Start a Conversation

```bash
curl -X POST http://localhost:8000/chat \
-H "Content-Type: application/json" \
-d '{"message": "I need a modern coffee table"}'
```

### Continue the Conversation

```bash
curl -X POST http://localhost:8000/chat/ \
-H "Content-Type: application/json" \
-d '{"message": "What's the price range?"}'
```

---

## 🖥️ Frontend Setup

### 5️⃣ Launch React Client

```bash
cd ../client
npm install
npm run start
```

Visit `http://localhost:3000` to start chatting with your AI shopping assistant.

---

## 🧩 Architecture Diagram

```mermaid
graph TD
A[User] --> B[LangGraph Agent]
B --> C{Decision Engine}
C -->|Search| D[Vector Search Tool]
C -->|Direct| E[Language Model Response]
D --> F[MongoDB Atlas]
F --> G[Search Results]
G --> E
E --> H[Final Response]
```

---

## 🌟 Features

| 🧠 Smart Decisions | 🔍 Search Intelligence | 💬 Conversational Memory |
| ------------------- | --------------------------- | ------------------------ |
| Dynamic tool usage | Vector + fallback search | Multi-turn support |
| Context-aware logic | Real-time inventory lookups | Persistent threads |
| Adaptive strategies | Semantic understanding | Human-like tone |

---

## 📡 API Reference

| Method | Endpoint | Description |
| ------ | ----------------- | ------------------------ |
| `GET` | `/` | Health check |
| `POST` | `/chat` | Start a new conversation |
| `POST` | `/chat/:threadId` | Continue a conversation |