<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rahul Bhatia on Medium]]></title>
        <description><![CDATA[Stories by Rahul Bhatia on Medium]]></description>
        <link>https://medium.com/@rahul.bhatia023?source=rss-6f7f2d05c92f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fgOPZ72E4C_bxPY8tqpk-A.jpeg</url>
            <title>Stories by Rahul Bhatia on Medium</title>
            <link>https://medium.com/@rahul.bhatia023?source=rss-6f7f2d05c92f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:31:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rahul.bhatia023/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Anthropic Contextual Retrieval: Elevating RAG with Smarter Context Integration]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rahul.bhatia023/anthropic-contextual-retrieval-elevating-rag-with-smarter-context-integration-582481657316?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/2600/0*_evuFlwypkQstbVZ" width="2600"></a></p><p class="medium-feed-snippet">Recently Anthropic came with an approach to dramatically improve the retrieval process in RAG. The approach is called Contextual Retrieval.</p><p class="medium-feed-link"><a href="https://medium.com/@rahul.bhatia023/anthropic-contextual-retrieval-elevating-rag-with-smarter-context-integration-582481657316?source=rss-6f7f2d05c92f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rahul.bhatia023/anthropic-contextual-retrieval-elevating-rag-with-smarter-context-integration-582481657316?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/582481657316</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Tue, 17 Dec 2024 18:05:31 GMT</pubDate>
            <atom:updated>2024-12-17T18:05:31.092Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Hybrid Search in RAG: Bridging Precision and Context in AI Retrieval]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rahul.bhatia023/hybrid-search-in-rag-bridging-precision-and-context-in-ai-retrieval-cb4efa647a8f?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/1220/1*nOOxIwv6T1-AnaNI-ZAs6Q.jpeg" width="1220"></a></p><p class="medium-feed-snippet">In this blog, we outline a method that dramatically improves the retrieval step in RAG. The method is called Hybrid Search.</p><p class="medium-feed-link"><a href="https://medium.com/@rahul.bhatia023/hybrid-search-in-rag-bridging-precision-and-context-in-ai-retrieval-cb4efa647a8f?source=rss-6f7f2d05c92f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rahul.bhatia023/hybrid-search-in-rag-bridging-precision-and-context-in-ai-retrieval-cb4efa647a8f?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb4efa647a8f</guid>
            <category><![CDATA[generative-ai-tools]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Thu, 12 Dec 2024 22:12:22 GMT</pubDate>
            <atom:updated>2024-12-12T22:12:22.484Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[GraphRAG: Enhancing Retrieval Augmented Generation with Knowledge Graphs]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rahul.bhatia023/graphrag-enhancing-retrieval-augmented-generation-with-knowledge-graphs-20fde1c9b67c?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/1280/1*49Cauma1QtVBYFyPc22S8Q.jpeg" width="1280"></a></p><p class="medium-feed-snippet">GraphRAG offers a more organized and layered approach to Retrieval-Augmented Generation (RAG), moving beyond the simplicity of basic&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@rahul.bhatia023/graphrag-enhancing-retrieval-augmented-generation-with-knowledge-graphs-20fde1c9b67c?source=rss-6f7f2d05c92f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rahul.bhatia023/graphrag-enhancing-retrieval-augmented-generation-with-knowledge-graphs-20fde1c9b67c?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/20fde1c9b67c</guid>
            <category><![CDATA[aritificial-intelligence]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Wed, 04 Dec 2024 20:39:29 GMT</pubDate>
            <atom:updated>2024-12-04T20:39:29.701Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Demystifying RAG: Building a PDF-Based Question-Answering App]]></title>
            <link>https://medium.com/@rahul.bhatia023/demystifying-rag-building-a-pdf-based-question-answering-app-c2a2ef436de3?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2a2ef436de3</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[generative-ai-use-cases]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 18:36:17 GMT</pubDate>
            <atom:updated>2024-11-26T18:36:17.687Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wa0zuSqk8WxGhxsbLyGppw.jpeg" /></figure><p>Recently, I started my journey into the fascinating world of Generative AI, a field that is rapidly transforming the IT industry. As someone completely new to this domain, I was excited to explore its concepts both in theory and through practical experience.</p><p>To make my learning experience more practical, I began creating small tools to apply and understand these concepts better. You can explore all the tools I built <a href="https://learn-ai.streamlit.app/">here</a>.</p><h3>First App: Simple RAG</h3><p>The first app I built was <strong><em>Simple RAG</em></strong>. This app lets users upload a PDF document and interact with it through a chat interface. You can try it out and experiment with its features as well. Here are the details to access it:</p><p>• <strong>App URL</strong>: <a href="https://learn-ai.streamlit.app/Simple_RAG">Simple RAG</a></p><p>• <strong>GitHub Repository</strong>: <a href="https://github.com/rahulbhatia023/learn-ai/blob/main/pages/Simple_RAG.py">Simple RAG Code</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dJj1wgzj1oKyFu9bFbQ4Q.png" /><figcaption>Simple RAG app UI interface</figcaption></figure><p>While building this app, I concentrated on understanding important concepts such as chunking, embeddings, semantic search, vector stores, etc. These elements formed the foundation for creating a functional and efficient application.</p><h3>Second App: Demystify RAG</h3><p>As part of my AI learning journey, I’m thrilled to introduce the second app I created: <strong><em>Demystify RAG</em></strong>. This app takes things to the next level by offering a visual walkthrough of how a RAG application operates behind the scenes.</p><p><em>Demystify RAG</em> breaks down the process step-by-step, providing a clear understanding of the core components involved in building a RAG application:</p><p>1️⃣ Uploading a document.</p><p>2️⃣ Splitting the document into chunks.</p><p>3️⃣ Generating embeddings for the chunks.</p><p>4️⃣ Retrieving the most relevant chunks based on user queries.</p><p>5️⃣ Creating a response using the query and the context sent to the LLM.</p><p>This app is designed to make the underlying mechanics of RAG more accessible and engaging for learners and developers alike.</p><p>Users can interact with each step of the process, adjust configurations, and gain a hands-on understanding of how RAG applications work at their core.</p><p>You can explore the app here:</p><p>• <strong>App URL</strong>: <a href="https://learn-ai.streamlit.app/Demystify_RAG">Demystify RAG</a></p><p>• <strong>GitHub Repository</strong>: <a href="https://github.com/rahulbhatia023/learn-ai/blob/main/pages/Demystify_RAG.py">Demystify RAG Code</a></p><p>In this blog, we’ll take a closer look at <em>Demystify RAG</em> and dive into the details of each step, exploring the nuances that make RAG applications function effectively.</p><h3>Step-1: Upload PDF document</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dgj3XOPHMTB8erJElAOm4w.png" /></figure><p>A RAG application can work with various types of documents, such as PDF, CSV, TXT, and more. For the purposes of this demo, I’ve kept it simple by allowing users to upload a PDF file. In this case, I’ve uploaded my resume to showcase how the app works.</p><h3>Step-2: Create document chunks</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EAkFbF8Nq1eZdzzQuAPBNQ.png" /></figure><p>Once you’ve uploaded your document, the next crucial step is chunking. Chunking involves breaking the document into smaller, manageable pieces, each containing semantically relevant content. This process is vital for the effectiveness of a Retrieval-Augmented Generation (RAG) system.</p><p>Passing entire documents or overly large chunks to the model can be costly and may exceed token limits, leading to inefficiencies. Additionally, providing irrelevant information can cause the model to generate inaccurate responses or “hallucinations.” On the other hand, too-small chunks that lack enough context to address a query will also lead to poor results. The challenge lies in capturing the relevant context, which may span across multiple chunks, while ensuring each chunk is meaningful on its own.</p><p>The art is implementing effective chunking approaches for your specific document types and their structures and content.</p><p>For this use case, we’ve chosen a Fixed-size parsing approach with overlap. This method breaks the document into chunks based on a fixed number of characters or tokens, with some overlap between chunks. The advantage of this approach is that it allows for chunks that contain semantic meaning spanning multiple sentences, improving the overall quality and relevance of the content provided to the model.</p><p>If we select the chunking options as specified above and click on ‘Create chunks’ button then we get below chunks:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JOIV2e0-VWo1HR2teJZpJA.png" /></figure><h3>Step-3: Generate chunks embeddings</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3qdFTY_-dz6H-e51w8c4A.png" /></figure><p>Once your document is broken down into chunks, the next step is to generate embeddings for these chunks. Embeddings are mathematical representations of objects — like text — that capture their semantic meaning.</p><p>In the context of a RAG system, embeddings are crucial because they allow for efficient vector searches. Each chunk of text is transformed into a vector (a numerical representation) that encodes its meaning in a way that machines can understand and compare. This enables the system to search for and retrieve the most relevant chunks based on user queries, even when those chunks are not an exact match but share similar semantic meaning.</p><p>The embedding model you choose plays a crucial role in determining the relevance of your vector search results. One key factor to consider is the model’s vocabulary. The vocabulary is important because embedding models handle words that aren’t directly in their vocabulary in a particular way. When a word isn’t in the model’s vocabulary, the model still needs to calculate a vector for it. To do this, many models break the word down into smaller subwords, treating each subword as a distinct token. Alternatively, some models aggregate the vectors of these subwords to form a single, unified embedding. This process ensures that even unfamiliar or out-of-vocabulary words can be represented semantically, which helps the model retrieve more relevant results during searches.</p><p>When selecting an embedding model, it’s important to consider the trade-off between performance and cost. Larger embedding models often deliver better performance on benchmarking datasets, meaning they can produce more accurate results. However, this increased performance comes with a higher price tag. Larger vectors take up more storage space in the vector database and require more computational resources and time when comparing embeddings. On the other hand, smaller embedding models typically offer lower performance on the same benchmarks. While they may not perform as well in terms of accuracy, they have the advantage of requiring less storage space in the vector database and using fewer computational resources, leading to faster comparisons at a lower cost. Depending on your specific use case and available resources, you’ll need to balance performance and efficiency when choosing the right embedding model.</p><p>The embedding model used in this app is OpenAI’s default embedding model, <em>text-embedding-ada-002</em>. Once the user provides their OpenAI API key and clicks the ‘Generate’ button, the app processes the document and generates embeddings for each chunk. These embeddings are then displayed alongside their respective chunks, ready for use in vector searches and further analysis.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4EXbz2tkoWXGSkfoNK-tBw.png" /></figure><h3>Step-4: Similarity Search</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NDoG3-i7BMqTxGDMN7mTkQ.png" /></figure><p>The next step involves searching for and retrieving the most relevant information from an external knowledge base to enhance the user’s query. This process acts as the first step in gathering context, ensuring that the language model has all the necessary information to generate a more accurate and informed response. By providing the model with relevant context from the knowledge base, we can improve the quality of the answers and make them more tailored to the user’s needs.</p><p>In the retrieval phase, an embedding model is used to compare the user’s query with the stored information in the knowledge base. This process helps identify the most relevant text snippets or documents to retrieve. By mapping both the query and the stored content into the same semantic space, the model can effectively find the best matching information, ensuring that the response is as relevant and accurate as possible.</p><p>For this app, once the user submits a query and clicks the ‘Search’ button, the system retrieves the most similar chunks along with a similarity score. The similarity score is a numerical value that indicates how closely the retrieved document matches the user’s input query. This score is typically calculated using methods like cosine similarity, where a higher score means a stronger match between the query and the document. The retrieved documents with the highest similarity scores are then used as context for the language model. This context helps the model generate a response that is more accurate, relevant, and aligned with the user’s query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7g3PU9NgSx0PynolFX8q9A.png" /></figure><h3>Step-5: Generate Response</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PG2BbO0LqfcKsZ_zt_Ad-A.png" /></figure><p>In this phase, the AI model creates a response based on both the user’s query and the context retrieved from the knowledge base. The relevant chunks of information, gathered during the retrieval phase, are combined with the user’s original query to form a detailed prompt. This prompt provides the AI model with the necessary background and context to generate an accurate response.</p><p>The model then processes this combined input to produce a coherent and contextually accurate response. The goal is to ensure that the response directly addresses the user’s query while grounding the content in the information retrieved from the knowledge base.</p><p>Once the user clicks on the ‘Generate’ button, the final response is generated, delivering the answer based on the enriched context provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dHcRBj_gONgA35dmnYF5Ww.png" /></figure><p>I hope this blog has provided valuable insights and helped you understand how a RAG application works. Feel free to explore the app, experiment with your own PDF documents, and see how it can enhance your understanding of Retrieval-Augmented Generation. Don’t hesitate to reach out if you have any questions or need further guidance!</p><p>You can follow me on <a href="https://www.linkedin.com/in/rahulbhatia023/">Linkedin</a> and <a href="https://x.com/rahulbhatia023">X</a>. 🙏🏻</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2a2ef436de3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I used Iceberg table in AWS Athena to generate the daily snapshot data]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rahul.bhatia023/how-i-used-iceberg-table-in-aws-athena-to-generate-the-daily-snapshot-data-4e6ff93bc9ca?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/2600/0*mxDq_5T0SiY2D_Vl" width="4764"></a></p><p class="medium-feed-snippet">I was recently working on a project in AWS that required generating snapshot data from the raw historical data stored in a data lake.</p><p class="medium-feed-link"><a href="https://medium.com/@rahul.bhatia023/how-i-used-iceberg-table-in-aws-athena-to-generate-the-daily-snapshot-data-4e6ff93bc9ca?source=rss-6f7f2d05c92f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rahul.bhatia023/how-i-used-iceberg-table-in-aws-athena-to-generate-the-daily-snapshot-data-4e6ff93bc9ca?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e6ff93bc9ca</guid>
            <category><![CDATA[data-lake]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[apache-iceberg]]></category>
            <category><![CDATA[aws-athena]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Wed, 31 Jan 2024 17:09:12 GMT</pubDate>
            <atom:updated>2024-01-31T17:09:12.332Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How I used Scala CLI to delete annoying unread emails from my gmail inbox]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@rahul.bhatia023/how-i-used-scala-cli-to-delete-annoying-unread-emails-from-my-gmail-inbox-74faa70d1145?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/735/1*HIz1VHA6NPNedTI4eHZsLQ.jpeg" width="735"></a></p><p class="medium-feed-snippet">Are you like me, feeling overwhelmed by the mountain of unread emails in your inbox? Ever thought about just clearing them all out and&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@rahul.bhatia023/how-i-used-scala-cli-to-delete-annoying-unread-emails-from-my-gmail-inbox-74faa70d1145?source=rss-6f7f2d05c92f------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@rahul.bhatia023/how-i-used-scala-cli-to-delete-annoying-unread-emails-from-my-gmail-inbox-74faa70d1145?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/74faa70d1145</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[command-line-interface]]></category>
            <category><![CDATA[gmail]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Sun, 21 Jan 2024 22:50:26 GMT</pubDate>
            <atom:updated>2024-01-21T22:50:26.885Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Unleash the Syntactic Sugar in Scala]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/clairvoyantblog/unleash-the-syntactic-sugar-in-scala-d1860f8c6704?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/750/1*A3e3VRJ-NkRHffqVUtJ26Q.png" width="750"></a></p><p class="medium-feed-snippet">Introducing several syntactic sugars supported by the Scala programming language</p><p class="medium-feed-link"><a href="https://medium.com/clairvoyantblog/unleash-the-syntactic-sugar-in-scala-d1860f8c6704?source=rss-6f7f2d05c92f------2">Continue reading on Clairvoyant Blog »</a></p></div>]]></description>
            <link>https://medium.com/clairvoyantblog/unleash-the-syntactic-sugar-in-scala-d1860f8c6704?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/d1860f8c6704</guid>
            <category><![CDATA[enterprise-solutions]]></category>
            <category><![CDATA[scala]]></category>
            <category><![CDATA[syntax]]></category>
            <category><![CDATA[big-data]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Tue, 25 Jan 2022 17:11:31 GMT</pubDate>
            <atom:updated>2022-01-25T17:11:31.950Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
        </item>
        <item>
            <title><![CDATA[Big Data File Formats]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/clairvoyantblog/big-data-file-formats-3fb659903271?source=rss-6f7f2d05c92f------2"><img src="https://cdn-images-1.medium.com/max/600/1*Cbvu7JJWkJbPNXFMUYo9BQ.png" width="600"></a></p><p class="medium-feed-snippet">In this blog, I will talk about what file formats actually are, go through some common Hadoop file format features, and give a little&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/clairvoyantblog/big-data-file-formats-3fb659903271?source=rss-6f7f2d05c92f------2">Continue reading on Clairvoyant Blog »</a></p></div>]]></description>
            <link>https://medium.com/clairvoyantblog/big-data-file-formats-3fb659903271?source=rss-6f7f2d05c92f------2</link>
            <guid isPermaLink="false">https://medium.com/p/3fb659903271</guid>
            <category><![CDATA[big-data]]></category>
            <dc:creator><![CDATA[Rahul Bhatia]]></dc:creator>
            <pubDate>Thu, 09 May 2019 11:25:35 GMT</pubDate>
            <atom:updated>2021-09-16T10:59:03.737Z</atom:updated>
        </item>
    </channel>
</rss>