# Chatbot for my e-commerce json data

> Source: <https://discuss.huggingface.co/t/chatbot-for-my-e-commerce-json-data/63954#post_4>
> Published: 2026-07-17 08:17:10+00:00

Hi there,

I have worked on a similar project recently, and I can tell you that passing raw JSON directly to an LLM usually doesn’t end well. The context window fills up too fast, and the model can easily get confused and start hallucinating prices or inventory levels.

The most reliable way I found to handle e-commerce store data is by building a simple RAG (Retrieval-Augmented Generation) pipeline. Here is a breakdown of how I usually set it up:

**1. Flatten your JSON data** Instead of feeding the model raw JSON brackets and keys, write a simple Python script to convert your product data into plain English sentences. For example, turn {“product”: “blue t-shirt”, “price”: “25”, “stock”: “15”} into “We have 15 blue t-shirts in stock, and the price is 25 dollars.” Models understand natural language much better than structured code.

**2. Create your embeddings** Use a framework like LangChain to take those text sentences and convert them into vector embeddings. You can use free, lightweight Hugging Face models (like all-MiniLM-L6-v2) for this part.

**3. Store in a Vector Database** Save these embeddings into a local, open-source vector database like FAISS or ChromaDB.

**4. Connect the Chatbot** When a user asks, “Do you have blue shirts under 30?”, your system will search ChromaDB, pull the exact sentence about the blue t-shirt, and hand it to your LLM. The LLM then uses that strict fact to answer the user conversationally.

The biggest challenge you will face later on is keeping this vector database synced with your live store inventory. If your stock levels change hundreds of times a day, building that real-time sync logic gets really heavy. When it reaches that scale, a lot of brands look into [shopify development services ](https://tkxel.com/services/shopify-development/)to handle the complex backend data routing. But if you are just building a proof of concept or have a catalog that doesn’t change every minute, the LangChain + ChromaDB setup will work perfectly for you.

Hope this gives you a solid starting point! Let me know if you get stuck on parsing the JSON files.
