<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: S M ASIF ANAM</title>
    <description>The latest articles on DEV Community by S M ASIF ANAM (@asifanam4).</description>
    <link>https://dev.to/asifanam4</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4087086%2Fcfb57ff6-869e-4c26-a8ef-6513033d9856.jpg</url>
      <title>DEV Community: S M ASIF ANAM</title>
      <link>https://dev.to/asifanam4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asifanam4"/>
    <language>en</language>
    <item>
      <title>Building TonuAI: A Fast AI System for E-Commerce</title>
      <dc:creator>S M ASIF ANAM</dc:creator>
      <pubDate>Thu, 20 Aug 2026 18:22:18 +0000</pubDate>
      <link>https://dev.to/asifanam4/building-tonuai-a-fast-ai-system-for-e-commerce-2bjo</link>
      <guid>https://dev.to/asifanam4/building-tonuai-a-fast-ai-system-for-e-commerce-2bjo</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When building conversational AI for an e-commerce platform, a major challenge is connecting product data with natural customer questions. This becomes even more challenging when users communicate in &lt;strong&gt;Bangla, Banglish, and English&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I designed &lt;strong&gt;TonuAI&lt;/strong&gt;, a specialized conversational AI system for &lt;strong&gt;Tonu's Shop&lt;/strong&gt;, a skincare e-commerce platform in Bangladesh. The system combines automated product-data processing, multilingual keyword retrieval, multi-intent query handling, and a conversational AI layer.&lt;/p&gt;

&lt;p&gt;The goal was simple: allow customers to ask natural questions about skincare products and receive relevant recommendations quickly.&lt;/p&gt;

&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;p&gt;TonuAI is divided into two main layers:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Data Processing Layer
&lt;/h3&gt;

&lt;p&gt;The Python-based pipeline collects and combines information from multiple sources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Product descriptions&lt;/li&gt;
&lt;li&gt;SEO content&lt;/li&gt;
&lt;li&gt;Product specifications&lt;/li&gt;
&lt;li&gt;MySQL database data&lt;/li&gt;
&lt;li&gt;Product prices and stock&lt;/li&gt;
&lt;li&gt;Product images&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The pipeline converts these different sources into a unified product database that can be used by the AI application.&lt;/p&gt;

&lt;p&gt;One challenge was that product information was not always stored in the same format. To solve this, I implemented normalization and matching logic using product names, slugs, tokens, and brand information.&lt;/p&gt;

&lt;p&gt;A brand protection rule was also added to prevent incorrect matching between products from different brands.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. RAG and Application Layer
&lt;/h2&gt;

&lt;p&gt;The application layer uses Next.js and a custom retrieval system.&lt;/p&gt;

&lt;p&gt;Instead of depending entirely on vector embeddings, TonuAI uses a lightweight &lt;strong&gt;multilingual keyword-scoring approach&lt;/strong&gt; for product retrieval.&lt;/p&gt;

&lt;p&gt;The scoring system considers several factors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;SCORE_WEIGHTS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;BRAND_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;SKIN_TYPE_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;CATEGORY_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;CONCERN_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;NAME_WORD_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;INGREDIENT_MATCH&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This approach works particularly well for a relatively structured e-commerce catalog where product names, brands, ingredients, categories, and skin concerns are known in advance.&lt;/p&gt;

&lt;p&gt;It also reduces the processing overhead associated with embedding-based retrieval for simple product searches.&lt;/p&gt;

&lt;h2&gt;
  
  
  Handling Bangla, Banglish and English
&lt;/h2&gt;

&lt;p&gt;A major requirement was supporting how customers actually communicate.&lt;/p&gt;

&lt;p&gt;For example, users may ask:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Oily skin er jonno kon cleanser ta valo?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"তৈলাক্ত ত্বকের জন্য কোন cleanser ভালো?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;or:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Which cleanser is good for oily skin?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The retrieval system maps relevant terms across &lt;strong&gt;Bangla, Banglish, and English&lt;/strong&gt; and uses them to identify relevant products.&lt;/p&gt;

