<?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 Damisha Wickramaarachchi on Medium]]></title>
        <description><![CDATA[Stories by Damisha Wickramaarachchi on Medium]]></description>
        <link>https://medium.com/@damishat99?source=rss-013c0d7e7be2------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*k835fsQ8Jubgufgkes2vIQ.png</url>
            <title>Stories by Damisha Wickramaarachchi on Medium</title>
            <link>https://medium.com/@damishat99?source=rss-013c0d7e7be2------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:17:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@damishat99/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[Retrieval-Augmented Generation (RAG)]]></title>
            <link>https://medium.com/@damishat99/retrieval-augmented-generation-rag-b62f7e22e0b8?source=rss-013c0d7e7be2------2</link>
            <guid isPermaLink="false">https://medium.com/p/b62f7e22e0b8</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Damisha Wickramaarachchi]]></dc:creator>
            <pubDate>Thu, 09 Apr 2026 18:13:19 GMT</pubDate>
            <atom:updated>2026-04-09T18:13:19.493Z</atom:updated>
            <content:encoded><![CDATA[<p>RAG is a technique used in Artificial Intelligence (AI) systems (especially LLMs) to make the answers more accurate, up-to-date, and context-aware. Simply, the system doesn’t generate the answers based on memory alone. Instead, it first retrieves relevant information from external data sources and then generates the answer.</p><p>For a better understanding, assume you are in an exam, without RAG, you give answers using what you have memorized, but with RAG, you have access to your notes/books, and you quickly check them and answer. This way, you can answer more accurately. This is the thing that happens in AI systems when using RAG.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ld9mMZYU5wyet9R9P7gvLw.png" /></figure><p>The simple explanation</p><p>Retrieval -&gt; Searching for relevant information<br>Augmented -&gt; Enhancing the prompt with retrieved external knowledge<br>Generation -&gt; Producing final answer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*93ywYPziGOT20NQUfFpLjA.png" /></figure><p>Where RAG is used,<br><strong>Customer support bots<br>Internal knowledge assistance<br>Code assistance, etc.</strong></p><h3>Important components in RAG</h3><ol><li>Ingestion<br>Before retrieval, the document must be processed and stored in a system. For that, the documents must be broken down into smaller pieces (chunking).<br>Methods used for chunking : <br> - Fixed-sized chunking<br> - Semantic chunking<br> - Hierarchical chunking</li><li>Embedding models<br>After chunking the document, each chunk is converted to a numerical vector that represents the meaning of a text. These vectors are called embedding.</li><li>Vector databases<br>This is the place where your embeddings are live. It enables similarity search.<br>ex: Pinecone, Qdrant, ChromaDB, etc.</li></ol><h3>RAG design patterns</h3><ol><li>Simple RAG<br>This is the simplest form of RAG.<br> - User asks a question.<br> - RAG retrieves the relevant chunk.<br> - Stuff them into a prompt.<br> - LLM answers.</li><li>RAG with memory<br>Add a memory layer on top of the simple RAG.</li><li>Branched RAG<br>Use when one query is not enough to answer a question<br>Use LLM to decompose a user’s question into multiple sub-questions.<br>Run parallel retrieval for each of them.<br>Synthesize the results into one answer.</li><li>Hypothetical Document Embeddings<br>Asks LLM to generate a hypothetical answer for a query before it retrieves.<br>Then embed that hypothetical answer and use that as the search vector to search the vector database.<br>Improves retrieval accuracy a lot.</li><li>Adaptive RAG<br>Every query doesn’t need retrieval. Adaptive RAG decides whether the question needs a retrieval, and whether it is a:<br>simple retrieval,<br>more complex retrieval,<br>or a multi-step retrieval.</li><li>Corrective RAG<br>What happens when your retrieved documents are low quality or flat out irrelevant?<br>CRAG adds an evaluation step after the retrieval. If the retrieval score is below a confidence threshold, the system either reformulates the query and tries again or does a web search to find better information before giving the answer.</li><li>Self RAG<br>Without just retrieving information once and answering, the system checks and improves its own answer. <br>System evaluates its own output and may retrieve more information or refine the answer.</li><li>Agentic RAG<br>LLM acts as a smart assistant/agent that can take actions. <br>Instead of a single step, it can:<br>- Decide what to do next<br>- Search multiple times<br>- Use tools (APIs, databases, etc.)</li><li>Multimodal RAG<br>Use different types of data, not just text.<br>The system can retrieve text, images, audio, and videos.</li><li>Graph RAG<br>Uses relationships between data for a better understanding.<br>Here, information is stored as a graph with nodes and connections<br>This helps understand:<br>- How things are related<br>- Context between entities</li></ol><p>RAG helps AI move beyond memorization by combining retrieval with generation, to provide more accurate and context-aware responses. It is becoming a key technique in building smarter AI systems.<br>Overall, understanding RAG is essential for anyone exploring modern AI systems and their real-world applications. 🚀🤖</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b62f7e22e0b8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Object - Oriented Programming]]></title>
            <link>https://medium.com/@damishat99/object-oriented-programming-4bafc48d9bcb?source=rss-013c0d7e7be2------2</link>
            <guid isPermaLink="false">https://medium.com/p/4bafc48d9bcb</guid>
            <dc:creator><![CDATA[Damisha Wickramaarachchi]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 14:00:12 GMT</pubDate>
            <atom:updated>2024-09-19T14:00:12.761Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*Xlq8Nh7U_qzZml_rg7j4sg.jpeg" /></figure><p>In this blog post, we’ll discuss the basics of OOP and its four fundamental pillars: <em>encapsulation, inheritance, polymorphism, and abstraction.</em></p><h3>Understanding Object-Oriented Programming</h3><p><strong>A. What is OOP?</strong></p><p>Object-Oriented Programming (OOP) organizes code into objects, which are instances of classes. This approach models real-world entities and their interactions, making it easier to design, implement, and maintain complex software systems.</p><p><strong>B. What is a Class and an Object?</strong></p><p>In object-oriented programming (OOP), classes and objects are fundamental concepts that work together to create structured and reusable code. Let’s explore these concepts in detail:</p><p><strong>Class</strong></p><p>A class is a blueprint or template for creating objects. It defines the attributes (data) and methods (functions) that the objects of that class will have. A class shapes objects with specific characteristics and behaviors. (Eg: consider a cookie cutter as a class that makes cookies as objects).</p><p><strong>Object</strong></p><p>An object is an instance of a class. It represents a specific entity with its own set of data and the ability to perform actions defined by its class. Objects are the concrete manifestations of the class blueprint in your program.</p><p><strong>C. Key principles of OOP</strong></p><p>The four fundamental principles of OOP are:</p><ol><li>Encapsulation</li><li>Inheritance</li><li>Polymorphism</li><li>Abstraction</li></ol><p><strong>D. Benefits of OOP in software development</strong></p><p>OOP offers several advantages in software development:</p><ul><li><strong>Modularity</strong>: Code is organized into reusable objects, making it easier to manage and maintain.</li><li><strong>Reusability</strong>: Objects can be reused across different projects, saving time and reducing code duplication.</li><li><strong>Flexibility</strong>: Polymorphism allows for more flexible and extensible code.</li><li><strong>Improved debugging</strong>: Encapsulation helps isolate issues, making it easier to identify and fix bugs.</li><li><strong>Better collaboration</strong>: OOP’s structure facilitates teamwork by allowing developers to work on different objects simultaneously.</li></ul><p>We have covered the basics of Object-Oriented Programming. Now let’s discuss the fundamental principles of OOP.</p><h3>Encapsulation: Protecting data and functionality</h3><p>Encapsulation means bundling of variables and methods inside a class. It’s like wrapping your code from a protective shield to control access to its internal workings. This will be helpful for data protection, maintainability, code organization, and flexibility. The key aspect of encapsulation is data hiding.</p><p>Eg: ATM-Customers do their transactions using a simple interface, while complex banking operations remain hidden.</p><h3>Inheritance: Building on existing code</h3><p>Inheritance helps developers to create new classes based on the existing ones. Child classes inherit properties and methods from parent classes. This helps to reduce code repetition. Inheritance is also known as “<strong>is-a</strong>” relationship.</p><p>Child classes can,</p><ul><li>Inherit all properties and methods from the parent.</li><li>Override inherited methods to provide specialized behavior.</li><li>Add new properties and methods specific to their purpose.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/1*hP_YUxniZLaOD2aDIcpYNw.jpeg" /><figcaption><strong>Types of Inheritance</strong></figcaption></figure><h3>Polymorphism: Flexibility in programming</h3><p>Polymorphism refers to “many forms”. An object can take many forms. This gives the ability to differentiate between entities with the same name efficiently. There are two main types of polymorphism:</p><p>1)Method overloading(Compile-time polymorphism)</p><p>Allows different methods to have the same name with different signatures. This improves code readability.</p><p>2)Method overriding(Runtime polymorphism)</p><p>Allows a subclass to provide a specific implementation for a method that is already defined in its superclass. This enables runtime flexibility.</p><h3>Abstraction: Simplifying complex systems</h3><p>Abstraction allows developers to hide complex implementation details and present only the essential features of an object. This helps to reduce the complexity, improves code maintainability, and enhances code reusability.</p><p>Abstract classes and interfaces are two primary tools for implementing abstraction in OOP:</p><p>1)Abstract classes:</p><ul><li>May have both abstract and concrete methods.</li><li>Will not be able to instantiate.</li><li>Provide a common base for related classes.</li></ul><p>2)Interfaces:</p><ul><li>Define a contract for classes to implement.</li><li>Can only contain abstract methods (prior to Java 8).</li><li>Allow for multiple inheritance in languages like Java.</li></ul><p>These OOP concepts are not just theoretical concepts. You can practically use them to improve the quality of your codes and the development process. Apply these concepts in your projects and experience more organized and more effective coding. Congratulations! 🎉</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4bafc48d9bcb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>