<?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: venkata narasimha bhaskar divi</title>
    <description>The latest articles on DEV Community by venkata narasimha bhaskar divi (@bhaskar359).</description>
    <link>https://dev.to/bhaskar359</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%2F752549%2Ffa39a28c-d6b9-4fb6-8748-bbb2526d2151.jpg</url>
      <title>DEV Community: venkata narasimha bhaskar divi</title>
      <link>https://dev.to/bhaskar359</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bhaskar359"/>
    <language>en</language>
    <item>
      <title>I Built an AI Saree Search Engine for My Uncle's Local Business</title>
      <dc:creator>venkata narasimha bhaskar divi</dc:creator>
      <pubDate>Sun, 04 Oct 2026 18:30:06 +0000</pubDate>
      <link>https://dev.to/bhaskar359/i-built-an-ai-saree-search-engine-for-my-uncles-local-business-5f3h</link>
      <guid>https://dev.to/bhaskar359/i-built-an-ai-saree-search-engine-for-my-uncles-local-business-5f3h</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-weekend-2026-10-01"&gt;Hacktoberfest Weekend Challenge: Build for a Friend&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

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

&lt;p&gt;My uncle runs a local saree business, and I wanted to build something that could actually help him rather than building another generic AI chatbot.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Saree Saathi AI&lt;/strong&gt; — an AI-powered natural-language saree search and recommendation system.&lt;/p&gt;

&lt;p&gt;The idea is simple:&lt;/p&gt;

&lt;p&gt;Instead of asking customers to understand product categories and manually select filters like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Fabric: Silk
Occasion: Wedding
Price: &amp;lt; ₹7000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;they can simply say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"I need a traditional silk saree for a wedding under ₹7000."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The system understands the request, searches the catalog semantically, applies exact business constraints, and generates a recommendation based only on the sarees that were actually retrieved.&lt;/p&gt;

&lt;h3&gt;
  
  
  The problem
&lt;/h3&gt;

&lt;p&gt;A small local saree business can have a large and diverse catalog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Mangalagiri&lt;/li&gt;
&lt;li&gt;Uppada&lt;/li&gt;
&lt;li&gt;Pochampally&lt;/li&gt;
&lt;li&gt;Kanchipuram&lt;/li&gt;
&lt;li&gt;Dharmavaram&lt;/li&gt;
&lt;li&gt;Banarasi&lt;/li&gt;
&lt;li&gt;Paithani&lt;/li&gt;
&lt;li&gt;Cotton&lt;/li&gt;
&lt;li&gt;Silk&lt;/li&gt;
&lt;li&gt;Silk Cotton&lt;/li&gt;
&lt;li&gt;Different colors, occasions and price ranges&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Traditional search doesn't capture the way people actually describe what they want.&lt;/p&gt;

&lt;p&gt;Someone might say:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I want something elegant for my sister's wedding, preferably silk, but I don't want to spend more than ₹7000."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That contains &lt;strong&gt;intent, semantics and hard constraints&lt;/strong&gt; mixed together.&lt;/p&gt;

&lt;p&gt;That's the problem I wanted to solve.&lt;/p&gt;




&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;The project currently runs locally because the AI stack uses &lt;strong&gt;Ollama&lt;/strong&gt; for local Gemma inference.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example
&lt;/h3&gt;

&lt;p&gt;Request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-X&lt;/span&gt; POST http://localhost:3000/api/search &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-H&lt;/span&gt; &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
  &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="s1"&gt;'{"query":"Show me a cotton saree for office under ₹3000"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The system understands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"semanticQuery"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"cotton saree for office"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"maxPrice"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It also extracts the deterministic constraint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fabric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Cotton"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then MongoDB Atlas Vector Search finds relevant products while enforcing the price and availability constraints.&lt;/p&gt;

&lt;p&gt;Example results included:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Mangalagiri Cotton Saree       ₹1800
Mangalagiri Cotton Saree       ₹2200
Pochampally Ikat Cotton Saree  ₹2400
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the final recommendation is generated from those retrieved products.&lt;/p&gt;

