<?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: Shravya N Bhat</title>
    <description>The latest articles on DEV Community by Shravya N Bhat (@shravya_nbhat_07f1b187f8).</description>
    <link>https://dev.to/shravya_nbhat_07f1b187f8</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%2F4275831%2Fa8cfec7b-7440-40b5-b2b6-dd288142b1a0.png</url>
      <title>DEV Community: Shravya N Bhat</title>
      <link>https://dev.to/shravya_nbhat_07f1b187f8</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shravya_nbhat_07f1b187f8"/>
    <language>en</language>
    <item>
      <title>What Actually Broke While Building a Clinical RAG Bot (And How I Fixed It)</title>
      <dc:creator>Shravya N Bhat</dc:creator>
      <pubDate>Sat, 05 Dec 2026 16:07:13 +0000</pubDate>
      <link>https://dev.to/shravya_nbhat_07f1b187f8/what-actually-broke-while-building-a-clinical-rag-bot-and-how-i-fixed-it-33e7</link>
      <guid>https://dev.to/shravya_nbhat_07f1b187f8/what-actually-broke-while-building-a-clinical-rag-bot-and-how-i-fixed-it-33e7</guid>
      <description>&lt;p&gt;This week I built CareVoice, a clinical and biomedical equipment knowledge bot that answers hospital SOP questions across English, Tamil, and Tanglish.&lt;/p&gt;

&lt;p&gt;On paper, RAG looks simple: chunk PDFs, embed them, retrieve top-k, and pass them to an LLM. In practice, three things broke immediately. Here is what went wrong and what actually fixed it.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Dense Search Missed Device Model Numbers
&lt;/h3&gt;

&lt;p&gt;When a query mixed Tamil with exact equipment codes—like &lt;em&gt;"Philips IntelliVue MX450 மானிட்டரில் SpO2 அலாரம் அளவு எவ்வளவு?"&lt;/em&gt; or &lt;em&gt;"Siemens E-714"&lt;/em&gt;—dense embeddings blurred similar medical devices together.&lt;/p&gt;

&lt;p&gt;The fix: I added BM25 keyword search alongside multilingual embeddings, merged both rankings with Reciprocal Rank Fusion (RRF), and added a cross-encoder reranker on top. Exact model numbers and error codes jumped straight to rank 1.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. "Only Answer From the Context" Still Hallucinated
&lt;/h3&gt;

&lt;p&gt;Even with a strict prompt, if the retriever pulled weak matches for an out-of-scope question, the model still tried to be helpful and guessed.&lt;/p&gt;

&lt;p&gt;The fix: I added a hard cosine-similarity threshold (&lt;code&gt;0.35&lt;/code&gt;). If the top retrieved chunk scores below that, the pipeline doesn't even call the LLM—it immediately returns &lt;em&gt;"I don't know based on the provided documents."&lt;/em&gt; Every valid answer also has to cite &lt;code&gt;[source, page]&lt;/code&gt; inside &lt;code&gt;&amp;lt;sources&amp;gt;&lt;/code&gt; tags, with regex PII redaction running before anything leaves the machine.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;code&gt;top_k=5&lt;/code&gt; Hurt Context Precision
&lt;/h3&gt;

&lt;p&gt;When I ran RAGAS on a 30-question golden set with &lt;strong&gt;Langfuse&lt;/strong&gt; tracing, &lt;strong&gt;Context Precision&lt;/strong&gt; was my weakest score. Pulling 5 chunks meant 1 relevant SOP and 4 noisy distractors sitting in the prompt.&lt;/p&gt;

&lt;p&gt;The fix: Narrowing the reranked output from &lt;code&gt;top_k=5&lt;/code&gt; down to &lt;code&gt;top_k=2&lt;/code&gt; cut out the noise and boosted precision right away.&lt;/p&gt;




&lt;p&gt;Biggest takeaway from the week: most "LLM problems" in RAG are actually retrieval and threshold problems. Measuring on 30 real questions showed me what to fix in 10 minutes instead of guessing.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>rag</category>
      <category>python</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>What I Built in Week 1: 5 Small Repos, Real Windows Bugs, and an Honest Look at LLM Tooling</title>
      <dc:creator>Shravya N Bhat</dc:creator>
      <pubDate>Tue, 01 Dec 2026 07:59:42 +0000</pubDate>
      <link>https://dev.to/shravya_nbhat_07f1b187f8/what-i-built-in-week-1-5-small-repos-real-windows-bugs-and-an-honest-look-at-llm-tooling-2jpi</link>
      <guid>https://dev.to/shravya_nbhat_07f1b187f8/what-i-built-in-week-1-5-small-repos-real-windows-bugs-and-an-honest-look-at-llm-tooling-2jpi</guid>
      <description>&lt;p&gt;Over the past five days of my AI Engineering Bootcamp, I built and pushed five small repositories—starting from basic Git discipline and moving toward typed data validation, PostgreSQL queries, streaming CLI logs, and structured prompt evaluation.&lt;/p&gt;

&lt;p&gt;Rather than pretending everything worked smoothly on the first try, here is an honest breakdown of what I actually built, what broke along the way, and what stuck with me.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Built (Days 1 to 5)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Day 1 – Git &amp;amp; Environment Hygiene (&lt;code&gt;bootcamp-day1-setup&lt;/code&gt;):&lt;/strong&gt; Set up Python 3.12 with &lt;code&gt;uv&lt;/code&gt;, created &lt;code&gt;.gitignore&lt;/code&gt; and &lt;code&gt;.env.example&lt;/code&gt; templates so API keys never enter Git history, and set up a circular peer-review PR loop with my three groupmates.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 2 – Typed Validation &amp;amp; Testing (&lt;code&gt;bootcamp-day2-tickets&lt;/code&gt;):&lt;/strong&gt; Built a &lt;code&gt;tickets&lt;/code&gt; package under a &lt;code&gt;src/&lt;/code&gt; layout using Pydantic models, an ISO date &lt;code&gt;field_validator&lt;/code&gt;, &lt;code&gt;logging&lt;/code&gt;, and 5 passing &lt;code&gt;pytest&lt;/code&gt; tests covering missing fields, invalid dates, bad enums, and empty files.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 3 – SQL Wrangling &amp;amp; Indexing (&lt;code&gt;bootcamp-day3-sql&lt;/code&gt;):&lt;/strong&gt; Loaded synthetic vendor-payment records into PostgreSQL, wrote 10 business queries (including duplicate invoice detection using &lt;code&gt;ROW_NUMBER() OVER (PARTITION BY ...)&lt;/code&gt;), and used &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; to verify how a composite index shifts lookups from a sequential scan to an index scan.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 4 – Streaming CLI &amp;amp; Token Logs (&lt;code&gt;bootcamp-day4-llm-cli&lt;/code&gt;):&lt;/strong&gt; Built &lt;code&gt;chat.py&lt;/code&gt; with a 20-turn safety cap, &lt;code&gt;tenacity&lt;/code&gt; backoff retries, and per-turn token/cost logging into &lt;code&gt;cost_log.csv&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Day 5 – Equipment Complaint Triager (&lt;code&gt;bootcamp-day5-triager&lt;/code&gt;):&lt;/strong&gt; Built &lt;code&gt;triager.py&lt;/code&gt; to convert free-text biomedical service complaints into Pydantic-validated &lt;code&gt;{equipment, urgency, hospital, next_action}&lt;/code&gt; JSON, comparing &lt;code&gt;prompts/v1.txt&lt;/code&gt; against &lt;code&gt;prompts/v2.txt&lt;/code&gt; across 20 test cases.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Code Snippet: Catching Empty Strings Before Validation
&lt;/h3&gt;

&lt;p&gt;One real lesson from Day 5 was that LLMs—and even test harnesses—often output &lt;code&gt;"N/A"&lt;/code&gt; or &lt;code&gt;"unknown"&lt;/code&gt; when a field is missing instead of &lt;code&gt;null&lt;/code&gt;. Adding a &lt;code&gt;before&lt;/code&gt; validator in Pydantic normalized those edge cases cleanly:&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
class TriageTicket(BaseModel):
    equipment: str = Field(..., min_length=2)
    urgency: Literal["low", "medium", "high", "critical"]
    hospital: str | None = None
    next_action: str = Field(..., min_length=5)

    @field_validator("hospital", mode="before")
    @classmethod
    def normalize_empty_hospital(cls, v: object) -&amp;gt; str | None:
        if v is None:
            return None
        if isinstance(v, str) and v.strip().lower() in {"", "null", "none", "n/a", "unknown"}:
            return None
        return str(v).strip()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>python</category>
      <category>sql</category>
    </item>
  </channel>
</rss>
