<?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 Aakanksha Mourya on Medium]]></title>
        <description><![CDATA[Stories by Aakanksha Mourya on Medium]]></description>
        <link>https://medium.com/@aakankshamourya2734?source=rss-62c28c7837d0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NaMCNPnXotm_Qfrn</url>
            <title>Stories by Aakanksha Mourya on Medium</title>
            <link>https://medium.com/@aakankshamourya2734?source=rss-62c28c7837d0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:45:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@aakankshamourya2734/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[RAG Interview Series]]></title>
            <link>https://medium.com/@aakankshamourya2734/rag-interview-series-fa41f959f799?source=rss-62c28c7837d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa41f959f799</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[word-embeddings]]></category>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Aakanksha Mourya]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 14:18:35 GMT</pubDate>
            <atom:updated>2026-10-19T14:18:35.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdVzHgwLnaJRv_Km-y84eQ.png" /></figure><p><strong>What are embedding?</strong></p><p>Embedding are numerical vector representation of images,texts and other data which capture the sematic meaning to represent the data and find out the similarity among them.</p><p>Vectors are assigned to each words . There are multiple vector embedding technique we use as word2vec,BERT and other models.</p><p>An embedding model is trained to map data into a vector space where useful relationships are reflected in the geometry of the vectors.</p><p>Three important points:</p><ul><li>Similar meanings often produce nearby vectors.</li><li>Unrelated meanings may produce less similar vectors.</li><li>Similarity is not the same as truth or factual correctness.</li></ul><p>We compare embedding using co-sine similarity , dot product and Euclidean distance.</p><p>Cosine similarity is frequently used because it compares vector direction rather than magnitude.</p><p><strong>Vector Database and indexing:</strong></p><p>We use pincone,faiss,pgvector and chromaDB as per requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xeOqn--ydOEgZKUXd3bDKA.jpeg" /></figure><p>A vector index helps to perform search similarity.</p><p>How it works:</p><ol><li>Receive the query embedding.</li><li>Calculate its distance or similarity against every eligible stored vector.</li><li>Rank the results.</li><li>Return the top K.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zjhmplTxZQEzi_8_mU7BsQ.jpeg" /></figure><p>IVF groups vectors into clusters.</p><p>Imagine organizing your documents into groups based on their embedding similarity. Instead of searching every vector, the system searches selected clusters near the query.</p><p>How it works:</p><ol><li>Train or build clusters around representative centroids.</li><li>Assign each vector to a cluster.</li><li>Embed the user query.</li><li>Find the nearest cluster centroids.</li><li>Search vectors in the selected clusters.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7pldMflKGPE72C91n6tQg.jpeg" /></figure><p>HNSW builds a graph in which vectors are connected to neighboring vectors. It uses multiple graph layers to navigate toward promising candidates.</p><p>How it works:</p><ol><li>Construct a graph connecting nearby vectors.</li><li>Start searching from an entry point.</li><li>Navigate through graph connections toward the query.</li><li>Explore promising neighbors until the search budget is reached.</li><li>Return the best candidates found.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa41f959f799" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RAG Interview Series]]></title>
            <link>https://medium.com/@aakankshamourya2734/rag-interview-series-bcc06ceaca25?source=rss-62c28c7837d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcc06ceaca25</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Aakanksha Mourya]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 13:10:35 GMT</pubDate>
            <atom:updated>2026-10-19T13:10:35.163Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdVzHgwLnaJRv_Km-y84eQ.png" /></figure><p><strong>Why use RAG instead of relying only on llm?</strong></p><p>LLM is trained on the internet data but its taring is not updated.It might doesn’t have knowledge about your company data. It is used for text generation.If you will ask question , it will invent the answer rather then giving factual correct answer.That’s why RAG comes into the picture.It provides external knowledge to llm so the answers of llm got optimize .</p><p><strong>Grounding, hallucination reduction, knowledge freshness and source attribution?</strong></p><p>Grounding is the process to make the llm to give the answer based on the external data not using its pretrained knowledge.</p><p>Actually grounding works in this way:</p><ul><li>Retrieve relevant chunks from the vector database.</li><li>Pass the retrieved context to the LLM.</li><li>Instruct the LLM to answer based on that context.</li><li>Validate the answer where necessary</li></ul><p>Hallucination Occurs when llm gives the answer it seems like it is correct but not . Instead of giving the right answer it invent the answer .So to reduce the hallucination these approach we follow:</p><ol><li>Improve chunking so relevant information stays together.</li><li>Improve retrieval using suitable embeddings and reranking.</li><li>Use clear prompts that require evidence from retrieved context.</li><li>Set retrieval thresholds based on evaluation rather than arbitrary guesses.</li><li>Evaluate answer faithfulness and verify claims against sources.</li><li>Allow the system to abstain when evidence is insufficient.</li></ol><p>Knowledge freshness:</p><p>It means is it assured that llm is giving the answers on new data or old data.So we do re-parse and re-chunk of documents.</p><p><strong>How to know which chunking strategy to follow and how to choose the size of chunk?</strong></p><p>Before deciding ,we should have to know what is the type of document .It is pdf,image,textual image,tabular data or power point presentaion.On the basis of tokens , we decide the size of chunks.</p><p>Small chunks: Retrieval will be fast and less irrevelant context and may loose context</p><p>Medium chunks: Retrieval good but may loose context .</p><p>Larger chunks: Retrieal could be slow and llm diluation problem will occur.</p><p>Optimal size is 500 tokens in production.</p><p><strong>What are the types of chunking and how to choose it?</strong></p><p>There are multiple types of chunking as follows:</p><p><strong>Fixed size chunking</strong>:Splits texts into fix number of tokens.But It can split sentences, paragraphs, or ideas in the middle.</p><p><strong>Recursive Character chunking:</strong>Splits text using a hierarchy of separators, typically paragraphs, newlines, sentences, and finally smaller units if needed.Used when: Processing ordinary PDFs, DOCX files, articles, and technical documentation.</p><p><strong>Semantic chunking:</strong> Used on the basis of semantic meanings and use semantic embedding to accordingly in meaning change.</p><p><strong>Structure Based chunking:</strong>Splits documents according to headings, sections, paragraphs, pages, or other meaningful boundaries.</p><p><strong>How to experimentally select chunk size rather than guessing?</strong></p><p>I will first create the dataset of questions then i will choose mutiple tokens with overlapping chunks and then measure the retrieval quality on the basis of Recall@K and MRR,context precision ,latency and cost . Where the better results i will find ,will choose that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcc06ceaca25" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Interview RAG Series]]></title>
            <link>https://medium.com/@aakankshamourya2734/interview-rag-series-85e5d67b24a1?source=rss-62c28c7837d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/85e5d67b24a1</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[artificalintelligence]]></category>
            <category><![CDATA[ai-ml-engineering]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Aakanksha Mourya]]></dc:creator>
            <pubDate>Mon, 19 Oct 2026 07:48:39 GMT</pubDate>
            <atom:updated>2026-10-19T07:48:39.516Z</atom:updated>
            <content:encoded><![CDATA[<p>What is Retrieval-Augmented Generation (RAG)?</p><p>Retrieval Augmented Generation is the way to optmize the llm answer. It is a cheat-sheet to llm. If data is frequently changing then we use RAG as external knowledge base.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sdVzHgwLnaJRv_Km-y84eQ.png" /></figure><p>RAG is built in multiple piplines.These are below:</p><p>1)Data Ingestion</p><p>2)Chunking</p><p>3)Embedding</p><p>4)Vector store</p><p>5)Retrieval</p><p>6)Prompt Construction</p><p>7)LLM</p><p>There are different approach for naive RAG and Advanced RAG.</p><p>In Naive RAG, we make data ingestion pipeline using pdf, table,docx,ppt. On the basis of structured and non-structured data ,parsing is done.Parsing is the process to extarct textual data from pdf,text,docx,ppt. If data is in tabular format or textual image then it is the painpoint , we use OCR and metadata approach.</p><p>second pipline in Naive RAG is chunking,We split the pdfs in multiple chunks of pages.There are many chunking stratigies as fixed size chunking,semantic based chunking,recursive charcter chunking.</p><p><strong>Often interviewr ask how to choose the size of chunks ?</strong></p><p>If it is too low then contexts will loose and if it is too high llm will dilute with the knowledge.On the basis of retrieval model, complexity of user queries and document size ,will decide the size of chunks.</p><p>third stage is embedding. We use create embeddings of chunked data .It is a vector representation and angular similarity of words . To store embeddings , Faiss,pgvector,pinecone,Chroma DB is used .</p><p>Vector store is the way to store the images ,pdfs type of data in vector format. we use dot product,cosine -similarity and euclidean distance for vector search. Behind creating the vectors muliple process is going on. We create word embeddings using word2vec or BERT or openai embedding model . After that cosine similarity is performed.Cosine similarity measures the directional similarity between two embedding vectors. In RAG, we use it to compare the query embedding with document embeddings and retrieve relevant chunks.</p><p>Retrieval is the process to finding the most relevant information from knowledge base based on user query.There are multiple type of retrieval strategies. Dense retrieval,Sparse retrieval and hybrid retrieval . After retrival we apply reranking.After chunking the documents and storing their embeddings in FAISS, we convert the user’s query into an embedding using the same embedding model. The retriever performs similarity search and returns the top-K relevant chunks. Depending on the application, we can use metadata filtering or hybrid retrieval to improve candidate selection. If the initial results contain irrelevant chunks, we apply a reranker to improve their order before passing the final context to the LLM. we evaluate retrieval using Recall@K, MRR, and nDCG, along with end-to-end answer quality.</p><p>Prompt constrcution is done to guide the llm .Including user input, top relevant chunks returned by the retriever , we construct the prompt. We also maintain the fallback and answer faithfulness via prompt. we clearly define the model’s role, instruct it to answer based on the retrieved context, specify a fallback when information is missing, and include source references where possible.Answer correctness and faithfulness helps that the prompt is working fine in running production.</p><p>In a RAG system, the LLM receives retrieved document chunks through a constructed prompt and uses that context to generate a grounded answer.During generation, the model predicts tokens sequentially based on the input context. Behind llm transformer architecture is used</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85e5d67b24a1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Regex]]></title>
            <link>https://medium.com/@aakankshamourya2734/regex-f0afdc16c3dc?source=rss-62c28c7837d0------2</link>
            <guid isPermaLink="false">https://medium.com/p/f0afdc16c3dc</guid>
            <category><![CDATA[data-collection]]></category>
            <category><![CDATA[web-scraping]]></category>
            <category><![CDATA[data-validation]]></category>
            <category><![CDATA[parsing]]></category>
            <category><![CDATA[python-regex]]></category>
            <dc:creator><![CDATA[Aakanksha Mourya]]></dc:creator>
            <pubDate>Fri, 01 Aug 2025 11:39:40 GMT</pubDate>
            <atom:updated>2025-08-01T13:27:11.073Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIX_BVAZSO9f_3ENm_U3aw.png" /></figure><h3>What is Regex?</h3><blockquote><em>Regex is that weird friend who </em><strong><em>understands everyone</em></strong><em>, but </em><strong><em>nobody understands them.</em></strong>Regular Expressions (Regex) are powerful tools for matching patterns in text. They are widely used in data cleaning, validation, web scraping, and log analysis. The term Regular Expression is the root of every programming language. Regular Expressions are nothing but collection of specified string which follow certain rules. In Theory Of Computation , we have learned the concept of Regular Expressions . It is somewhat related to that also.</blockquote><ul><li><strong>Match</strong> patterns in text (&quot;email@gmail.com&quot;)</li><li><strong>Search</strong> logs, data, or code for specific content</li><li><strong>Extract</strong> parts like phone numbers, emails, dates, etc.</li></ul><h3>The Story: Finding Patterns in Chaos</h3><p>Imagine you’re an <strong>email administrator</strong> at a large tech company. You’re handed a <strong>massive log file</strong> of user activities and errors.</p><p>The CTO tells you:<em>“Find all user email addresses who failed login between 2 AM and 5 AM last night.”</em>You look at the logs. It’s <strong>millions of lines</strong>, and it’s a mess:</p><p>But Regex will help you to solve this problem in minutes. How let’s get deep dive in it?</p><p><em>[2025–08–01 02:13:56] Failed login from user: </em><a href="/service/mailto:john.doe92@example.com"><em>john.doe92@example.com</em></a><em><br>[2025–08–01 02:14:00] Successful login from user: </em><a href="/service/mailto:jane_d@example.net"><em>jane_d@example.net</em></a><em><br>[2025–08–01 03:01:45] Failed login from user: </em><a href="/service/mailto:cool.guy123@company.org"><em>cool.guy123@company.org</em></a><em><br>…</em></p><p>Manually reading it? Impossible.<br>So you turn to <strong>regex</strong>: a powerful language to <strong>search, extract, and manipulate text patterns</strong>.</p><h4>Example: Match Email</h4><p>import re<br>pattern=”\w+@\w+.+”<br>re.findall(pattern,text)</p><p>output: admissions@scaler.in</p><h3>How we use Regex in Web Scrapping Process?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLjo13dagbO6NSSF0BUFNw.png" /></figure><p>Symbol Piece Type Meaning</p><p>. Blank tile Any character</p><p>* Multiplier 0 or more</p><p>+ Multiplier 1 or more</p><p>? Optional 0 or 1</p><p>\d Number Any digit</p><p>\w Letter/Num Word character</p><p>[] Choices One of many</p><p>^ $ Anchors Start/end of line</p><p>() Grouping Combine pieces</p><h4><strong>Syntax of Regex</strong></h4><p>Importing module re:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ssPdpQ_zmyNlwuov81Gndg.png" /></figure><p>Using findall() function to extract particular string:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vLMBTfxO5EIJ5N-wmC5JBQ.png" /></figure><h3>Applications of Regex</h3><h3>✨ Real-World Applications of Regex</h3><ol><li><strong>Validation</strong></li><li>Email: /^\S+@\S+\.\S+$/</li><li>Phone number: /^\d{10}$/</li><li><strong>Web Scraping</strong><br> Extract product prices: ₹\d+(,\d{3})*(\.\d{2})?</li><li><strong>Data Cleaning</strong><br> Remove unwanted symbols: re.sub(r&#39;[^\w\s]&#39;, &#39;&#39;, text)</li><li><strong>Logs &amp; Monitoring</strong><br> Parse logs for IPs: \d{1,3}(\.\d{1,3}){3}</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_J53C5jmZBK301wroR9Brg.jpeg" /></figure><h3>🧠 Final Thought:</h3><blockquote><em>“Regex is like dating a dragon. It’s fiery, dangerous, confusing — but once you tame it, you can fly through data like a boss.” 🐉🔥📊</em></blockquote><p>If you find this blog helpful follow me here or contact me through this link</p><p><a href="https://67fdef425305c.site123.me/">https://67fdef425305c.site123.me/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f0afdc16c3dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>