&lt;p&gt;The complete local setup and API instructions are available in the repository README.&lt;/p&gt;




&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;The project is open source:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;code&gt;https://github.com/bhaskar359/saree-saathi-ai&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The repository contains the complete backend implementation, sample catalog, embedding pipeline, MongoDB integration, AI orchestration and local setup instructions.&lt;/p&gt;

&lt;p&gt;The main architecture is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;src/
├── ai-search.js
├── embedding.js
├── query-understanding.js
├── query-constraints.js
├── server.js
│
├── controllers/
│   └── search-controller.js
│
├── errors/
│   └── AppError.js
│
├── middleware/
│   ├── validate-search.js
│   └── error-handler.js
│
├── routes/
│   └── search.js
│
├── services/
│   ├── saree-search.js
│   └── recommendation.js
│
└── utils/
    ├── format-search-result.js
    └── with-timeout.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;p&gt;The interesting part of this project isn't just "I used an LLM."&lt;/p&gt;

&lt;p&gt;I wanted the system to demonstrate how several AI techniques can work together.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Natural-language understanding
&lt;/h3&gt;

&lt;p&gt;I use &lt;strong&gt;Gemma 3 1B through Ollama&lt;/strong&gt; to understand the user's request.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"I need a traditional silk saree for a wedding under ₹7000"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"semanticQuery"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"traditional silk saree for a wedding"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"maxPrice"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7000&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The LLM is used for &lt;strong&gt;language understanding&lt;/strong&gt;, not for constructing arbitrary database queries.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Deterministic constraints
&lt;/h3&gt;

&lt;p&gt;This was one of the most important architectural decisions.&lt;/p&gt;

&lt;p&gt;I initially experimented with allowing the LLM to extract things such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fabric
state
price
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But LLMs can hallucinate structured values.&lt;/p&gt;

&lt;p&gt;For example, if a user says:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"I want something beautiful from Andhra Pradesh"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;we don't want the model randomly deciding:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fabric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Silk"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the architecture became:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             User Query
                 │
        ┌────────┴────────┐
        ▼                 ▼
      Gemma          Application Code
        │                 │
        ▼                 ▼
 Semantic meaning    Hard constraints
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In other words:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;LLM for meaning. Application code for rules.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This makes the search pipeline considerably more predictable.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Semantic embeddings
&lt;/h3&gt;

&lt;p&gt;For semantic search I use:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;Xenova/all-MiniLM-L6-v2&lt;/code&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The model converts text into &lt;strong&gt;384-dimensional embeddings&lt;/strong&gt;.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Traditional silk saree suitable for a wedding
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Elegant silk saree for a marriage ceremony
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;have very similar semantic representations even though they don't use exactly the same words.&lt;/p&gt;

&lt;p&gt;This lets the system search by &lt;strong&gt;meaning rather than keyword matching&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. MongoDB Atlas Vector Search
&lt;/h3&gt;

&lt;p&gt;The embeddings are stored alongside the saree catalog in MongoDB Atlas.&lt;/p&gt;

&lt;p&gt;Conceptually:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SAR003"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Uppada Jamdani Silk Saree"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"state"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Andhra Pradesh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fabric"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Silk"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"price"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"available"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"embedding"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;384&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="err"&gt;dimensions...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The MongoDB vector index uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;384 dimensions
cosine similarity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But this is where another important lesson appeared.&lt;/p&gt;




&lt;h3&gt;
  
  
  5. Why vector search alone wasn't enough
&lt;/h3&gt;

&lt;p&gt;Suppose someone asks:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Silk saree under ₹7000."&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Vector search understands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;silk
saree
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the semantic intent.&lt;/p&gt;

&lt;p&gt;But vector similarity isn't the right mechanism for enforcing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;price &amp;lt;= 7000
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A ₹15,000 saree could still be semantically very similar to the query.&lt;/p&gt;

&lt;p&gt;So I combined vector search with structured MongoDB filters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;             Query
               │
       ┌───────┴────────┐
       ▼                ▼
Semantic Search     Hard Filters
       │                │
       │        price &amp;lt;= ₹7000
       │        fabric = Silk
       │        available = true
       │
       └────────┬───────┘
                ▼
          Hybrid Search
                │
                ▼
        Relevant Sarees
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This became one of the core architectural principles of Saree Saathi AI.&lt;/p&gt;




&lt;h3&gt;
  
  
  6. Grounded RAG recommendations
&lt;/h3&gt;

&lt;p&gt;After retrieving the relevant sarees, I use Gemma again to generate the final recommendation.&lt;/p&gt;

&lt;p&gt;But the model receives the retrieved catalog information as context.&lt;/p&gt;

&lt;p&gt;It is explicitly instructed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Don't invent prices.&lt;/li&gt;
&lt;li&gt;Don't invent fabrics.&lt;/li&gt;
&lt;li&gt;Don't invent colors.&lt;/li&gt;
&lt;li&gt;Don't invent availability.&lt;/li&gt;
&lt;li&gt;Don't invent reviews.&lt;/li&gt;
&lt;li&gt;Don't recommend products that weren't retrieved.&lt;/li&gt;
&lt;li&gt;Use the catalog as the source of truth.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So the flow is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Query
    +
Retrieved Catalog
    ↓
   Gemma
    ↓
Grounded Recommendation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I recommend the Mangalagiri Cotton Saree (SAR001).

It's priced at ₹1800 and is suitable for office wear.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The recommendation is grounded in the actual catalog record.&lt;/p&gt;




&lt;h3&gt;
  
  
  7. REST API
&lt;/h3&gt;

&lt;p&gt;I wrapped the AI pipeline behind an Express API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /api/search
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /health
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request validation layer handles things such as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;missing query
wrong data type
empty query
excessively long query
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;response formatting&lt;/li&gt;
&lt;li&gt;centralized error handling&lt;/li&gt;
&lt;li&gt;AI timeout protection&lt;/li&gt;
&lt;li&gt;environment-based configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal was to keep the AI logic from becoming one giant API handler.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Architecture
&lt;/h2&gt;

&lt;p&gt;The complete pipeline looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                     User
                      │
                      ▼
              Natural Language
                      │
                      ▼
               Express API
                      │
                      ▼
              Request Validation
                      │
          ┌───────────┴───────────┐
          │                       │
          ▼                       ▼
       Gemma                Deterministic
          │                   Constraints
          ▼                       │
    Semantic Query                │
          │                       │
          ▼                       │
     MiniLM Embedding             │
          │                       │
          ▼                       │
    Query Vector                  │
          │                       │
          └───────────┬───────────┘
                      ▼
             MongoDB Atlas
             Vector Search
                      │
                      ▼
              Relevant Sarees
                      │
                      ▼
                  RAG + Gemma
                      │
                      ▼
             Grounded Recommendation
                      │
                      ▼
                 API Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;This project is especially interesting to me because I didn't want to build it around a black-box AI API and stop there.&lt;/p&gt;

&lt;p&gt;Using open and locally runnable AI components allowed me to experiment with the entire pipeline.&lt;/p&gt;

&lt;h3&gt;
  
  
  Local inference
&lt;/h3&gt;

&lt;p&gt;With Ollama and Gemma, I can run the LLM locally.&lt;/p&gt;

&lt;p&gt;That means I can experiment without sending every development query to a hosted API.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open embedding model
&lt;/h3&gt;

&lt;p&gt;The embedding pipeline uses:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Xenova/all-MiniLM-L6-v2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This gives me direct control over the embedding process instead of treating embeddings as an invisible API operation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Replaceable architecture
&lt;/h3&gt;

&lt;p&gt;The project is intentionally designed so that the AI components can evolve.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current:
Gemma + MiniLM
       ↓
Future:
Another open-weight LLM
       +
Another embedding model
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The application architecture doesn't need to be rewritten.&lt;/p&gt;

&lt;p&gt;That's one of the biggest things I learned from building this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Open AI isn't just about having access to a model. It's about being able to understand, experiment with, replace and control the pieces of the system.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  My Agent Session
&lt;/h2&gt;

&lt;p&gt;I decided not to include a DevRelay Agent Session for this submission.&lt;/p&gt;

&lt;p&gt;The project was developed iteratively with &lt;strong&gt;ChatGPT&lt;/strong&gt;, including the architecture decisions, model experiments, debugging, implementation and refinement.&lt;/p&gt;

&lt;p&gt;Rather than presenting a different tool as the development agent, I'm keeping that part transparent.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🍃 MongoDB Atlas
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Saree Saathi AI uses MongoDB Atlas Vector Search as a core part of its architecture.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;MongoDB stores:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Saree catalog data&lt;/li&gt;
&lt;li&gt;Embeddings&lt;/li&gt;
&lt;li&gt;Structured metadata&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and performs the hybrid retrieval using vector similarity plus metadata filters.&lt;/p&gt;

&lt;p&gt;The project would therefore not just be using MongoDB as a conventional database—the &lt;strong&gt;vector search capability is fundamental to the AI search pipeline&lt;/strong&gt;.&lt;/p&gt;




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

&lt;p&gt;This project taught me that building an AI application isn't simply:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User → LLM → Answer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A useful production-oriented AI system often looks more like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
 ↓
Validation
 ↓
Query Understanding
 ↓
Structured Constraints
 ↓
Embeddings
 ↓
Vector Retrieval
 ↓
Metadata Filtering
 ↓
Grounded Context
 ↓
LLM
 ↓
Validated Response
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most valuable lesson was knowing &lt;strong&gt;where not to use an LLM&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Prices, availability, database operators and business rules don't need creativity.&lt;/p&gt;

&lt;p&gt;They need determinism.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;The current version is intentionally focused on the backend AI/search pipeline.&lt;/p&gt;

&lt;p&gt;Future improvements include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automated Jest test suite&lt;/li&gt;
&lt;li&gt;API documentation&lt;/li&gt;
&lt;li&gt;Rate limiting&lt;/li&gt;
&lt;li&gt;Structured logging&lt;/li&gt;
&lt;li&gt;Search latency metrics&lt;/li&gt;
&lt;li&gt;Multilingual/Telugu search&lt;/li&gt;
&lt;li&gt;Image-based saree search&lt;/li&gt;
&lt;li&gt;Saree image embeddings&lt;/li&gt;
&lt;li&gt;Better retrieval evaluation&lt;/li&gt;
&lt;li&gt;Re-ranking&lt;/li&gt;
&lt;li&gt;Conversation-aware search&lt;/li&gt;
&lt;li&gt;Admin catalog management&lt;/li&gt;
&lt;li&gt;Frontend experience&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Eventually, I'd like to turn this into something my uncle could actually use with his real inventory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;The project is designed to run locally with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Node.js
MongoDB Atlas
Ollama
Gemma 3 1B
all-MiniLM-L6-v2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The complete setup instructions, MongoDB Vector Search configuration, environment variables and API examples are available in the repository README.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;code&gt;https://github.com/bhaskar359/saree-saathi-ai&lt;/code&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;I started this project with a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Can I build something useful for someone close to me instead of building another tutorial project?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That question turned into an exploration of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;embeddings&lt;/li&gt;
&lt;li&gt;vector databases&lt;/li&gt;
&lt;li&gt;semantic search&lt;/li&gt;
&lt;li&gt;hybrid retrieval&lt;/li&gt;
&lt;li&gt;LLM structured output&lt;/li&gt;
&lt;li&gt;deterministic constraints&lt;/li&gt;
&lt;li&gt;RAG&lt;/li&gt;
&lt;li&gt;local inference&lt;/li&gt;
&lt;li&gt;API architecture&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And that became &lt;strong&gt;Saree Saathi AI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Built for my uncle. Built to learn. Built to be useful. 🥻🤖&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;#Hacktoberfest #BuildForAFriend #AI #MongoDB #OpenSource #JavaScript&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>weekendchallenge</category>
      <category>hf26challenge</category>
    </item>
  </channel>
</rss>