&lt;p&gt;This makes the system more practical for a Bangladeshi e-commerce environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Multi-Intent Queries
&lt;/h2&gt;

&lt;p&gt;Customers do not always ask one question at a time.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Which cleanser is good for oily skin, how much is it, and do you deliver to Chittagong?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This contains multiple intents:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Product recommendation&lt;/li&gt;
&lt;li&gt;Price information&lt;/li&gt;
&lt;li&gt;Delivery information&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;TonuAI separates these intents before retrieving the relevant information.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;splitIntoSegments()&lt;/code&gt; component breaks the original message into smaller intent segments, allowing each part of the request to be processed independently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automated Product Matching
&lt;/h2&gt;

&lt;p&gt;Another interesting part of the project was combining structured and unstructured product information.&lt;/p&gt;

&lt;p&gt;The system processes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Markdown product documentation&lt;/li&gt;
&lt;li&gt;SEO content&lt;/li&gt;
&lt;li&gt;MySQL data&lt;/li&gt;
&lt;li&gt;Product images&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A matching process combines these sources into a single product record.&lt;/p&gt;

&lt;p&gt;For image matching, additional rules were implemented to prevent incorrect product-form matches. For example, a serum image should not accidentally be assigned to a cream simply because their product names contain similar words.&lt;/p&gt;

&lt;p&gt;Duplicate images are also detected using file hashes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conversational AI
&lt;/h2&gt;

&lt;p&gt;The AI assistant, &lt;strong&gt;Ira (ঈরা)&lt;/strong&gt;, is designed specifically for Bangladeshi skincare customers.&lt;/p&gt;

&lt;p&gt;It communicates primarily in conversational Bangla while also understanding Banglish and English.&lt;/p&gt;

&lt;p&gt;The system is restricted to skincare-related conversations so that it can remain focused on its intended purpose rather than behaving like a general-purpose chatbot.&lt;/p&gt;

&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;The current system contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;55+ verified products&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;30+ mapped product images&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Bangla, Banglish and English support&lt;/li&gt;
&lt;li&gt;Automated product-data processing&lt;/li&gt;
&lt;li&gt;Multi-intent query handling&lt;/li&gt;
&lt;li&gt;Real-time admin support session tracking&lt;/li&gt;
&lt;li&gt;Fast keyword-based product retrieval&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The optimized retrieval layer can return product candidates in &lt;strong&gt;under 5ms&lt;/strong&gt; in the tested environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;The biggest lesson from this project is that a RAG system does not always need to be complicated.&lt;/p&gt;

&lt;p&gt;For a structured domain such as e-commerce, combining &lt;strong&gt;good data processing, domain-specific retrieval rules, multilingual normalization, and an LLM&lt;/strong&gt; can produce a fast and practical system.&lt;/p&gt;

&lt;p&gt;The architecture can also be extended later with vector search or hybrid retrieval when the knowledge base becomes larger or more unstructured.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqu0ohvc8yzwcclt8lxfo.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqu0ohvc8yzwcclt8lxfo.PNG" alt="Demo" width="799" height="372"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;TonuAI is an example of building a domain-specific AI system around the actual requirements of a regional market.&lt;/p&gt;

&lt;p&gt;Instead of treating Bangla as an additional language layer, the system was designed around the way Bangladeshi customers naturally communicate — including Bangla, Banglish, and English.&lt;/p&gt;

&lt;p&gt;The project demonstrates how &lt;strong&gt;domain-specific RAG, automated data processing, and multilingual conversational AI&lt;/strong&gt; can be combined to build practical e-commerce AI applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; &lt;a href="https://ira.tonusshop.com/" rel="noopener noreferrer"&gt;ira.tonusshop.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Author:&lt;/strong&gt; S M ASIF ANAM&lt;br&gt;
Master System Architect &amp;amp; AI Researcher&lt;br&gt;
Specializing in AI systems, IoT, cybersecurity, local LLMs, and enterprise software architecture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/asif-anam-82b617b7" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://anam.pro.bd" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>llm</category>
      <category>rag</category>
    </item>
  </channel>
</rss>
