<?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: Aditya Prasad</title>
    <description>The latest articles on DEV Community by Aditya Prasad (@aditya_prasad_c670b9e01c4).</description>
    <link>https://dev.to/aditya_prasad_c670b9e01c4</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3756580%2F1cba701a-5848-49bd-b548-778dfdfd8031.png</url>
      <title>DEV Community: Aditya Prasad</title>
      <link>https://dev.to/aditya_prasad_c670b9e01c4</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aditya_prasad_c670b9e01c4"/>
    <language>en</language>
    <item>
      <title>How I built an RAG engine for Singapore Laws</title>
      <dc:creator>Aditya Prasad</dc:creator>
      <pubDate>Sat, 07 Feb 2026 04:50:03 +0000</pubDate>
      <link>https://dev.to/aditya_prasad_c670b9e01c4/how-i-built-an-rag-engine-for-singapore-laws-413b</link>
      <guid>https://dev.to/aditya_prasad_c670b9e01c4/how-i-built-an-rag-engine-for-singapore-laws-413b</guid>
      <description>&lt;p&gt;I built a "Triple Failover" RAG for Singapore Laws, then rewrote the logic based on your feedback.&lt;/p&gt;

&lt;p&gt;Hi everyone!&lt;/p&gt;

&lt;p&gt;I’m a student developer. Recently, I created Explore Singapore, a RAG-based search engine that scrapes about 20,000 pages of Singaporean government acts and laws.&lt;/p&gt;

&lt;p&gt;I recently posted the MVP and received some tough but essential feedback about hallucinations and query depth. I took that feedback, focused on improvements, and just released Version 2.&lt;/p&gt;

&lt;p&gt;Here is how I upgraded the system from a basic RAG to a production-grade one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Design &amp;amp; UI
&lt;/h2&gt;

&lt;p&gt;I aimed to avoid a dull government website.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Design&lt;/strong&gt;: Heavily inspired by Apple’s minimalist style.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tech&lt;/strong&gt;: Custom frontend interacting with a Python backend.&lt;/p&gt;

&lt;p&gt;The V2 Engineering Overhaul&lt;/p&gt;

&lt;p&gt;The community challenged me on three main points. Here’s how I addressed them:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The "Personality" Fix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: I use a "Triple Failover" system with three models as backup. When the main model failed, the backups sounded entirely different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: I added Dynamic System Instructions. Now, if the backend switches to Model B, it uses a specific prompt designed for Model B’s features, making it mimic the structure and tone of the primary model. The user never notices the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The "Deep Search" Fix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: A simple semantic search for "Starting a business" misses related laws like "Tax" or "Labor" acts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: I implemented Multi-Query Retrieval (MQR). An LLM now intercepts your query. It breaks it down into sub-intents (e.g., “Business Registration,” “Corporate Tax,” “Employment Rules”). It searches for all of them at the same time and combines the results.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Result&lt;/strong&gt;: Much richer, context-aware answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The "Hallucination" Fix
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Issue&lt;/strong&gt;: Garbage In, Garbage Out. If FAISS retrieves a bad document, the LLM produces inaccurate information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Solution&lt;/strong&gt;: I added a Cross-Encoder Re-Ranking layer.&lt;/p&gt;

&lt;p&gt;Step 1: FAISS grabs the top 10 results.&lt;/p&gt;

&lt;p&gt;Step 2: A specialized Cross-Encoder model evaluates them for relevance.&lt;/p&gt;

&lt;p&gt;Step 3: Irrelevant parts are removed before they reach the Chat LLM.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Embeddings&lt;/strong&gt;: BGE-M3 (Running locally)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Vector DB&lt;/strong&gt;: FAISS&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backend&lt;/strong&gt;: Python + Custom Triple-Model Failover(runs on Hugging Face)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Logic&lt;/strong&gt;: Multi-Query + Re-Ranking (New in V2)&lt;/p&gt;

&lt;p&gt;Try it out&lt;/p&gt;

&lt;p&gt;I am still learning. I’d love to hear your thoughts on the new logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live Demo&lt;/strong&gt;: &lt;a href="https://adityaprasad-sudo.github.io/Explore-Singapore/" rel="noopener noreferrer"&gt;Explore Singapore&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repo&lt;/strong&gt;: &lt;a href="https://github.com/adityaprasad-sudo/Explore-Singapore" rel="noopener noreferrer"&gt;adityaprasad-sudo/Explore-Singapore&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback is the backbone of improving a platform, especially on the failover speed, is welcome!👇&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>devops</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Guys check this out i built an Legaltech with RAG for Singapore well I am still a student and new to everything if I do anything wrong or any feedbacks kindly convey it to me because I think feedbacks are the backbone of improving a platform.</title>
      <dc:creator>Aditya Prasad</dc:creator>
      <pubDate>Fri, 06 Feb 2026 13:38:05 +0000</pubDate>
      <link>https://dev.to/aditya_prasad_c670b9e01c4/guys-check-this-out-i-built-an-legaltech-with-rag-for-singapore-well-i-am-still-a-student-and-new-3kac</link>
      <guid>https://dev.to/aditya_prasad_c670b9e01c4/guys-check-this-out-i-built-an-legaltech-with-rag-for-singapore-well-i-am-still-a-student-and-new-3kac</guid>
      <description>&lt;p&gt;

