Skip to content

Gustaavo-404/blip-llm-webhook-bot

Repository files navigation

AI Retail Chatbot (Node.js + RAG + Semantic Search + BLiP Integration)

An intelligent retail support chatbot built with Node.js, Express, semantic search, and embeddings.

The chatbot can be integrated with platforms such as BLiP through a webhook, allowing it to answer customer questions about products using natural language.


✨ Features

  • Semantic product search using embeddings
  • Natural language responses generated by an LLM
  • Product catalog stored in a JSON dataset
  • Webhook integration for chatbot platforms (BLiP)
  • Simple and scalable Node.js + Express API
  • Retrieval-Augmented Generation (RAG) architecture
  • Conversation memory per user
  • Intent detection for routing messages

💬 Example Conversation

User:
Do you have a white men's t-shirt?

Bot:
Yes! We have a white cotton men's t-shirt available for $49.90.

🔄 Architecture

The chatbot uses a simplified RAG (Retrieval-Augmented Generation) pipeline:

  1. The user sends a message
  2. The message arrives at the webhook
  3. The message is converted into an embedding
  4. The system searches for the most relevant products
  5. The relevant products are used as context
  6. The LLM generates a natural response
  7. The response is returned to the user

Architecture


📁 Project Structure

blip-llm-webhook-bot/
│
├── data/
│   └── products.json
│
├── services/
│   └── productSearch.js
│
├── scripts/
│   └── generateEmbeddings.js
│
├── routes/
│   └── webhook.js
│
├── app.js
└── package.json

📦 Product Dataset

Products are stored in a JSON file.

Example:

{
  "id": 1,
  "name": "White Men's T-Shirt",
  "price": 49.90,
  "description": "Basic cotton t-shirt"
}

⚠️ Note: Whenever new products are added, embeddings should be regenerated.


🚀 Installation

Clone the repository:

git clone https://github.com/Gustaavo-404/blip-llm-webhook-bot

Enter the project folder:

cd blip-llm-webhook-bot

Install dependencies:

npm install

🔐 Environment Variables

Create a .env file in the root directory:

PORT=3000
GITHUB_TOKEN=your_api_key_here
MODEL=your_llm_model_name_here

🧠 Generating Embeddings

Whenever the product dataset changes, run:

node scripts/generateEmbeddings.js

This generates the embeddings used for semantic search.


▶️ Running the Server

npm start

The server will start at:

http://localhost:3000

🌐 Webhook Endpoint

POST /webhook

Example request:

{
  "from": "user123",
  "content": "Do you have a white men's t-shirt?"
}

Example response:

{
  "reply": "Yes! We have a white cotton men's t-shirt available for $49.90."
}

🛠️ Technologies

  • Node.js – Runtime environment
  • Express – Web framework
  • Transformers.js – Local embedding generation
  • Semantic Search – Product relevance matching
  • RAG Architecture – Context-aware responses
  • BLiP Chatbot Integration – Platform connectivity

📈 Possible Improvements

  • Vector database (Pinecone, Weaviate, Supabase)
  • Product catalog connected to a real database
  • Product recommendation system
  • Multi-language support
  • Analytics dashboard

👨‍💻 Author

Gustavo Dev
Systems Analysis and Development – FATEC


📝 Note: This project is designed to be easily deployable and customizable for different retail scenarios.

About

AI-powered retail chatbot using RAG, semantic search and embeddings to retrieve product information and generate natural language responses. Built with Node.js and integrated with BLiP via webhook.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors