<?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: Bedirhan Kızılcık</title>
    <description>The latest articles on DEV Community by Bedirhan Kızılcık (@bedirhankizilcik).</description>
    <link>https://dev.to/bedirhankizilcik</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%2F4044100%2Fd9292b5b-be08-4e65-a138-edcdad765107.jpg</url>
      <title>DEV Community: Bedirhan Kızılcık</title>
      <link>https://dev.to/bedirhankizilcik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bedirhankizilcik"/>
    <language>en</language>
    <item>
      <title>Part 1-3: From Raw Health Text to a Working Retrieval Pipeline</title>
      <dc:creator>Bedirhan Kızılcık</dc:creator>
      <pubDate>Thu, 23 Jul 2026 17:29:36 +0000</pubDate>
      <link>https://dev.to/bedirhankizilcik/part-1-3-from-raw-health-text-to-a-working-retrieval-pipeline-n6b</link>
      <guid>https://dev.to/bedirhankizilcik/part-1-3-from-raw-health-text-to-a-working-retrieval-pipeline-n6b</guid>
      <description>&lt;p&gt;I'm a first-year undergraduate student in Artificial Intelligence Engineering, and this summer I'm building a small RAG (Retrieval-Augmented Generation) project from scratch to learn how these systems actually work under the hood — not just by calling an API, but by building the pipeline piece by piece. This is a log of the first three parts of that journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Part 1: Understanding the Building Blocks
&lt;/h2&gt;

&lt;p&gt;Before writing any real project code, I spent time understanding the core ideas behind RAG:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Calling an LLM API&lt;/strong&gt;: sending a prompt programmatically and getting a response back. I used the Gemini API for this. &lt;code&gt;llm_test.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Embeddings&lt;/strong&gt;: the idea that text can be converted into numerical vectors, where semantically similar sentences end up close to each other in vector space. I tested this with a handful of sentences using &lt;code&gt;sentence-transformers&lt;/code&gt; and computed cosine similarity between them — it was satisfying to see related sentences actually cluster together numerically. &lt;code&gt;embedding_test.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why not just dump everything into the LLM?&lt;/strong&gt;: context windows are limited, it's expensive, and irrelevant information can actually hurt answer quality rather than help it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vector databases&lt;/strong&gt;: conceptually, tools like Chroma or FAISS solve the problem of searching through large numbers of embeddings quickly to find the most relevant ones.
No heavy coding in Part 1 — mostly small test scripts to confirm I understood each piece before combining them.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Part 2: Collecting and Preparing Real Data
&lt;/h2&gt;

&lt;p&gt;With the concepts in place, Part 2 was about getting real data ready for retrieval:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data collection&lt;/strong&gt;: I gathered short health topic descriptions (e.g. diabetes, epilepsy) and saved them as structured JSON records, each with a &lt;code&gt;source&lt;/code&gt; and &lt;code&gt;text&lt;/code&gt; field. Keeping the source attached to each record matters — it means the system can eventually point back to where an answer came from. &lt;code&gt;data/health_data.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Chunking&lt;/strong&gt;: I wrote a script to split each record's text into smaller, paragraph-level pieces while keeping the original source attached to every chunk. Since I intentionally kept the raw text short for this first test run, most entries ended up as a single chunk each — which is fine for now, since the goal was to validate the pipeline, not build a large dataset yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Why chunk at all?&lt;/strong&gt;: embedding models represent short, focused pieces of text more accurately than long documents. Splitting text into meaningful chunks is what makes retrieval actually useful later.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Part 3: Setting Up the Vector Store and First Retrieval
&lt;/h2&gt;

&lt;p&gt;With chunked, source-tagged data ready, Part 3 turned that data into something actually searchable:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Vector store setup&lt;/strong&gt;: installed and configured Chroma, then embedded every chunk from Part 2 and stored it alongside its text and source metadata. &lt;code&gt;embed_and_store.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;First retrieval test&lt;/strong&gt;: wrote a query script, asked a sample question, and retrieved the most similar chunks from the vector store. The results were reasonable given how small and short the dataset still is — a good early sign that the pipeline itself works end to end. &lt;code&gt;retrieval_test.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A note on limitations&lt;/strong&gt;: since the dataset is intentionally tiny at this stage, retrieval quality is limited. That's expected, and it'll improve as the dataset grows in later parts.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;At this point I have a full (if small-scale) pipeline: raw text → structured data → chunks → embeddings → retrieval. The next step is connecting retrieval to actual answer generation — feeding retrieved chunks into the LLM as context so it can answer health questions grounded in real source material.&lt;/p&gt;

&lt;p&gt;👉 Code for this project: &lt;a href="https://github.com/chewiessean/health-rag-assistant" rel="noopener noreferrer"&gt;health-rag-assistant&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Follow along as I build this project part by part — code on GitHub, progress here on Dev.to.&lt;/em&gt;&lt;/p&gt;

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