<?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 Sonakshi Arora on Medium]]></title>
        <description><![CDATA[Stories by Sonakshi Arora on Medium]]></description>
        <link>https://medium.com/@sonakshi.arora02?source=rss-2da6a7093d4b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*t7okCPw2yKzIibE_e6FtpA.jpeg</url>
            <title>Stories by Sonakshi Arora on Medium</title>
            <link>https://medium.com/@sonakshi.arora02?source=rss-2da6a7093d4b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 19:02:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sonakshi.arora02/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[Foundry IQ: Building Robust Knowledge-Grounded AI Agents]]></title>
            <link>https://medium.com/@sonakshi.arora02/foundry-iq-building-robust-knowledge-grounded-ai-agents-2178499137c7?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2178499137c7</guid>
            <category><![CDATA[azure-foundry]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 20:30:47 GMT</pubDate>
            <atom:updated>2026-03-31T20:30:47.267Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pIdZkLKTHMuaJwpMd3FRng.png" /></figure><p>Enterprise AI solutions often draw on knowledge scattered across many systems and repositories. Consolidating these sources is essential so AI agents can retrieve the right context and provide accurate, grounded answers.</p><p>Microsoft’s Foundry IQ allows us to create a multi-source knowledge base that provides AI agents with a central point to access any organisation’s data.</p><p>Foundry IQ is a bridge between your agent and enterprise data. It brings the following benefits:</p><p><strong>1. Automatic Ingestion</strong>: With Foundry IQ, you do not need manual ingestion pipelines. The task of document chunking, embedding creation, and indexing is handled by Foundry IQ.</p><p><strong>2. One Knowledge Base</strong>: A Knowledge Base can be connected to multiple Knowledge Sources such as SharePoint, Azure Blob Storage, OneLake, Web Sources, Azure AI Search to name a few.</p><p><strong>3. Agentic Retrieval</strong>: An LLM is responsible for query decomposition, finding the correct source, running parallel searches, semantic ranking for complex questions, and aggregating the results to generate the final response.</p><p><strong>4. Citation-backed Responses</strong>: Each answer references the source documents it was drawn from.</p><h3>The Three Pillars of Foundry IQ</h3><ol><li><strong>Knowledge Base:</strong> This is a single queryable index built from multiple Knowledge Sources. With Foundry IQ, multiple agents can share the same Knowledge Base. A Knowledge Base lives inside AI Search Resource such as Azure AI Search Index.</li><li><strong>Knowledge Sources:</strong> This is where the data lives — Foundry IQ supports sources such as Azure Blob Storage, Azure AI Search Index, Microsoft SharePoint, Microsoft OneLake, and Web Links.</li><li><strong>Agentic Retrieval: </strong>An LLM-powered retrieval pipeline that handles document ingestion, chunking, vectorization, and indexing.</li></ol><h3>Working</h3><p>A knowledge base in Foundry IQ is connected to a Foundry Agent using MCP (Model Context Protocol) that facilitates tool calls.</p><p>When invoked by the agent, the following actions are performed in the Agentic Retrieval segment:</p><p>1. The user query is planned and decomposed to subqueries</p><p>2. Subqueries processed parallelly using keyword/vector/hybrid techniques</p><p>3. Semantic Reranking applied to use the most relevant results</p><p>4. Unified response creation with source references.</p><p>The agent’s knowledge base MCP server is configured with require_approval=’always’. This means the agent pauses before each tool call and waits for explicit approval:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*IcENoR3Ubgs-PZ5wAffDpA.png" /><figcaption>Response Generation Workflow</figcaption></figure><h3>Hands On: Connect Foundry IQ to your Foundry Agent(s)</h3><p><strong>I. Create a Foundry Project:</strong></p><p>1. Navigate to the Foundry Portal (<a href="https://ai.azure.com/">https://ai.azure.com/</a>) and ensure that the ‘New Foundry’ toggle is turned on.</p><p>2. Create a new project and configure the appropriate settings for your project.</p><p><strong>II. Create a Foundry Agent:</strong></p><p>1. On the home page, under <strong>Start building</strong>, select <strong>Create an agent</strong>.</p><p>2. Give your agent a name</p><p>3. Select <strong>Create</strong>.</p><p><strong>III. Give the Foundry Agent Instructions:</strong></p><p>In the Instructions section, copy and paste this prompt:</p><blockquote>You are a helpful AI assistant for the following:</blockquote><blockquote>1. Contoso, specializing in outdoor camping and hiking products</blockquote><blockquote>2. Contoso electronics holding information about Contoso electronics employees and their health benefits</blockquote><blockquote>3. NASA’s e-book</blockquote><blockquote>You must ALWAYS search the knowledge base to answer questions about Contoso products, NASA-related questions or questions related employee benefits for Contoso Electronics. Provide detailed, accurate information and always cite your sources.</blockquote><blockquote>If you don’t find relevant information in the knowledge base, say so clearly.</blockquote><p>Click on <strong>Save.</strong></p><p><strong>IV. Connecting to Foundry IQ:</strong></p><p>1. Navigate to the Knowledge section on the left.</p><p>2. Click on <strong>Connect to an AI Search resource </strong>dropdown and then <strong>Create new resource</strong>. This should open up the Azure Portal in a new tab.</p><p>3. Create a new <strong>Azure AI Search Resource </strong>in the Azure Portal. Make sure you use the same resource group for all the resources.</p><p>4. I used the following links to source data for my agent:</p><p><a href="https://github.com/MicrosoftLearning/mslearn-ai-agents/raw/main/Labfiles/04-integrate-agent-with-foundry-iq/data/contoso-products.zip">https://github.com/MicrosoftLearning/mslearn-ai-agents/raw/main/Labfiles/04-integrate-agent-with-foundry-iq/data/contoso-products.zip</a></p><p><a href="https://github.com/Azure-Samples/azure-search-sample-data/tree/main/nasa-e-book/earth_book_2019_text_pages">azure-search-sample-data/nasa-e-book/earth_book_2019_text_pages at main · Azure-Samples/azure-search-sample-data</a></p><p><a href="https://github.com/Azure-Samples/azure-search-sample-data/tree/main/health-plan">azure-search-sample-data/health-plan at main · Azure-Samples/azure-search-sample-data</a></p><p>Download and unzip the folders to extract the PDFs.</p><p>5. Navigate to the resource group and create a new <strong>Storage Account</strong> resource (e.g. foundryiqagentsa)</p><p>6. Go to the storage account &gt; Data Storage &gt; Containers and create 3 containers to upload the PDFs:</p><p><em>a. contosoelectronics (Upload the PDFs from the health-plan directory)</em></p><p><em>b. contoproducts (Upload the PDFs from the contoso-products directory)</em></p><p><em>c. nasabook (Upload the PDFs from the nasa-e-book/earth_book_2019_text_pages directory)</em></p><p>7. Go back to the Foundry Portal and refresh it. In the dropdown menu, you should be able to see the Azure AI Search we created in step 3 of this section). Select <strong>API Key</strong> for Auth Type and click <strong>Connect.</strong></p><p>8. On the Foundry IQ Page inside the knowledge base you just created and connect, fill the following:</p><p><em>a. Chat completions model: gpt-4.1</em></p><p>Leave everything else as default</p><p>9. In the Knowledge Sources section, click on <strong>Create New </strong>and choose<strong> Azure Blob Storage.</strong></p><p>10. Fill the following:</p><p><em>a. Name: </em><strong><em>ks-contosoproducts</em></strong></p><p><em>b. Storage Account: &lt;Name of your storage account&gt;/ </em><strong><em>foundryiqagentsa</em></strong></p><p><em>c. Container name: </em><strong><em>contosoproducts</em></strong></p><p><em>d. Authentication Type: </em><strong><em>API Key</em></strong></p><p><em>e. Content extraction mode: </em><strong><em>Minimal</em></strong></p><p><em>f. Embedding model: </em><strong><em>text-embedding-3-small</em></strong></p><p><em>g. Chat completions model: </em><strong><em>gpt-4.1</em></strong></p><p>Click on<strong> Create</strong></p><p>11. Repeat the same steps for the other 2 storage accounts.</p><p>12. Once done click on <strong>Save</strong> in the top right corner. We just added knowledge sources to our knowledge base!</p><p><em>P.S.: You can go to the </em><strong><em>Azure AI Search Resource</em></strong><em> in Azure Portal and in the Agentic Retrieval section see the Knowledge Sources and Knowledge Bases we just made</em></p><p><strong>V. Test the Agent in the Playground:</strong></p><p>1. Go to the <strong>Agents</strong> tab and choose your agent</p><p>2. Try asking it questions such as:</p><p><em>a. Tell me the perks offered to Contoso Electronics employees?</em></p><p><em>b. What types of tents does Contoso offer?</em></p><p><em>c. What camping accessories are available?</em></p><p><strong>VI. Access the Agent using Microsoft Agent Framework:</strong></p><p>Use this <a href="https://github.com/SonakshiA/foundry-iq-agent">GitHub repository</a> to access your agent via python code.</p><h3>References:</h3><p><em>1. </em><a href="https://microsoftlearning.github.io/mslearn-ai-agents/Instructions/Exercises/04-integrate-agent-with-foundry-iq.html"><em>Integrate an AI agent with Foundry IQ | Develop AI Agents in Azure</em></a></p><p><em>2. </em><a href="https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/foundry-iq-connect?tabs=search%2Cpython"><em>https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/foundry-iq-connect?tabs=search%2Cpython</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2178499137c7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Gentle, Hands-on Introduction to LangGraph]]></title>
            <link>https://medium.com/@sonakshi.arora02/a-gentle-hands-on-introduction-to-langgraph-7a65f24937b2?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a65f24937b2</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[ai-agent-development]]></category>
            <category><![CDATA[azure-foundry]]></category>
            <category><![CDATA[langgraph-tutorial]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Fri, 31 Oct 2025 06:20:08 GMT</pubDate>
            <atom:updated>2025-10-31T06:25:35.411Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we’ll understand the basics of LangGraph — the framework that powers AI agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*OBheqJBfRhEiYQGgtm7yBw.png" /></figure><p><em>I wish to take a moment to alert the readers — there is only so much that can be done in a blog to prevent it from becoming a textbook. This blog will not cover all the elements of LangGraph in the demo. However, I shall give you all the resources I used which will fill the gaps. Please proceed to read the blog only if you’re okay with this fact. Thanks!</em></p><h3><strong>Our Agenda:</strong></h3><ol><li>Understanding TypedDict</li><li>Elements of LangGraph</li><li>A demo to make simple graphs (not AI-powered) using LangGraph</li><li>A GitHub repository that shows how to make an AI Agent</li></ol><h3><strong>TypedDict:</strong></h3><p>This is a data structure which is a stricter form of dictionaries in python.</p><p>We declare the key name we want and the expected data type for the key in TypedDict. This enforces type safety.</p><p>This is different from a dictionary wherein one can add any key names with any data types and overwrite them easily.</p><p>Here is what it looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/609/1*tXc1vC5J8_h15-4tvYRtnw.png" /><figcaption>Code Snippet to Understand TypedDict</figcaption></figure><p>The Movie class inherits from TypedDict class (the base class). Its keys — name and year are explicitly stated along with the expected datatype. ‘movie’ is the dictionary that conforms to the ‘Movie’ type.</p><p>Internally, it is equivalent to:</p><pre>movie = {‘name’: ‘Avengers Endgame’, ‘year’: ‘2019’}</pre><p>We will be using TypedDict datatype to declare the <strong>state </strong>of our graph. More on that in the next section!</p><h3><strong>Elements of LangGraph:</strong></h3><p>This is a simple visualization to help you understand the various elements of the LangGraph framework:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xT2PVI0scztqp-tyEEXQJw.png" /><figcaption>Elements of LangGraph</figcaption></figure><ol><li><strong>State</strong>: It is the memory of the application. State uses the TypedDict data structure to store the context/information related to the entire application.</li><li><strong>Nodes</strong>: These are individual functions that perform specific tasks in the graph (say for a calculator graph, ‘addition’ and ‘subtraction’ will be individual nodes). A node takes in the current state as its input and returns the current or the update state as the output.</li><li><strong>Graph</strong>: Connection of all the nodes forms the graph.</li><li><strong>Edges</strong>: Connection between nodes. They guide the flow of events — which event needs to be executed next.</li><li><strong>Conditional edges</strong>: Decide the next node to be executed based on some conditions.</li><li><strong>Start</strong>: Virtual entry point to the graph where the workflow begins</li><li><strong>End</strong>: Represents the conclusion of the workflow in the graph</li><li><strong>Tools</strong>: These are utilities that nodes can use to perform their tasks. For example: A node can use a database to get information (making the database a tool) or use an API to fetch data (making the API a tool).</li><li><strong>ToolNode</strong>: This is just a node whose main job is to run a tool. <br>Analogy: An operator (ToolNode) controls a machine (Tool) and takes the results back to an assembly line.</li><li><strong>StateGraph</strong>: This is a class in LangGraph to build and compile the graph structure. It manages the nodes, edges and the overall state.</li><li><strong>Messages</strong>: These are the fundamental units of communication with our AI agents. <br>Each message has a role (HumanMessage, SystemMessage, etc.) and context (text, multimodal data such as pdfs, images, videos). <br>This illustration shows the different roles associated with a message:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqAk-UpPCzdJYY__iutF6w.png" /><figcaption>Various Roles in Messages</figcaption></figure><h3><strong>Making Simple Graphs using LangGraph:</strong></h3><p>We’ll make a simple agent (not AI-powered) that greets us. This activity is just to show readers how the elements we covered in the previous section are implemented.</p><pre># importing the libraries<br>from typing import Dict, TypedDict<br>from langgraph.graph import StateGraph</pre><p>In the below snippet, we create the AgentState that holds messages.</p><pre># creating a state for the agent<br>class AgentState(TypedDict):<br>    message: str</pre><p>Now, we create a node whose functionality is to greet.</p><p><em>Make sure you always include the docstrings when creating nodes. While this example doesn’t use any LLM, the docstrings tell the LLM what the function of that particular node is.</em></p><pre># the input type of a node is a state, and the output type is also a state<br>def greeting_node(state: AgentState) -&gt; AgentState:<br>    &quot;&quot;&quot;<br>    A simple node that adds a greeting message to the state.<br>    &quot;&quot;&quot;<br>    <br>    state[&#39;message&#39;] = &quot;Hey &quot; + state[&#39;message&#39;] + &quot;, Welcome to LangGraph!&quot;<br>    return state</pre><p>We now build our graph:</p><pre># build the state graph<br>graph = StateGraph(AgentState)<br><br># add the node to the graph<br>graph.add_node(&quot;greeter&quot;, greeting_node) # greeter is the name of the node   <br>graph.set_entry_point(&quot;greeter&quot;) # specifies where execution should start.<br>graph.set_finish_point(&quot;greeter&quot;) # specifies where execution should end.<br><br>app = graph.compile() # compile the graph</pre><p>Let us invoke this graph:</p><pre>result = app.invoke({&quot;message&quot;: &quot;Sonakshi&quot;}) # invoke the graph<br>result[&#39;message&#39;]</pre><p>It should return<strong><em> ‘Hey Sonakshi, Welcome to LangGraph!’</em></strong></p><p>We can display the graph structure as well:</p><pre><br># display the graph using the IPython library<br><br>from IPython.display import Image, display<br>display(Image(app.get_graph().draw_mermaid_png()))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/159/1*99rj3p5ukWfP_UeGk5HNcw.png" /><figcaption>The graph we just implemented has this structure</figcaption></figure><p>We just created a very basic agent!</p><p>If you wish to learn how edges work in a graph to build something like what is shown in the image below, follow this: <a href="https://github.com/SonakshiA/LangGraph-Demo/blob/master/Simple%20Agents/Conditional_Agent.ipynb">LangGraph-Demo/Simple Agents/Conditional_Agent.ipynb at master · SonakshiA/LangGraph-Demo</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*fJbqho-O9V2LRxkTNCYERg.png" /><figcaption>A graph with conditional edges</figcaption></figure><h3>Building an AI agent:</h3><p>Pre-requisites for this tutorial:</p><ul><li>The user should have an OpenAI resource created in their Azure subscription and any model deployed in the AI foundry.</li><li>The user should create a .env file with the secrets in the root folder as shown in the .template.env file.</li><li>The user should have SQLite extension installed in their VSCode to explore the SQLite database.</li></ul><p>Our use case is to <strong>build an AI agent that cleans up csv files.</strong></p><p>Follow this repository: <a href="https://github.com/SonakshiA/LangGraph-Demo/blob/master/Agentic%20AI/agentic_csv_cleaner.ipynb">LangGraph-Demo/Agentic AI/agentic_csv_cleaner.ipynb at master · SonakshiA/LangGraph-Demo</a></p><h3>Resources:</h3><ul><li><a href="https://www.youtube.com/watch?v=jGg_1h0qzaM">LangGraph Complete Course for Beginners — Complex AI Agents with Python</a> (This is the one I used to learn LangGraph)</li><li><a href="https://academy.langchain.com/courses/intro-to-langgraph">Foundation: Introduction to LangGraph</a></li><li><a href="https://medium.com/pythoneers/building-ai-agent-systems-with-langgraph-9d85537a6326">https://medium.com/pythoneers/building-ai-agent-systems-with-langgraph-9d85537a6326</a></li><li><a href="https://github.com/SonakshiA/LangGraph-Demo/tree/master">SonakshiA/LangGraph-Demo: PoCs for understanding LangGraph concepts</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a65f24937b2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Practical Guide to Understanding MCP Servers]]></title>
            <link>https://medium.com/@sonakshi.arora02/a-practical-guide-to-understanding-mcp-servers-584c99973425?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/584c99973425</guid>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[github-copilot]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Thu, 30 Oct 2025 06:30:03 GMT</pubDate>
            <atom:updated>2025-10-31T06:21:57.326Z</atom:updated>
            <content:encoded><![CDATA[<p>In November 2024, Anthropic announced a new protocol known as MCP — Model Context Protocol which is increasingly gaining popularity.</p><p>Through this blog, I will demystify the protocol and why it’s the talk of the town.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/554/1*mIDhCOXCuBJx3glr5JD3_w.jpeg" /></figure><h3><strong>Understanding the Problem</strong></h3><p>An LLM is as good as the data it is trained on. Which is to say, they constantly need to be trained on evolving and updated data, otherwise they will be frozen in time.</p><p>It is simply not possible to re-train the model by appending the new data with the old data in order to update a model’s knowledge. That is an expensive, time-consuming, and altogether a futile process to undertake.</p><p>LLMs can be connected with external knowledge bases to train them on newer data. Connecting, LLMs to these external knowledge bases is a very messy process that MCP seeks to solve.</p><p>Now, why is it a messy process? Because developers had to write code for each data source the LLM had to be connected to. So, there is a different plugin if you want to use Slack as your knowledge base, a different plugin for Google Drive, a different one for OneDrive and so on.</p><p>Take one more example — If an LLM has a plugin for Microsoft Teams, it can access your calendar and take actions on that. However, if there is no plugin designed for Google Calendars, then the same LLM cannot check your calendar and work with it.</p><p>Before MCP, say you wanted your LLM to interact with Gmail, you will have to create a tool for every possible interaction.</p><ol><li>“Send Email” will be an independent tool</li><li>“Create a Draft” will be another independent tool</li><li>“Get Message” will be a tool</li><li>“Delete Email” will be a tool</li><li>“Schedule Email” will be a tool</li></ol><p>Each of these tools will need its own API integration and configuration making it a tedious process to connect LLM with external tools.</p><h3><strong>The Solution</strong></h3><p>MCP introduces a standard wherein an LLM connects to a single MCP server (say, a Gmail MCP Server). This server exposes all the capabilities such as “Send Email”, “Create a Draft”, “Get Message”, “Delete Email”, “Schedule Email” in one package. <strong><em>No custom integrations needed.</em></strong></p><p>Now, you may ask “Gmail will have its own server, Notion its own, Slack its own, and GitHub its own. So, where does the universal standardization come in?”</p><p>But the <em>universal standardization</em> in MCP doesn’t mean there’s one universal server — it means there’s one <strong>universal <em>protocol</em></strong>. So, it doesn’t mean “one server for everything”, it means “one consistent way to connect to any server”.</p><p>Every MCP Server (Notion, Slack, Gmail) communicates in the same way to the LLM. Here is what it means:</p><ol><li>Every server tells the LLM what capabilities it has (what it can do) in the same way:</li></ol><pre> {<br>   &quot;server&quot;: &quot;gmail-mcp&quot;,<br>   &quot;capabilities&quot;: [<br>     &quot;send_email&quot;,<br>     &quot;create_draft&quot;,<br>     &quot;get_message&quot;,<br>     &quot;delete_email&quot;,<br>     &quot;schedule_email&quot;<br>   ]<br> }<br><br> {<br>   &quot;server&quot;: &quot;notion-mcp&quot;,<br>   &quot;capabilities&quot;: [<br>     &quot;create_page&quot;,<br>     &quot;fetch_page&quot;,<br>     &quot;add_comments&quot;<br>   ]<br> }<br> <br> {<br>   &quot;server&quot;: &quot;jira-mcp&quot;,<br>   &quot;capabilities&quot;: [<br>     &quot;create_tickets&quot;,<br>     &quot;update_ticket_status&quot;,<br>     &quot;close_ticket&quot;<br>   ]<br> }</pre><p>All three servers (Gmail, Notion, and Jira) tell their capabilities to the LLM in the same format.</p><p>2. Every server authenticates (API Keys, OAuth) in the same way to the LLM. There is no custom connection per application.</p><p>3. The requests sent by the LLM to the server, and the responses sent by the server to the LLM also have the same JSON structure.</p><p>Here is what I mean by that:</p><pre> # For gmail-mcp:<br> # Request<br> {&quot;call&quot;: &quot;send_email&quot;, &quot;args&quot;: {&quot;to&quot;: &quot;alice@example.com&quot;, &quot;subject&quot;: &quot;Greeting&quot;, &quot;body&quot;: &quot;How are you?&quot;}}<br> <br> # Response<br> {&quot;status&quot;: &quot;success&quot;, &quot;message_id&quot;: &quot;abc123&quot;}<br><br> # For notion-mcp:<br> # Request<br> {&quot;call&quot;: &quot;create_page&quot;, &quot;args&quot;: {&quot;database_id&quot;: &quot;db123&quot;, &quot;title&quot;: &quot;Project Plan&quot;, &quot;content&quot;: &quot;Initial draft&quot;}}<br> <br> # Response<br> {&quot;status&quot;: &quot;success&quot;, &quot;page_id&quot;: &quot;p789&quot;}</pre><p>So the call and args parameters in the request JSON, and the status and id parameter in the response JSON are same independent of the server being communicated with.</p><h3><strong>MCP Architecture</strong></h3><p>MCP operates on <strong>client-server architecture.</strong></p><p><strong>MCP Host: </strong>The LLM (Claude, Gemini, ChatGPT)</p><blockquote>It says — “I know what to do, but I need someone to handle it for me”</blockquote><p><strong>MCP Client:</strong> Maintains connection to MCP Server and obtains context (list of capabilities) from the MCP Server for the MCP Host to use</p><blockquote>It says — “I know where the tools live”</blockquote><p><strong>MCP Server: </strong>This is where the action happens. It is where the actual capabilities live.</p><blockquote>It says — “I have the actual tools and know how to perform the actions you ask for.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*G_MbzhzDL_HsbJh9Z4PmgA.png" /><figcaption>MCP Architecture Diagram</figcaption></figure><h3><strong>Exploring the Notion MCP Server (Hands-on Time)</strong></h3><p>Let us play around with the Notion MCP Server’s capabilities.</p><p><strong>Pre-requisites:</strong></p><ol><li>VSCode IDE.</li><li>Node.js (npm) must be installed on your system.</li><li>GitHub Copilot must be configured in your VSCode.</li></ol><p>Follow the steps to set-up and run an <strong>MCP Server on your local.</strong></p><p>Go to Notion and do the following:</p><ol><li>Login and create a new page called <strong>“Notion MCP”</strong></li><li>Go to <a href="https://www.notion.so/profile/integrations/">https://www.notion.so/profile/integrations/</a> and Click on <strong>New integration</strong></li></ol><ul><li>For Integration Name, put <strong>MCP</strong></li><li>Select an Associated Workspace from the dropdown</li><li>Type must be <strong>Internal</strong></li><li>Click on <strong>Save</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sUGrtK785DH3ZTFLWiSLyQ.png" /><figcaption>Step 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ZjpGBNwEcYJKtA0nSfCXA.png" /><figcaption>Step 2</figcaption></figure><p>3. Go to the Configuration tab and under the Capabilities section enable <strong>Read Comments</strong> and<strong> Insert Comments</strong>. Save it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YZWeuRgelQMisF1wFRWH3w.png" /><figcaption>Step 3</figcaption></figure><p>4. Go to the <strong>Access tab</strong> (next to Configuration tab) and click on <strong>Edit Access.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*prlCifck6ApMcpWK-rTFfQ.png" /><figcaption>Step 4</figcaption></figure><p>5. Search for <strong>“Notion MCP”</strong>. It should show the Notion MCP page we created in Step 1. Select it from the dropdown. Click on <strong>Save</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XyLpW4aI2EokAUxwdzQ73A.png" /><figcaption>Step 5</figcaption></figure><p>6. Go back to the Configuration tab. Copy the<strong> Internal Integration Secret.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vtsow7Khq0NKpt9P8Fw6-w.png" /><figcaption>Step 6</figcaption></figure><p>Go to VSCode and do the following:</p><ol><li>Create a folder and name it <strong>.vscode</strong></li><li>Inside the folder, create an <strong>mcp.json </strong>file</li><li>Write the following snippet in the file. Make sure to paste the <strong>Internal Integration Secret</strong> you copied in <strong>step 6</strong> in the placeholder:</li></ol><pre> {<br>   &quot;servers&quot;: {<br>     &quot;notionApi&quot;: {<br>       &quot;command&quot;: &quot;npx&quot;,<br>       &quot;args&quot;: [&quot;-y&quot;, &quot;@notionhq/notion-mcp-server&quot;],<br>       &quot;env&quot;: {<br>         &quot;OPENAPI_MCP_HEADERS&quot;: &quot;{\&quot;Authorization\&quot;: \&quot;Bearer &lt;Your-Internal-Integration-Secret&gt;\&quot;, \&quot;Notion-Version\&quot;: \&quot;2022-06-28\&quot; }&quot;<br>       }<br>     }<br>   }<br>}</pre><p>4. Save the File. You will see a <strong>“Start”</strong> button. Click on it to start your server!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nAxXvVt-q2QuOVO5_rZVSQ.png" /><figcaption>The Start Button</figcaption></figure><p>5. Use GitHub Copilot as the MCP Host. Paste the following prompt<strong>:</strong></p><blockquote><strong>“Inside the Notion MCP page, create a detailed blog titled “How to write good code”. It should have 4 paragraphs”.</strong></blockquote><p>Wherever it shows the <strong>blue Allow Button</strong>, click on the dropdown arrow and select <strong>“Use this workspace”.</strong></p><p>6. Voila! If your setup is correct, it will go ahead and create a new page and embed it in your<strong> “Notion MCP” page</strong>. Go ahead and check it out.</p><p>7. You can also use this prompt to further play around with the server’s capabilities <em>(Spoiler: This is why we had enabled </em><strong><em>Read Comments</em></strong><em> and</em><strong><em> Insert Comments</em></strong><em> in Notion😉)</em></p><blockquote><strong>“Read the page “How to write good code” and leave comments on how to make the introduction more engaging”</strong></blockquote><p>That’s been a look at MCP Servers!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=584c99973425" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Powering the Future: How AI is Transforming the Energy Sector for a Sustainable Tomorrow]]></title>
            <link>https://medium.com/@sonakshi.arora02/powering-the-future-how-ai-is-transforming-the-energy-sector-for-a-sustainable-tomorrow-e80b1985a305?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e80b1985a305</guid>
            <category><![CDATA[smart-meter]]></category>
            <category><![CDATA[energy-sector]]></category>
            <category><![CDATA[smart-grid]]></category>
            <category><![CDATA[microgrid]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Mon, 02 Dec 2024 18:56:19 GMT</pubDate>
            <atom:updated>2024-12-02T18:59:40.109Z</atom:updated>
            <content:encoded><![CDATA[<p>AI x Energy Sector</p><h3>Brief Description</h3><p>This article examines how artificial intelligence (AI) is transforming the energy industry, contributing to a 75% reduction in global greenhouse gas emissions and accelerating the transition to sustainable energy. By evaluating data from smart meters to forecast power use, peak demand, and maximize grid maintenance, artificial intelligence (AI) improves grid stability. AI helps anticipate infrastructure problems, from Duke Energy’s methane leakage monitoring to fault detection in China’s transmission lines, ensuring a more robust and sustainable energy future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*A3GmQLV1xSu-sQ9C.jpg" /><figcaption>Artificial Intelligence in the Energy Sector</figcaption></figure><p>In 2023, the International Energy Agency touted AI and Energy to be the next power couple. Artificial Intelligence can have an indelible effect in reimagining and reshaping our existing energy systems, and drive us towards a more equitable and sustainable landscape with respect to energy distribution.</p><p>Currently, the energy sector contributes towards 75% of the total greenhouse gas emissions with the rampant burning of coal,oil and gas to generate electricity. This calls for a shift to cleaner and renewable energy sources.</p><p>The installations of smart meters aid in recording crucial information such as voltage levels, real-time power consumption data, peak usage times, and cost information. Furthermore, key insights into consumers’ usage patterns can be derived from smart meters. The data collected from smart meters can be valuable for ML algorithms enabling predictive analytics for consumption patterns, scheduling grid maintenance, and optimizing energy flow for grid stability.</p><p>The power output from renewable sources of energy such as windmills and solar panels is highly variable, since the sun doesn’t always shine and winds don’t always blow. ML algorithms can take weather data and predict outputs for these renewable energy sources much in advance for better grid stability, divesting them of their traditionally unpredictable nature. Researchers at Google and DeepMind have developed a deep neural network that predicts the availability of wind power 36 hours in advance using weather forecasts and historical turbine data. Their ML algorithm has also bolstered wind power production by 20%.</p><p>AI can be leveraged to forecast demand and supply of energy allowing utilities to plan energy use more efficiently. It can also be used to predict maintenance for physical energy assets such as transmission and distribution cables and monitor them for faults leading to reduced downtimes.</p><p>Marking a watershed moment in integrating AI into the Chinese power industry, The State Grid Corporation of China announced that it developed a technology that uses AI to monitor UHV cables for heat fluctuations caused by faults in the transmission lines. This technique can be used to detect fault points in infrared images of transmission lines and eliminate risks that may cause power outages. The introduction of AI into their energy systems ensures stability in power grid operations, especially during summer months when power consumption is at its highest.</p><p>Duke Energy in collaboration with Microsoft , Accenture and Avenade built a custom solution to achieve net-zero Methane emissions by 2030. The platform monitors natural gas pipelines for leakage by measuring emissions from natural gas utilities, and collecting data from on-ground sensors. The data is then assessed by AI to generate real-time updates so that any leakages can be repaired quickly. This prevents methane, a greenhouse gas, from entering the atmosphere.</p><figure><img alt="4 Stages of Power Generation" src="https://cdn-images-1.medium.com/max/800/0*bosFLWjP3JuzT7gl.jpg" /><figcaption>Four Stages of Power Generation</figcaption></figure><p>Broadly speaking, the power grid constitutes of 4 key stages:</p><ol><li><strong>Power Generation</strong>- This is achieved by a concoction of conventional sources (coal, oil and gas), nuclear energy and renewable sources of energy. At this stage, using weather forecasts, the availability of renewable energy sources can be determined. Secondly, when it comes to energy storage optimisation, AI is used to forecast the demand and supply to store and release energy accordingly. This minimizes waste and ensures sufficient energy is supplied at peak hours that keeps the grid stable.</li><li><strong>Power Transmission</strong>- Energy generated is transported to transformers in substations. At this stage, AI-driven predictive modeling can be used to adjust the voltages so as to reduce energy loss during transmissions over long distances.</li><li><strong>Energy Distribution</strong>- Energy at substations is routed to homes, factories and farms for consumption. AI can be leveraged for predictive maintenance of infrastructure by detecting wear and tear or overheating. This reduces downtime and brings down repair costs.</li><li><strong>Energy Consumption</strong>- Consumers’ daily energy consumption levels vary greatly causing stress on the grid. AI can derive insights from the consumer data and give personalized recommendations for energy savings. It can also be used to recommend off-peak hours so that consumers can shift their consumption to those times which helps reduce stress on the grid and the costs incurred by consumers. By studying consumers’ usage patterns, AI can detect anomalies such as power theft.</li></ol><p>Incorporating AI into the power grid system is a step forward in higher renewable energy generation and integration, reducing reliance on fossil fuels thereby cauterizing harmful emissions, creating smart and resilient cities, reducing costs for all participating actors and ensuring an equitable energy distribution across all strata of society.</p><h3><strong>Further Reading:</strong></h3><ol><li><a href="https://codegreenasia.substack.com/p/issue-01">https://codegreenasia.substack.com/p/issue-01</a></li><li><a href="https://www.iea.org/commentaries/why-ai-and-energy-are-the-new-power-couple">https://www.iea.org/commentaries/why-ai-and-energy-are-the-new-power-couple</a></li><li><a href="https://power.nridigital.com/power_technology_mar18/the_resilience_programme_higashi_matsushimas_microgrid_renewal">https://power.nridigital.com/power_technology_mar18/the_resilience_programme_higashi_matsushimas_microgrid_renewal</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e80b1985a305" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Black Box: The Importance of Explainable AI]]></title>
            <link>https://medium.com/@sonakshi.arora02/unveiling-the-black-box-the-importance-of-explainable-ai-8fc4e06f5094?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/8fc4e06f5094</guid>
            <category><![CDATA[explainable-ai]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Sat, 24 Aug 2024 13:04:36 GMT</pubDate>
            <atom:updated>2024-08-24T13:04:36.556Z</atom:updated>
            <content:encoded><![CDATA[<p>Enhancing Accountability and Trust in Machine Learning Systems</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/0*vwdIxtW-BeYZQ-xj" /><figcaption>Difference between AI and Explainable AI (xAI)</figcaption></figure><p>As AI permeates into the various facets of our life from banking and finance, to defence, law and order, and healthcare, there is a pressing need for AI models to explain and justify their reasoning behind arriving at a certain conclusion or result. This has given birth to a burgeoning field of research and development known as Explainable AI (xAI).</p><p>Traditional AI that exists in today’s time is referred to as <strong>blackbox </strong>AI. This means that we simply do not know why and how it yielded a certain response. Current AI learns from a training dataset and then answers questions based on what it has learnt. This is essentially a blackbox model since it simply answers the question without explaining its rationale.</p><p>In many applications where AI is leveraged, it is imperative that the AI model is able to explain how an answer has been obtained to foster trust and confidence towards the users. For example- say we are using AI to detect whether a medical scan contains a malignant (cancerous) tumour. Current AI systems simply return a “Yes” or a “No” without any further elaboration. Moreover, it is an established fact that AI systems are not 100% accurate. Thus, providing insights into its decision-making strategies will not only induce trust but will help eradicate any errors it may have committed which gives a false diagnosis. xAI seeks to provide AI with the ability to answer questions such as “why” and “how”?</p><p>As we continue to leverage AI in nearly every field, it is as important to understand how an answer was obtained as obtaining the answer. Blackbox AI models do not win the trust of its users and neither do they inspire any confidence due to their inability to explain their own decisions. This opens doors to a lot of inaccuracies that entail a myriad of consequences. Say AI is being used in a judicial system; there have been multiple known instances where the AI model has acquitted known offenders causing serious trouble for the people and raising questions on the veracity of the judicial system to dispense fair justice.</p><p>This scrupulously written review paper [1] considers two examples to demonstrate the dire need for xAI:</p><ol><li>In the oil industry, there is a need for stable combustion for furnace operations. However, this gives rise to a possibility of furnace flooding’s occurrence wherein there is an accumulation of incompletely combusted fuel in the firebox leading to hazards such as firebox explosions. Machine learning is employed here to collect data from all sensors and predict the risk of an explosion at least 30 minutes prior to the event. xAI will also supply us with the contributing factors that may lead to the prediction of an explosion occurring, thus saving investigation time and quickly rectifying the issue.</li><li>Consider a video threat detection system that flags based on the detection of unsafe scenarios/ capturing known criminals — it needs to explain its rationale behind raising alerts to ensure the integrity and lack of biases in the model, otherwise, the authority of the entire system will become decrepit. It is important to have sufficient evidence before suspecting a person.</li></ol><p>If AI percolates in nearly all aspects and use cases, it has to be reliable, unbiased, and rational further setting an impetus to develop and adopt xAI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X-2q5QhDmOJi6-tO0zKA1A.jpeg" /><figcaption>Principles of xAI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2fuCYCn9CRM8SeQMpA-rLQ.jpeg" /><figcaption>Categories of xAI Techniques</figcaption></figure><p>xAI techniques are classified into two categories:</p><ol><li><strong>Transparent Methods </strong>— The inner workings of the method are easy to interpret and understand, and thus the decision-making process becomes highly transparent. There is a discernible linear relationship between the data. Examples include logistic regression, K-nearest neighbors, decision trees, Bayesian model.</li></ol><p>Transparent methods satisfy the following properties:</p><ul><li>Simulatability: Any human can easily simulate the model</li><li>Decomposability: Each aspect of the model can be explained (such as the input data, the hyperparameters, and the inherent calculations to arrive at the output)</li><li>Algorithmic Transparency: The decision-making is transparent for the users.</li></ul><p>2. <strong>Post-hoc Methods</strong>: Come into the picture when the internal features are complex and the relationship between data is nonlinear. They are further divided into two categories:</p><p>2.1. Model-agnostic: These are explanation techniques that can be applied to any AI model regardless of its underlying architecture/algorithms. Examples include LIME and SHAP, Counterfactual Explanation techniques employed to justify an AI model’s decision-making strategy. Model agnostic methods seek to understand the response of a blackbox model.</p><p>2.2. Model-specific: These techniques take into consideration the underlying algorithm that an AI model uses to explain the rationale behind its predictions. Examples include Feature Importance techniques and Layer-wise Relevance Propagation (LRP).</p><p>We’ll attempt to gain a high-level understanding of some of the post-hoc techniques from both categories:</p><p><strong>LIME — Local Interpretable Model-agnostic Explanations (Model-agnostic):</strong> Let’s say we have a complex model that predicts if a particular image is that of a dog. What LIME does is it creates multiple variations of that image by making small changes — such as adding pixels, blurring certain regions, or removing certain parts of the image. These varying images are called perturbations. These perturbations are given back to the model to observe how the prediction changes.</p><p>LIME then takes these perturbed images and the corresponding predictions and builds a simpler model to explain the original model’s complex behaviour. This simple model provides insights into which features are the most important to make the original prediction.</p><p><strong>Counterfactual Explanation (Model-agnostic)</strong>: Counterfactual explanations explain predictions by showing how the input would need to change to get a different prediction. For instance — If a loan application is denied, a counterfactual explanation might show that if the applicant had slightly higher income or fewer existing debts, it would have been approved.</p><p><strong>Feature Extraction (Model-specific):</strong> It seeks to find out the most important features that contribute towards the decision taken by an algorithm. To give a rudimentary example — in a model that diagnoses anemia, the blood profile (hemoglobin) will have higher importance than BMI.</p><p><strong>Saliency Maps (Model-specific): </strong>They show which parts of an image or a video are important for deriving a conclusion in the case of convolutional neural networks (CNNs).</p><p>With the rapid development of AI, it is critical to ensure that their decision-making process is free of any bias making xAI models indispensable when it comes to the scopes of medicine, justice, defence, and banking. I hope this article helps you in understanding the core concepts of xAI lucidly!</p><h4>Cited Links:</h4><p>[1] <a href="https://arxiv.org/abs/2107.07045">[2107.07045] Explainable AI: current status and future directions (arxiv.org)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8fc4e06f5094" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harnessing Knowledge Graphs with Microsoft’s GraphRAG: The Future of Enterprise AI]]></title>
            <link>https://medium.com/@sonakshi.arora02/harnessing-knowledge-graphs-with-microsofts-graphrag-the-future-of-enterprise-ai-c86694d54370?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/c86694d54370</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[knowledge-graph]]></category>
            <category><![CDATA[enterprise-ai]]></category>
            <category><![CDATA[microsoft-research]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Thu, 22 Aug 2024 08:06:56 GMT</pubDate>
            <atom:updated>2024-08-22T08:06:56.983Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/824/1*4-kjty2dc4KlilZa1DGuRg.gif" /></figure><p>Since their inception in 2012 by Google, Knowledge Graphs (KGs) have continued to gain traction in the Computer Science community for their ability to model data in an organized and structured form. Just like any graph — a Knowledge Graph has vertices (nodes) and edges. The nodes denote entities/objects/events/situations and the edges represent relationships between various nodes.</p><p>Knowledge graphs come in handy because of the way they organize data, making them an indispensable design pattern in GenAI applications centered around question-answering and summarizing corpora of text. KGs provide semantically structured information which can be interpreted by computers and can be leveraged to build intelligent machines.</p><p>A knowledge graph can be represented as a set of heads, relations, and tails wherein the head and the tail are the nodes and the relation connects the entities. In the below diagram, ‘Delhi’, ‘India’, and ‘Asia’ are the nodes connected by arrows that denote the relations between them. This is a very small-scale idea of a KG, but you get the idea.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAmcwS6MOYqJektTEvRhmA.png" /><figcaption>An example of the elements in a KG</figcaption></figure><p>Knowledge graphs can be stored in any Graph Database such as Neo4j, Azure CosmosDB, Amazon Neptune, OrientDB, etc. When first introduced, knowledge graphs found application in the context of search engines:</p><ol><li>Google’s Knowledge Graph [1] was used to amass facts into an organized network of entities and relations, yielding better and more meaningful search results.</li><li>Microsoft’s Bing also uses a KG called Satori to enhance the search experience for its users.</li><li>DBPedia, and YAGO are KGs that organize information extracted from Wikipedia and present it in a semantically structured manner.</li></ol><p>The simple yet powerful concept of KGs give them a manifold of applications:</p><ol><li>The ability of KGs to handle both well-structured as well as less-organized data make them essential components of GenAI applications. Graph-based RAGs are being increasingly used to store domain-specific data for enterprise applications. GraphRAGs provide better contextual understanding and precision over traditional Vector RAGs, making them a shinier choice.</li><li>Building upon the first application, the use of Graph-based RAG shows superior performance when it comes to question-answering chatbot systems and text summarization. Introduced in 2024 by Microsoft Research [2], GraphRAG demonstrates stronger capabilities for Q&amp;A and text summarization compared to Naive RAGs on private datasets [3].</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9myU9TFuXDCJfps7" /><figcaption>Microsoft’s GraphRAG shows superior performance when it comes to connecting various dots to concoct an answer for a user query</figcaption></figure><p>3. KGs can be used to integrate textual medical information and can be retrieved and interpreted quickly [4].</p><p>4. They are useful in fraud detection by creating a network of transactions and storing metadata (such as the participants of the transactions, record times of transactions, and other relevant information). This information can be used to detect and uncover suspicious activities.</p><p>5. KGs can be used to design recommendation systems. Consider an e-learning platform — a user’s prior knowledge can be modeled into a KG and can be used to curate personal learning paths for them.</p><h3>Microsoft’s GraphRAG</h3><p>I’m going to briefly acquaint readers with GraphRAG introduced by Microsoft Research in 2024. The authors of [2] posit that RAG fails on global questions directed at an entire text corpus, such as “What are the main themes in the dataset?” for which they propose a GraphRAG approach.</p><p>Here is what the GraphRAG pipeline looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dP5bVqYABes5Qd1B" /><figcaption>GraphRAG’s Pipeline</figcaption></figure><ol><li>The source documents undergo <strong>cracking </strong>(extracting text) and <strong>chunking </strong>(breaking the extracted texts into digestible form for the LLM).</li><li>An LLM is employed to identify and extract nodes, and edges from the chunked text to create the Knowledge Graph. These are the <strong>element instances.</strong></li><li>The LLM is used to create independent summaries of the extracted entities and the relationship between the entities called <strong>element summaries.</strong></li><li><strong>Graph communities</strong> are basically groups of nodes in a graph that are highly connected to each other. Graph communities are created using community detection algorithms such as Leiden’s algorithm.</li><li>LLM is once again employed to create summaries for individual graph communities in the <strong>community summaries</strong> stage.</li><li>For a user’s prompt, intermediate <strong>community answers</strong> are generated in parallel to answer the query. The LLM ranks the answers on a scale of 0–100 based on how relevant they are in answering the prompt (This is called the helpfulness score). Community answers with low scores are filtered out since they do not contribute anything to the answer.</li><li>Finally, intermediate community answers are sorted in descending order of helpfulness score to generate the <strong>global answer</strong> for the user’s prompt.</li></ol><p>I have tried my best to provide demystified insights on the workings of Knowledge Graphs and Microsoft’s GraphRAG, and hope you find the article helpful!</p><h4>Cited Links</h4><p>[1] <a href="https://blog.google/products/search/introducing-knowledge-graph-things-not/">https://blog.google/products/search/introducing-knowledge-graph-things-not/</a></p><p>[2] <a href="https://arxiv.org/pdf/2404.16130">https://arxiv.org/pdf/2404.16130</a></p><p>[3]<a href="https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/">https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/</a></p><p>[4] <a href="https://iopscience.iop.org/article/10.1088/1742-6596/1487/1/012016/pdf">https://iopscience.iop.org/article/10.1088/1742-6596/1487/1/012016/pdf</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c86694d54370" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of RAGs: A Deep Dive into Retrieval-Augmented Generation]]></title>
            <link>https://medium.com/@sonakshi.arora02/unlocking-the-power-of-rags-a-deep-dive-into-retrieval-augmented-generation-cce8aa30eaa7?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/cce8aa30eaa7</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Wed, 21 Aug 2024 13:03:01 GMT</pubDate>
            <atom:updated>2024-08-21T13:05:08.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qtcb3Reu0qaU2qVdFuobyA.jpeg" /><figcaption>RAG stands for Retrieval Augmented Generator and is used in conjunction with an LLM</figcaption></figure><p>Large Language Models (LLMs) are trained on massive datasets (for instance, Azure OpenAI’s ChatGPT is trained on the Common Crawl dataset with petabytes of data accumulated since 2008). LLM training is a computationally expensive and time consuming process, and it simply isn’t feasible to do it at regular intervals. This poses a significant drawback in keeping the LLM updated with recent developments which may threaten the reliability and efficacy of the model. To surmount this impediment in providing users with up-to-date information, RAGs were introduced in 2020 by META.</p><p>RAG stands for Retrieval Augmented Generator; to further demystify the term — ‘Augment’ means an addition or an increase, ‘Retrieval’ means to fetch, and ‘Generator’ is a tool that creates something. So to speak intuitively, a RAG is an addition to an LLM that aids in retrieving relevant documents and generating responses.</p><p>RAGs are instrumental in keeping LLMs updated without having to retrain them regularly. RAGs also play an important role in supplying private datasets such as enterprise data to the LLM which it may not be trained on. AI applications need to support custom data to provide its users a seamless experience — consider an AI chatbot for an e-commerce platform. The chatbot must be aware about the products and their attributes to answer item-specific customer queries accurately. One more example could be that of an internal Q&amp;A chatbot used by employees to answer how many sick or caregiver leaves they are entitled to; which uses the organization’s HR data to respond to the employee. RAGs are baked into chatbots and enterprise knowledge engines to provide domain-specific responses at cheaper costs. Thus, RAGs play an architecturally indispensable role in the world of LLMs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*g_i_kApBWec_kDoxbiJPUw.png" /><figcaption>Flow Diagram to explain the working of a RAG</figcaption></figure><p>Here is how a RAG works:</p><ol><li>The custom documents first undergo <strong>cracking </strong>wherein the text is extracted from the documents supplied.</li><li>Next, the extracted text undergoes <strong>chunking </strong>which involves breaking the text into smaller digestible segments so that they do not exceed the LLM’s window size.</li><li>The chunked text is converted into mathematical representations called <strong>embeddings</strong>. Embeddings are vectors having weights and directions associated with them. To better understand embeddings, consider that you’re in a library with many books. An embedding is a special bookmark for the book that contains all important information about it like its genre, author, theme, and its relationship with other books. Similar to how books of the same genre might be positioned close to each other, embeddings representing similar words point toward the same direction.</li><li>These embeddings are then stored in a<strong> vector database</strong> (such as Redis Cache, Pinecone, Azure AI Search, etc.). When a user gives a prompt to the LLM — the prompt undergoes chunking and is converted into embeddings. It is then sent to the vector database and the similarity measure is calculated for the prompt embedding and those stored in the database. The top ‘k’ (the value of ‘k’ depends on the implementation) embeddings having the highest similarity scores with the prompt are returned to the LLM. Similarity measures vary based on the implementation but include either finding out the Euclidean Distance between the embeddings or using cosine similarity to measure the angles between the embeddings.</li><li>Since the top ‘k’ elements have the least distance with the user’s prompt, they are the responses to the user’s queries. The LLM then <strong>generates an answer</strong> for the prompt using the embeddings retrieved.</li></ol><p>While RAGs are computationally economical and save humongous training time, they have a few challenges:</p><ol><li>There is a potential risk of hallucinations — if no relevant information is found for the query, the model may return factually incorrect information based on its own internal knowledge.</li><li>There is an additional overhead due to the external search and retrieval system on top of the existing LLM.</li><li>The effectiveness of RAG is highly dependent on the quality of data provided to it. If the documents are low-quality, then there are chances that inaccuracies will percolate into the LLM-generated responses.</li><li>If the retriever has to query large datasets some latency is bound to creep into the system, impacting the response time.</li></ol><p>RAGs are a great way to make an LLM privy to private/domain-specific data cost-effectively, thereby making AI applications more customizable and personal for users. RAGs allow for keeping the LLM relevant with the latest research, statistics, or news without having to retrain the model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cce8aa30eaa7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Empowering Inclusion — Leveraging Artificial Intelligence for Improving Accessibility]]></title>
            <link>https://medium.com/@sonakshi.arora02/empowering-inclusion-leveraging-artificial-intelligence-for-improving-accessibility-27cf17b28c54?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/27cf17b28c54</guid>
            <category><![CDATA[accessibility]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[assistive-technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Thu, 28 Dec 2023 08:16:25 GMT</pubDate>
            <atom:updated>2023-12-28T08:16:55.295Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Empowering Inclusion — Leveraging Artificial Intelligence for Improving Accessibility</strong></h3><p>As someone who is keen on exploring ways to incorporate the magic of Machine Learning in Human Computer Interaction, the combination of Artificial Intelligence and accessibility is a match made in heaven.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5xv-bIyN3LRb_Fjd.jpg" /><figcaption>Digital Accessibility for Technology</figcaption></figure><p>Accessibility, in terms of development, refers to making softwares (such as websites, mobile applications, etc.) usable by as many people as possible. While the term ‘accessibility’ can be expanded to not only those with disabilities and impairments but also for issues such as slow internet connection, we shall focus on the former in this blog. Accessibility can be thought of as making software tools available to everyone equally and developing these tools to make them utilitarian for even those with certain impairments. Inviting accessibility into digital tools helps foster inclusivity amongst a gamut of age groups, ethnicities and genders.</p><p>Leveraging digital accessibility benefits users as a whole. An application providing text-to-speech synthesis not only helps those with visual and cognitive disabilities, but also to users who might be occupied in some other attention-demanding activity (such as driving) but may also wish to respond to SOS messages or emails at the same time. Adding legible texts helps not only those with weak vision but also those with perfect eyesight by making reading easier to perform.</p><p>Albeit the list is non-exhaustive, providing digital accessibility into softwares means designing for those who may suffer from vision, speech, hearing and cognitive impairments. Some of the commonplace accessibility tools that are baked into products we most use are:</p><ol><li>Text to Speech Conversion: TTS uses Natural Language Processing (NLPs) to narrate the text aloud. This technology can be beneficial for those with visual impairments (blindness, cataract and weak eyesight), The tool can be customised to alter the enunciation rate, and change the font styles to cater to those with learning disabilities such as Dyslexia and Autism. TTS converters can also be taken advantage of by people who are hard of hearing.</li><li>Optical Character Recognition using Convolutional Neural Networks can be built to scan handwritten text. Coupled with speech synthesisers, this can be an excellent tool for making content accessible to those with visual impairments. (And can be a step forward in solving the menace of deciphering sloppy handwritings 😝). This feature can also be used to preserve documents and manuscripts of historic importance.</li><li>Smart Assistants such as Siri, Alexa, and Google Assistant can make use of NLPs and provide voice interaction capabilities. This can be beneficial to the users of all ages to navigate between applications seamlessly and perform tasks with doing so less as physically touching their devices.</li><li>Technologies such as Facial Recognition can eliminate the need for remembering passwords and PINs to access sensitive information. One of my favourite implementations of facial recognition is DigiYatra- an initiative of the Indian Government. The application, upon registering a user, requires them to scan their face and provide details of any Government accepted Identity Document (such as Aadhar Card, Driving License or a PAN Card). One can then upload their boarding pass to the application, go to the airport and simply scan their face at the entrance and gain entry to the airport. This has made air travel much seamless and less cumbersome by helping passengers avoid long queues.</li><li>Translators such as Google Translate can aid in removing language barriers. Google Translate uses a model known as ‘seq2seq’. Instead of naively translating words individually, seq2seq also takes into consideration the neighbouring words, so as to provide a proper grammatical structure to the translated sentence.</li></ol><p>As the interplay of ML in accessibility gains more traction, companies such as Microsoft have made enormous investments into such accessibility tools. The company provides grants to organisations that wish to develop accessibility tools for facilitating learning, providing mental health support systems, and bridging diversity gaps using AI. Google’s DeepMind is at the forefront of researching and developing ML tools that catalyse accessibility. One of DeepMind’s ambitious projects includes providing captions for lip movement. If lip reading captioning is successful, it can be an absolute game changer for those suffering from audio impairments.</p><p>As ML picks up pace and trickles itself into domains beyond our comprehension, it is exciting to see how it can be made use of to provide smooth user experiences to a somewhat neglected diaspora. AI can be an excellent means to promote digital inclusion and make it easier for developers to integrate assistance into softwares. As the number of internet users increase globally every year, it is imperative that we become more empathetic towards our audiences, put them at the cynosure of design decisions and create tools for everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27cf17b28c54" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Handwritten Digit Classifier using Convolutional Neural Networks]]></title>
            <link>https://medium.com/@sonakshi.arora02/building-a-handwritten-digit-classifier-using-convolutional-neural-networks-0146a3c9cfb0?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/0146a3c9cfb0</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[cnn]]></category>
            <category><![CDATA[mnist]]></category>
            <category><![CDATA[neural-networks]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Sat, 18 Nov 2023 19:11:05 GMT</pubDate>
            <atom:updated>2023-11-18T19:20:23.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*vktMsJytx5uZaUAU05UwlA.png" /><figcaption>A Deep Neural Network</figcaption></figure><p>Today, we’ll be using the MNIST dataset (Modified National Institute of Standards and Technology) for building an ML model that classifies the digits in the database. The MNIST dataset consists of handwritten digits from 0–9 used widely for training image processing systems. We’ll be using Tensorflow for building the model. The documentation for the dataset can be found here: <a href="https://www.tensorflow.org/datasets/catalog/mnist">https://www.tensorflow.org/datasets/catalog/mnist</a></p><ol><li><strong>Importing the needed libraries:</strong></li></ol><pre>import numpy as np<br>import pandas as pd<br>import matplotlib.pyplot as plt<br>import random<br>import tensorflow as tf<br>from tensorflow.keras import datasets, layers, models<br>import tensorflow_datasets as tfds</pre><p><strong>2. Splitting the dataset into training and testing:</strong></p><p>In case you’re wondering how I figured out the tuples, I referred to the official documentation for the MNIST dataset. It can be found here: <a href="https://www.tensorflow.org/api_docs/python/tf/keras/datasets/mnist/load_data">https://www.tensorflow.org/api_docs/python/tf/keras/datasets/mnist/load_data</a></p><pre>(xtrain, ytrain), (xtest, ytest) = tf.keras.datasets.mnist.load_data()</pre><p><strong>3. Displaying the images present in the dataset:</strong></p><pre>for i in range(9):<br>  ax = plt.subplot(3,3,i+1) #rows, columns and label<br>  plt.imshow(xtrain[i], cmap = plt.get_cmap(&#39;gray&#39;))<br>  plt.title(&quot;Number {}&quot;.format(ytrain[i]))<br>  plt.axis(&#39;off&#39;)</pre><p>We display 9 images from the dataset. I’m going to briefly mention the parameters present in the code above:</p><ul><li>The plt.subplot() takes 3 parameters, the number of rows, columns and the index.</li><li>The images are stored in the xtrain array we created in step 2.</li><li>‘cmap’ stands for colormaps. We wish to display black and white images of the digits.</li><li>We provide a title to the images, and this title is the number present in the image. The titles can be found in the train array we made in step 2.</li><li>Finally, we do not wish to show the axis when our images are displayed, and so we turn it ‘off’.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/0*sw8VuMHUc2oNNl_L" /><figcaption>Images present in xtrain dataset</figcaption></figure><p>Before we move to step 4, let us talk about <strong>‘One Hot Encoding</strong>’.</p><p>Machine Learning doesn’t perform with categorical data, but numerical data. Consider a dataset to have a Gender attribute with 2 categories as Male and Female. Instead of passing the string labels, we create an array with 2 columns. If a person is a male, the first column gets filled with 1 and the second column is filled with 0. Otherwise the first column is a 0 and the second column is a 1, when a person is a female.</p><p>Gender = [&lt;Male&gt;,&lt;Female&gt;]</p><p>Karan : [1,0]</p><p>Sonakshi: [0,1]</p><p>In any such array, only one column holds the value 1, and the rest of the entries are 0.</p><p><strong>4. One-Hot Encoding the labels:</strong></p><p>Instead of the labels spanning from 0 to 9, we one-hot encode them. Remember that the labels are present in the ytrain and ytest arrays created in step 2.</p><pre>ytrain = tf.keras.utils.to_categorical(ytrain)<br>ytest = tf.keras.utils.to_categorical(ytest)</pre><p><strong>5. Reshaping the images, and typecasting them:</strong></p><pre>rows,cols=28,28<br>xtrain = xtrain.reshape(xtrain.shape[0],rows,cols,1)<br>xtest = xtest.reshape(xtest.shape[0],rows,cols,1)<br>xtrain = xtrain.astype(&#39;float32&#39;)<br>xtest = xtest.astype(&#39;float32&#39;)<br>xtrain/=255.0<br>xtest/=255.0<br>print(xtrain.shape) <br>print(xtest.shape)</pre><p>We wish for our image to have 28 pixels along the row and 28 pixels along the columns. The line xtrain.reshape() takes in the following parameters.</p><ul><li>The image stored in the xtrain array.</li><li>Number of rows</li><li>Number of columns</li><li>Number of channels. Since our images are in grayscale, they only need 1 channel. RGB images have 3 channels.</li></ul><p>Similarly, images in the xtest array are reshaped.</p><p>The images are typecasted into ‘float32’ data format. While training a neural network, it is common to use 32-bit precision, hence we typecast the images.</p><p>In any image, the pixels can take values from 0 to 255 based on their colour. Dividing them by 255 makes their value come between 0 and 1, standardising the range of values for improved training and testing.</p><p>Printing the shapes gives us the number of images in the dataset, number of rows, number of columns and number of channels.</p><p>For xtrain the shape is (60000,28,28,1) and for xtest we get (10000,28,28,1)</p><p><strong>6. We now come to the most awaited part- where we build the neural network!</strong></p><pre>model = models.Sequential()<br>model.add(layers.Conv2D(128,(3,3),activation=&#39;relu&#39;))<br>model.add(layers.MaxPooling2D(2,2))<br>model.add(layers.Dropout(0.5))<br>model.add(layers.Conv2D(64,(3,3),activation=&#39;relu&#39;))<br>model.add(layers.MaxPooling2D(2,2))<br>model.add(layers.Dropout(0.5))<br>model.add(layers.Conv2D(64,(3,3),activation=&#39;relu&#39;))<br>model.add(layers.Flatten())<br>model.add(layers.Dense(128,activation=&#39;relu&#39;)) #Dense(128) is a fully connected layer<br>model.add(layers.Dense(10,activation=&#39;softmax&#39;))</pre><p>We use a Sequential mode, which allows us to stack multiple layers.</p><p>The first layer has a 2D Convolutional network with 128 filters, kernel size of 3x3 and uses the Rectified Linear Unit (ReLU) activation function.</p><p>In CNN, filters are used to extract specific features from a given image. Consider a CNN that is used to detect humans. The first filter could be used to extract faces from an image, the second filter extracts the eyes, the third filter extracts the nose and so on.</p><p>Kernel size specifies the heights and width of the 2D convolutional window.</p><p>Rectified Linear Unit is an activation function that provides output 0 for input less than or equal to 0 and returns the input value when input is greater than 0. ReLU is commonly preferred over sigmoid or tanh since it solves the vanishing gradient problem. (In sigmoid or tanh function, the output values snap to 1 for very high input values).</p><p><strong>Next we use MaxPooling. Now what exactly is that?</strong></p><p>Essentially, pixels in images are just numbers. Max pooling is used to select the maximum value present in a window over which the filter is applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*o57Z_PTMBU3PTqtn" /><figcaption>Max Pooling Example</figcaption></figure><p>So consider using a filter of size 2x2 in the above image. The filter is placed over the blue segment and the maximum in that window is 9. A stride mentions the number of pixels we move the filter by. So after completing the blue segment, we move the filter by 2 pixels right and come to the green segment where the max value is 7. Next, we move by two pixels down and come to the yellow segment and pick up 8, then shift 2 pixels to the right and pick up 6.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*-zUP5WbKKt0c2l4DKZG5Rw.png" /><figcaption>Stride Visualization</figcaption></figure><p>Coming back to our code snippet, we apply a dropout of 0.5. Dropout is a strategy used to prevent overfitting (a situation where a machine gives accurate results for trained data but fails to give correct results for new and unseen data). In dropout, we randomly deactivate a portion of neurons (50% in this case) during each training update.</p><p>We then apply a second convolutional layer with 64 filters, 3x3 filter size, and ReLU activation. We use MaxPooling and Dropout same as before and apply a third layer of Conv2D.</p><p>The Flatten() method converts the pooled feature maps (2D in nature) into a linear vector (1D in nature) so that it can be inserted in the dense layers</p><p>Finally, we first add a Dense layer with 128 neurons in it. Neurons in a dense layer receive input from every other neuron in the previous layer. This layer also uses the ReLU activation.</p><p>The last dense layer is the output layer. It has 10 neurons for 10 classes (for 0–9 digits). This layer uses the softmax activation function. This function converts the weighted sum into probabilities for each output (there are 10 outputs in our case) that sum to 1.</p><p><strong>7. Our pipeline is ready, and it is time to compile our model:</strong></p><pre>model.compile(optimizer = tf.keras.optimizers.Adam(0.001),loss=tf.keras.losses.categorical_crossentropy,metrics=[&#39;accuracy&#39;]</pre><p>Let us talk about the parameters present in this snippet.</p><ul><li>Optimizer: It is used to adjust the weights and the learning rate of the neural connections to minimise loss. We use the Adam optimizer which is most commonly used for CNN models.</li><li>Next we come to the loss function. The loss function compares the predicted values and the actual values. Our aim is to minimize loss in our neural network. We use the CategoricalCrossEntropy loss function here, since we have multiple categories. (10 categories for outputs 0 to 9).</li><li>Metrics is the basis to judge the performance of our neural network. Here, we measure performance in terms of the accuracy of predictions.</li></ul><p><strong>8. Time to train our model!</strong></p><pre>model.fit(xtrain,ytrain,epochs=10,batch_size=16)</pre><ul><li>Epochs refers to the number of iterations performed for training.</li><li>batch_size refers to the number of samples propagated through the network.</li></ul><pre>score = model.evaluate(xtest, ytest)<br>print(&#39;Test accuracy:&#39;, score[1])</pre><p><strong>We get an accuracy of 99.1% with our network.</strong></p><p><em>You can further change the accuracy by changing the hyperparameters (learning rate, dropout rate, using other activation functions, etc.)</em></p><p><strong>9. Making Predictions:</strong></p><p>This has to be my favourite part, the part where we make predictions using the testing dataset.</p><pre>predictions = model.predict(xtest)<br>results = np.argmax(predictions,axis = 1)<br>print(results)</pre><ul><li>argmax returns the returns <strong>indices </strong>of the maximum values along with specified axis.</li><li>In simple terms, the softmax returns the probability of the outputs for each class as discussed above, and argmax return the index where the probability is highest.</li></ul><pre>plt.figure(figsize=(10,10))<br>for i in range(9):<br>  ax = plt.subplot(3,3,i+1) #rows, columns and label<br>  plt.imshow(xtest[i],cmap = plt.get_cmap(&#39;gray&#39;))<br>  plt.title(results[i])</pre><p>Using the code snippet above, we plot the images (10x10 pixels as specified using figsize) and the predicted results (given by results[i] array).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*FhWVqqU9aUzcGhKj" /><figcaption>Prediction Images and Prediction Labels</figcaption></figure><p>Here’s the link to the repository for reference: <a href="https://github.com/SonakshiA/Handwritten-Digit-Classification/tree/main">https://github.com/SonakshiA/Handwritten-Digit-Classification/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0146a3c9cfb0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threads of Change]]></title>
            <link>https://medium.com/@sonakshi.arora02/threads-of-change-abbcf4a20536?source=rss-2da6a7093d4b------2</link>
            <guid isPermaLink="false">https://medium.com/p/abbcf4a20536</guid>
            <category><![CDATA[fast-fashion]]></category>
            <category><![CDATA[fashion]]></category>
            <category><![CDATA[sustainable-fashion]]></category>
            <category><![CDATA[technolgy]]></category>
            <dc:creator><![CDATA[Sonakshi Arora]]></dc:creator>
            <pubDate>Fri, 17 Nov 2023 22:06:35 GMT</pubDate>
            <atom:updated>2023-11-18T08:02:49.006Z</atom:updated>
            <content:encoded><![CDATA[<h4>Navigating Key Differences Between Fast Fashion and Sustainable Fashion Trends</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E-pWBXaKEg47DbG_hVqfJw.jpeg" /></figure><p>The fashion industry is one of the most dynamic and rapidly developing business segments, raking in about $2.5 trillion globally and $50 billion from India itself. The industry, so intricately woven into a vibrant tapestry of different cultures and collaboration, undergoes a rollercoaster of ever-changing fashion fads every minute. As the industry picks up momentum in terms of its economic contribution, the argument between fast fashion and sustainable fashion has once again become the cynosure of conversation amongst fashion icons and concerned environmentalists. Through this article, we shall explore the difference between fast and sustainable fashion, and their social, environmental and economic impact in today’s landscape.</p><p>Before we delve into a deep discussion of the two trends, it is vital to begin with their fundamentals to better understand their offerings. Fast fashion refers to mass-produced and cost-effective clothing that impersonate the latest fashion trends. Essentially, such clothing is quickly produced to meet business requirements. Fast Fashion, as the name suggests, is where everything is done at rapid fire speed. The garments are swiftly designed, produced, distributed and marketed in large quantities. They are then sold at cheap rates while still allowing high margin for profits, and at the same time satisfying the consumer’s need for latest fashion trends.</p><p>On the other range of the spectrum, we have sustainable fashion- which seeks to design and produce clothing in an environment friendly manner. Juxtaposed to fast fashion, sustainable fashion aims to mitigate mass churning of fashion trends every week and cut down continuous, mindless consumption for the betterment of the planet. The sustainable fashion industry is modelled to work in a ‘sustained’ manner, i.e, one that can work for years to come.</p><p>Now that we have an understanding of the fundamentals of the two clashing fashion trends, it is time to look at their histories. The origins of fast fashion can be traced back to the year 1830, the beginning of the Industrial Revolution when the sewing machine was born. The sewing machine’s creation made it quicker, easier, and less expensive to create clothing. This sowed the first seeds of what now stands as a $94 billion industry as of 2022. Prior to the 1800s, people would rear sheep to get wool, spin yarn and then weave their clothes. However the conception of the sewing machine changed all of that in the blink of an eye. The term ‘Fast Fashion’ was first used by the New York Times in the year 1990, thus coining it. The term was used in reference to Zara’s plan to produce clothes from the design stage to the distribution stage in a matter of 15 days. In contrast, sustainable fashion has been around for much longer. A concept born in the 60s and 70s due to hippies’ and punks’ rejection of mass consumerism and traditional fashion, sustainable fashion gained pace in the 80s with the rise of vintage shoppers and upcycling fashion trends. Entering the 90s at a slightly slower pace, businesses started using sustainable fashion as a selling point, and sustainability movements were on the rise. Today, worth $7,548.2 million, the industry still has a long way to go. However, more people are becoming aware about the consequences of fast fashion and are adopting a sustained approach to fashion. This increased awareness is driving people to buy second-hand clothing, make purchases from sustainable brands or practise upcycling.</p><p>The rise of fast fashion gave birth to sweatshops, since clothing was now to be produced in bulk quantities and demand was at an all-time high. Sweatshops have become a breeding ground for employing manual labour at meagre wages, who work in downright illegal working conditions for extremely long hours. Because of their cruel methods used to make clothing fast and cheaply, sweatshops have come to be linked with the fashion industry. It is impossible to talk about sweatshops without shedding light on the Rana Plaza Incident that occurred in Bangladesh in 2013.</p><p>On the grim morning of 24th April 2013, an eight-storeyed building that housed five garment factories collapsed in a matter of 90 seconds.Termed as the ‘deadliest incident in the history of modern garment industry’, the accident killed 1100 people and raised important questions regarding workplace safety for such garment workers. Ten years post the incident, fast fashion still holds consumers with its iron grip, resisting any attempts of change. Major retail brands also continue to dodge accountability when it comes to protecting garment workers, and have not signed the International Accord for Health and Safety in the Textile and Garment Industry which vows to ensure workplace safety by conducting periodic inspections and setting up complaint mechanisms for workers. The most notorious brands are Amazon and IKEA, putting profits before human lives. In 2016, a fire broke out at a Bangladeshi sweater sweatshop that supplied retailers H&amp;M and J.C. Penny with 6000 workers escaping by a narrow timeframe in the wee hours of the day. In 2012, a similar fire at the Tazreen Fashion Factory in Dhaka killed over 117 workers, attracting global attention to the abysmal labour working conditions in Bangladesh sweatshops.</p><p>The dominant role of consumerism and capitalism in today’s business landscape has further strengthened the notion that cheaper and faster is better. Fast fashion has become a way for people to enjoy the latest fashion trends at an affordable price and hence refuses to be replaced by the conscious principles that sustainable fashion adopts.</p><p>With the foundation set in place, it is time to shed some light on the environmental impact of the two prominent trends. Fast fashion is responsible for nearly 10% of the world’s total carbon emissions. Fast fashion is also responsible for emission of greenhouse gases, depletion of nonrenewable resources and massive consumption of water. Reportedly, it takes over 700 gallons to produce a single cotton t-shirt and 2000 gallons of water for a single pair of jeans. Fast fashion also causes rampant water pollution, since contaminated water from the dyeing units are dumped into rivers and streams directly. Fast fashion brands use synthetic fibres such as nylon, polyester and other microplastics that do not biodegrade easily. Manufacturing textiles is also an energy-intensive procedure requiring large amounts of petroleum and releasing toxic substances such as volatile particulate matter, thus polluting the air. In contrast, adopting sustainable fashion involves using organic materials that can significantly cut down the carbon emissions involved in the manufacturing process. For instance, using recycled polyester over virgin polyester can cut down carbon emissions by over 50%. Organic cotton uses up to 91% less water, reduces greenhouse emissions by 46% and reduces soil erosion by 26% making it a better alternative over conventional cotton. Sustainable fashion employs concepts such as upcycling and recycling, thereby reducing wastage and increasing the lifespan of clothing.</p><p>As discussed above, fast fashion also brings along a plethora of negative social impacts such as forced labour, poor working conditions and violations of environmental regulations. Sustainable fashion is a step forward in ensuring compliance with social and environmental standards by conducting due diligence on the suppliers’ part. Due to affordable clothing, as of 2019, over 62 million metric tons of apparels were consumed globally. Although pocket-friendly, a good chunk of fast fashion apparels are disposed off rather quickly since they get worn out after a few washes.</p><p>Thus, there is a dire and an immediate need to replace fast fashion with practices that are more sustainable and ethical to reduce the impact on society and environment.</p><p>A common term that comes up when talking about sustainable fashion is ‘Circular Economy’. Using this approach, clothes are designed and produced with the aim of minimising waste and pollution. In circular fashion, clothes are manufactured with extended life spans, bringing down waste levels by using recycling materials and renewable sources of energy for production. Since clothes are designed to ensure their longevity, the textile wastes generated get dramatically reduced. This also reduces the need for new production, thereby bringing down water consumption and greenhouse emissions. The usage of renewable sources of energy such as solar and wind power curbs down the carbon footprint. Circular fashion can be practised by using rental cloth services, repairing torn garments and giving them a new lease on life, encouraging cloth swaps and adopting made-to-order models wherein production begins only after a consumer has ordered a product. This approach reduces overproduction and resource wastage.</p><p>Other strategies that can be undertaken to make a step forward towards sustainability include transparency by brands. Consumers must have a right to know where their clothes are manufactured, using which materials, and the conditions where they are made. Consumers must also be educated about the negative impacts of fast fashion and be encouraged to make smart and informed choices. Sustainable fashion will not have to cost a fortune, given there is enough demand for it out there.</p><p>As awareness rises with regards to the consequences fast fashion entails, a few fashion brands have taken the onus to bring about sustainability in their apparels. English fashion designer Stella McCartney is firmly against the use of animal-skins in her collection. All Stella McCartney stores in the United States of America run on renewable energy provided by Ecotricity. Her stores also use eco-friendly and biodegradable mannequins made out of bioplastic materials having 72% sugarcane derivative. Championing the motto of sustainability, the coveted designer has openly spoken about the rampant pollution the fashion industry causes at high profile events such as the G20 Summit. American retailer Everlane has made its manufacturing process transparent, and its customers are provided with a detailed breakdown of the costs of each item and are shown the factories where their garments are made. Patagonia further enforces the principles of sustainable fashion by arming its customers with a power of ‘right-to-repair’ along with using recycled materials for their apparels. While Denim is notorious for requiring high amounts of water for manufacturing, Levi’s new collection promises to use 96% less water. The brand maintains its commitment to sustainability by using sustainably sourced cotton and using old pairs of jeans for home insulation. San Francisco based brand Amour Vert manufactures clothes in small batch sizes to prevent wastage. The brand ensures all products are made with non-toxic dyes. For every item purchased, the brand also plants a tree. Vetted by the World Fair Trade Organization, People Tree ensures fair wages, healthy working conditions, environment-friendly practices and usage of materials like organic cotton and non-toxic dyes.</p><p>Being a Computer Science student, I was eager to explore how tools such as Artificial Intelligence can be leveraged to promote sustainability in the fashion industry. AI can be used to predict fashion trends, saving brands huge amounts of effort, time and money in predicting future trends, only to manufacture clothes that do not end up selling. AI predictions can help companies discontinue clothing lines that may not sell well, thereby reducing production wastage. AI also makes thrift shopping easier for customers, thus reducing demands for new clothes. AI-based solutions can provide real-time data that may lead to improved supply chains. This data-driven approach can be pivotal in finding out inefficiencies and improving resource management. Blockchain technology can be incorporated to maintain supply chain transparency. This can be helpful in tracing the journey of a garment right from the design and production stage to the retail stage. Digital prototyping can be instrumental in reducing the amount of sampling material needed. Thus by coupling technology with fashion, we can open doors to a greener and a more ethical future.</p><p>Migrating to sustainable fashion comes with its own sets of challenges. ‘Greenwashing’ is a deceptive marketing tactic that promotes brands to be eco-friendly when in reality they are not. Greenwashing not only deceives consumers but also undermines genuine brands making an effort towards sustainability. Secondly, eco-friendly clothing lines come with higher production costs, not affordable for either the producer or the consumer. Additionally, environmentally friendly production methods are typically more costly than conventional ones. Even today, there are limited options in terms of designs for consumers if they seek for sustainable brands.This causes a major hindrance to having a green wardrobe.</p><p>Keeping aside high-street fashion brands, several local cultures around the world have set out on a quest to bring about sustainability in fashion. The indigenous communities live in harmony with nature, which helps them incorporate local sustainability in their work. Indigenous-owned fashion brands such as The Orenda Tribe curate socially responsible apparels and Native American fashion brand Ginew uses durable materials in constructing their apparels. Ginew creates apparels that are meant to last- so that they can be passed down to future generations. People of the Gwich’in culture are taught to take only as much as they need, and such indigenous principles become strong pillars that reduce wastage and over-production. Mexican indigenous groups use extracts from vegetables and other naturally occurring substances to make dyes for their embroideries. Asian cultures such as that in Japan, China and Vietnam use bamboo to make hats. This in turn replaces the need for plastic and mercury for hats and caps manufacturing. Local West Africans use wax fabrics made from 100% cotton. The Dabu Printing craft done by the artisans of Rajasthan, India involves a mixture of desert sands called ‘dabu’ which is used for block printing on fabrics. The fabric is then dyed in Indigo or other natural dyes. Weaving such threads of tradition can drive the fashion industry towards a sustainable future.</p><p>In recent years, several initiatives have been founded to create a transition from fast fashion towards sustainable fashion. One such initiative is the ‘Sustainable Fashion Week’. SFW is organised every year from 25th September to 8th October and seeks to empower people to have a more sustainable relationship with fashion. The four key themes of SFW are ‘rewear, repurpose, regenerate and reconnect’. The campaign hopes to drive changes in fashion habits for a more secure future. ‘My Planet, My Closet’ is another campaign that pushes conversations around sustainable fashion. The #NoNewClothes campaign is a 90 day challenge that encourages people to prioritise reusing existing clothes over buying new ones. Under this campaign, fashion firms are encouraged to focus their sustainability initiatives on social justice and well-being. The Green Carpet Challenge is a sustainability initiative that recognises celebrities who wear fashion brands that adhere to ethical production practices. Over the years, GCC has recognised prolific names such as Jessie J, Olivia Colman, Emma Watson, Gisele Bündchen and Natasha Gordon for donning socially and environmentally responsible designers.</p><p>Countries such as Japan have formed a Japan Sustainable Fashion Alliance (JSFA) that propels a transition to a greener fashion industry. Singapore has created a Singapore Fashion Council (SFC) that focuses on Asian craftsmanship, sustainability and innovation using technology. The United Kingdom introduced the ‘10-year Fashion Industry Sustainable Change Programme’ that is centred on developing in the UK a world-class circular textile and fashion ecosystem.</p><p>Through the medium of this blog, we looked at the differences between fast and sustainable fashion trends, their histories, the social and environmental repercussions of fast fashion and the benefits sustainable fashions brings with itself. We also explored global brands that have become environmentally conscious and are doing their bit to promote ethical and more responsible fashion practices. We explored how technology can drive sustainability and the amalgamation of local cultures and sustainable fashion. Finally, the article discussed a few global campaigns and nation-wide initiatives to get the dialog started around building a greener fashion industry. In conclusion, there is a staunch need to transition from fast fashion trends to greener alternatives for the betterment of the world. The path forward involves striking a gentle balance between fashion and sustainability and raising a call-to-action to all stakeholders for their active participation towards the cause.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abbcf4a20536" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>