&lt;/p&gt;
&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://vibe.forem.com/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g" class="crayons-story__hidden-navigation-link" rel="noopener noreferrer"&gt;Built an Legaltech for Singapore using RAG(improvements)&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/aditya_prasad_c670b9e01c4" class="crayons-avatar  crayons-avatar--l  "&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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3756580%2F1cba701a-5848-49bd-b548-778dfdfd8031.png" alt="aditya_prasad_c670b9e01c4 profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/aditya_prasad_c670b9e01c4" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Aditya Prasad
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Aditya Prasad
                
              
              &lt;div id="story-author-preview-content-3238174" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/aditya_prasad_c670b9e01c4" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3756580%2F1cba701a-5848-49bd-b548-778dfdfd8031.png" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Aditya Prasad&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://vibe.forem.com/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g" class="crayons-story__tertiary fs-xs" rel="noopener noreferrer"&gt;&lt;time&gt;Feb 6&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://vibe.forem.com/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g" id="article-link-3238174" rel="noopener noreferrer"&gt;
          Built an Legaltech for Singapore using RAG(improvements)
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/database"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;database&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/devops"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;devops&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/opensource"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;opensource&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://vibe.forem.com/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left" rel="noopener noreferrer"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt; reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://vibe.forem.com/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center" rel="noopener noreferrer"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            2 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;




</description>
      <category>ai</category>
      <category>database</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Built an Legaltech for Singapore using RAG(improvements)</title>
      <dc:creator>Aditya Prasad</dc:creator>
      <pubDate>Fri, 06 Feb 2026 12:58:24 +0000</pubDate>
      <link>https://dev.to/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g</link>
      <guid>https://dev.to/aditya_prasad_c670b9e01c4/built-an-legaltech-for-singapore-using-ragimprovements-285g</guid>
      <description>&lt;p&gt;I built a "Triple Failover" RAG for Singapore Laws, then rewrote the logic based on your feedback.&lt;/p&gt;

&lt;p&gt;Hi everyone! &lt;/p&gt;

&lt;p&gt;I’m a student developer. Recently, I created Explore Singapore, a RAG-based search engine that scrapes about 20,000 pages of Singaporean government acts and laws.&lt;/p&gt;

&lt;p&gt;I recently posted the MVP and received some tough but essential feedback about hallucinations and query depth. I took that feedback, focused on improvements, and just released Version 2.&lt;/p&gt;

&lt;p&gt;Here is how I upgraded the system from a basic RAG to a production-grade one.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Design &amp;amp; UI
&lt;/h2&gt;

&lt;p&gt;I aimed to avoid a dull government website.&lt;/p&gt;

&lt;p&gt;Design: Heavily inspired by Apple’s minimalist style.&lt;/p&gt;

&lt;p&gt;Tech: Custom frontend interacting with a Python backend.&lt;/p&gt;

&lt;p&gt;The V2 Engineering Overhaul&lt;/p&gt;

&lt;p&gt;The community challenged me on three main points. Here’s how I addressed them:&lt;/p&gt;

&lt;h2&gt;
  
  
  1. The "Personality" Fix
&lt;/h2&gt;

&lt;p&gt;Issue: I use a "Triple Failover" system with three models as backup. When the main model failed, the backups sounded entirely different.&lt;/p&gt;

&lt;p&gt;The Solution: I added Dynamic System Instructions. Now, if the backend switches to Model B, it uses a specific prompt designed for Model B’s features, making it mimic the structure and tone of the primary model. The user never notices the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. The "Deep Search" Fix
&lt;/h2&gt;

&lt;p&gt;Issue: A simple semantic search for "Starting a business" misses related laws like "Tax" or "Labor" acts.&lt;/p&gt;

&lt;p&gt;The Solution: I implemented Multi-Query Retrieval (MQR). An LLM now intercepts your query. It breaks it down into sub-intents (e.g., “Business Registration,” “Corporate Tax,” “Employment Rules”). It searches for all of them at the same time and combines the results.&lt;/p&gt;

&lt;p&gt;Result: Much richer, context-aware answers.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. The "Hallucination" Fix
&lt;/h2&gt;

&lt;p&gt;Issue: Garbage In, Garbage Out. If FAISS retrieves a bad document, the LLM produces inaccurate information.&lt;/p&gt;

&lt;p&gt;The Solution: I added a Cross-Encoder Re-Ranking layer. &lt;/p&gt;

&lt;p&gt;Step 1: FAISS grabs the top 10 results.&lt;/p&gt;

&lt;p&gt;Step 2: A specialized Cross-Encoder model evaluates them for relevance.&lt;/p&gt;

&lt;p&gt;Step 3: Irrelevant parts are removed before they reach the Chat LLM.&lt;/p&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;p&gt;**&lt;/p&gt;

&lt;p&gt;Embeddings: BGE-M3 (Running locally)&lt;/p&gt;

&lt;p&gt;Vector DB: FAISS&lt;/p&gt;

&lt;p&gt;Backend: Python + Custom Triple-Model Failover&lt;/p&gt;

&lt;p&gt;Logic: Multi-Query + Re-Ranking (New in V2)&lt;/p&gt;

&lt;p&gt;Try it out&lt;/p&gt;

&lt;p&gt;I am still learning. I’d love to hear your thoughts on the new logic.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Live Demo&lt;/strong&gt;: &lt;a href="https://adityaprasad-sudo.github.io/Explore-Singapore/" rel="noopener noreferrer"&gt;Explore Singapore&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repo&lt;/strong&gt;: &lt;a href="https://github.com/adityaprasad-sudo/Explore-Singapore" rel="noopener noreferrer"&gt;adityaprasad-sudo/Explore-Singapore&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback, especially on the failover speed, is welcome!👇&lt;/p&gt;

</description>
      <category>ai</category>
      <category>database</category>
      <category>devops</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
