<?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 Bharathvajan G on Medium]]></title>
        <description><![CDATA[Stories by Bharathvajan G on Medium]]></description>
        <link>https://medium.com/@g.bharthvajan?source=rss-d572efccbdfa------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9avmlDZEwRi2421IIxdBug.png</url>
            <title>Stories by Bharathvajan G on Medium</title>
            <link>https://medium.com/@g.bharthvajan?source=rss-d572efccbdfa------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 30 May 2026 09:18:53 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@g.bharthvajan/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[Amazon Bedrock : Choosing the Right Architecture: RAG vs Agent vs Agentic RAG]]></title>
            <link>https://medium.com/@g.bharthvajan/amazon-bedrock-choosing-the-right-architecture-rag-vs-agent-vs-agentic-rag-83df48bb06eb?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/83df48bb06eb</guid>
            <category><![CDATA[amazon-bedrock]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[agentic-rag]]></category>
            <category><![CDATA[knowledge-base]]></category>
            <category><![CDATA[rags]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Sun, 08 Jun 2025 17:52:46 GMT</pubDate>
            <atom:updated>2025-06-08T17:52:46.795Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon Bedrock : Choosing the Right Architecture: RAG vs Agent vs Agentic RAG</h3><blockquote><strong>Introduction</strong></blockquote><p>In this article, we aim to explore the evolving landscape of intelligent system design through three key architecture patterns in the world of AI: <strong>Retrieval-Augmented Generation (RAG)</strong>, <strong>Agents</strong>, and the emerging paradigm of <strong>Agentic RAG</strong>.</p><p>To ground our discussion in a practical context, we’ll illustrate how each of these patterns can be applied to a <strong>healthcare use case</strong> — specifically, enabling intelligent systems to assist patients in <strong>booking appointments</strong> and accessing <strong>clinical services</strong>.</p><p>Through this lens, we will:</p><ul><li>Examine how <strong>RAG</strong> enhances AI responses by integrating external knowledge sources dynamically.</li><li>Understand how <strong>Agents</strong> allow large language models (LLMs) to take actions, plan tasks, and interact with external tools or APIs.</li><li>Explore <strong>Agentic RAG</strong>, which combines the strengths of both approaches to enable intelligent decision-making that is not only informed but also actionable.</li></ul><blockquote><strong>Use-Case:</strong></blockquote><p>Learn about clinic services, doctor’s availaibility, speciality and book an in-person appointment.</p><blockquote><strong>Architecture Style #1: Plain RAG (Bedrock Knowledge Base)</strong></blockquote><p><strong>Use-Case: </strong>Here’s a sample use case focused on medical or clinical services.</p><ul><li><em>What are the general consultation charges?</em></li><li><em>Is there a pharmacy inside the clinic?</em></li><li>How can I cancel or reschedule my appointment?</li><li>What payment methods are accepted?</li><li>Is there a consultation fee for follow-up visits?</li><li>Do you accept ABC Health Insurance?</li></ul><p>FAQ-style user questions that a clinic assistant could handle effectively using a Bedrock Knowledge Base. These types of questions are best answered by retrieving information from uploaded documents such as service brochures, doctor profiles, and clinic policy manuals.</p><p><strong>Flow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*uoxssRWQolFdOG7wR_-anA.png" /></figure><p><strong>Design Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kktuwo0cP8TmPbM7d6E77w.png" /></figure><blockquote><strong>Architecture Style #2: Agent (Bedrock Agent)</strong></blockquote><p><strong>Use-Case:</strong> Here’s a sample use case focused on book appointment</p><ul><li><em>“Book an appointment with a cardiologist for Friday at 10 AM.”</em></li><li><em>“Reschedule my appointment to next Tuesday.”</em></li></ul><p>A plain Bedrock Agent is well-suited for the appointment booking use case because it can understand user intent, manage multi-turn memory, and invoke APIs to perform real-time actions like checking availability and confirming bookings. It doesn’t require a knowledge base since all necessary data can be fetched dynamically via Lambda functions.</p><p><strong>Flow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*nztgC_J4MIp6KnOj_nHKIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nU-FMu-aYwPrE0cOZKSUbg.png" /></figure><blockquote><strong>Architecture Style #3: Agent (Bedrock Agent + KnowledgeBase)</strong></blockquote><p>Use-Case:</p><p>“User Query : I need a blood test package and also want to meet someone for diabetes. Can you help me with both?”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yt1AW_znPJ0wgB0O3lF8iw.png" /></figure><p><strong>Design Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6mXlhRHJT7_Vg3gvq0vdFg.png" /></figure><blockquote><strong>Conclusion</strong></blockquote><p>To wrap up, we’ve explored how each of these architectural patterns — RAG, Agents, and Agentic RAG — offers unique strengths in building intelligent, goal-oriented AI systems.</p><p>To summarize the patterns what we have seen</p><ul><li><strong>For simple document Q&amp;A: </strong>Choose Bedrock Knowledge Bases (Plain RAG) offer the quickest path to value</li><li><strong>For API-heavy workflows:</strong> Plain Agents provide the needed flexibility</li><li><strong>For complex analytical tasks: </strong>Agentic RAG delivers superior results despite higher complexity</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=83df48bb06eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Real-Time AI Assistant with Amazon Bedrock Agents — Part 01]]></title>
            <link>https://medium.com/@g.bharthvajan/building-a-real-time-ai-assistant-with-amazon-bedrock-agents-part-01-69ca05c74048?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/69ca05c74048</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[bedrock]]></category>
            <category><![CDATA[ai-assistant]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Tue, 03 Jun 2025 07:33:31 GMT</pubDate>
            <atom:updated>2025-06-04T18:46:32.654Z</atom:updated>
            <content:encoded><![CDATA[<h3>Building a Real-Time AI Assistant with Amazon Bedrock Agents — Part 01</h3><blockquote><strong>Intro to Bedrock Agent</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o8LmuOCehOnqYkSkqIqLfw.png" /></figure><blockquote><strong>Bedrock Agent Capability</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y0sxXJxDhprfbM955c_1cA.png" /></figure><blockquote><strong>Health-Care Use Case : Book Doctor’s Appointment via AI Assistant (Chat)</strong></blockquote><p>Here is the example conversation between user and agent. And diagram shows respective action call happening by the Agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j4v4eDH0I0r_nMJtg6fsCw.png" /></figure><blockquote><strong>01. Bedrock Agent : Planning : in relevant to Use-case</strong></blockquote><p>Why Planning capability is important for our book appoint use-case ?</p><p>Agent’s planning capability — handles flexible or incomplete Input. For example</p><p><strong>=&gt; Users might say:</strong><br>- “I want to see a doctor next Friday.” (or)<br>- “Book Dr. Steve again.” (or)<br>- “Is anyone free in the afternoon?”</p><p><strong>=&gt; The agent must:</strong><br><strong>01. Understand intent (booking)</strong><br>- Extract known info (e.g., date = next Friday)<br>- Identify missing info (doctor, time)<br>- Ask the right questions to complete the task</p><p><strong>02. Choose right action in order.</strong><br>- Get available doctors → getAllAvailableDoctors<br>- Check time slots → getDoctorAvailability<br>- Book the appointment → bookAppointment</p><p><strong>03. Decides</strong><br>- Picks which action to call.<br>- Decides when to call it (e.g., only after doctor and date are selected).<br>- Uses results to guide the next step.</p><blockquote><strong>02. Bedrock Agent : Memory : in relevant to Use-case</strong></blockquote><p>Why memory is important in above booking appointment use case ?</p><p>Memory enable agent to</p><ul><li><strong>Remember user-provided inputs</strong> (e.g., date, doctor type).</li><li><strong>Avoid repeating questions</strong> (“You already said June 5th”).</li><li><strong>Hold temporary selections</strong> (e.g., doctor selected, available time slot).</li><li><strong>Personalize interactions</strong> (e.g., remember last doctor booked — if persisted via custom memory).</li></ul><p>The agent <strong>remembers</strong>:</p><ul><li>Date: June 5th</li><li>Specialty: General physician</li><li>Selected Doctor: Dr. Steve</li></ul><p>These values are held in <strong>session memory</strong>, so the agent doesn’t have to ask again</p><blockquote><strong>03. Bedrock Agents : Action &amp; Action Group : in relevant to Use-case</strong></blockquote><p>Why Action &amp; Action groups are important for book appointment use-case ?</p><ul><li>An <strong>Action Group</strong> in Amazon Bedrock Agents is a collection of <strong>tools (actions)</strong> the agent can call to achieve specific goals — like booking an appointment, checking availability, or sending an SMS for confirmation.</li><li>Each action is like a function the agent can invoke with input/output specifications.</li></ul><p><strong>How it works :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fix8aGnpqKZenENkzDPtw.png" /></figure><p><strong>Open API Spec Vs Json Schema :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTZpAAfIqwplcjmVdosfXQ.png" /></figure><blockquote><strong>04. Bedrock Agent : Guardrails : in relevant to Use-case</strong></blockquote><ol><li><strong>Prevent Harmful or Unsafe Content</strong></li></ol><p>Users may enter:</p><ul><li>Inappropriate language</li><li>Misinformation (e.g., about medical conditions)</li><li>Sensitive personal health details</li></ul><p><strong>Guardrails</strong> help detect and block:</p><ul><li>Toxic or offensive messages</li><li>Unsafe outputs from the model</li></ul><p><strong>2. Control Topics &amp; Boundaries</strong></p><ul><li>Block off-topic inputs</li></ul><blockquote><strong>Benefit of Agents in Book Appointment use-case :</strong></blockquote><ul><li><strong>Agent can reason over actions</strong>: “Should I call bookAppointment now?&quot;</li><li><strong>Automatic input formatting</strong>: Agent formats user input to match the action schema.</li><li><strong>Output interpretation</strong>: Agent reads and uses the API response intelligently.</li><li><strong>No need for hard-coded logic</strong>: Don’t have to manually wire flow steps.</li></ul><blockquote><strong>Steps for creating Agent for “Booking Doctor Appointment” Use Case</strong></blockquote><p>Following diagram covers the high level implementation steps involved in creating agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkvTXCLm5_XFTjXBPwIhSA.png" /></figure><blockquote><strong>Agent Architecture — Patterns / Options</strong></blockquote><p>When building a conversational experience for booking doctor appointments using <strong>Amazon Bedrock Agents</strong>, you can choose between a <strong>Single-Agent</strong> or <strong>Multi-Agent</strong> architecture depending on the complexity of the use case and long-term scalability needs.</p><p>Here is a section that outlines the advantages and disadvantages of Single-Agent vs Multi-Agent architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZUhLOfUYNIlbwizdai-sjA.png" /></figure><blockquote><strong>Conclusion</strong></blockquote><p>In this article, we explored the context, fundamentals of Bedrock Agents, their capabilities, and a sample use case. In the next part, we’ll dive deeper into the implementation of the doctor appointment booking use case.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69ca05c74048" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[API Documentation Assistant: Building an Intelligent Q&A System with Amazon Bedrock Knowledge Base…]]></title>
            <link>https://medium.com/@g.bharthvajan/api-documentation-assistant-building-an-intelligent-q-a-system-with-amazon-bedrock-knowledge-base-b54a7ae4d962?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/b54a7ae4d962</guid>
            <category><![CDATA[knowledge-base]]></category>
            <category><![CDATA[intelligent-qa-assistant]]></category>
            <category><![CDATA[amazon-bedrock]]></category>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Tue, 11 Mar 2025 06:04:17 GMT</pubDate>
            <atom:updated>2025-03-11T06:04:17.725Z</atom:updated>
            <content:encoded><![CDATA[<h3>API Documentation Assistant: Building an Intelligent Q&amp;A System with Amazon Bedrock Knowledge Base — Part 01</h3><blockquote><strong>01. Introduction</strong></blockquote><p>In this article, we’ll dive into RAG (Retrieval-Augmented Generation) and Amazon Knowledge Base, and demonstrate how they can be leveraged to create an API documentation assistant. This assistant will empower developers to quickly grasp enterprise APIs through an interactive Q&amp;A chat interface, enabling them to efficiently consume, understand, and explore the availability of APIs.</p><blockquote><strong>02. Context</strong></blockquote><p><strong>Problem Statement:</strong></p><p>Developers often struggle to quickly understand and consume enterprise APIs due to the complexity and volume of documentation. Traditional methods of navigating API docs can be time-consuming and inefficient.</p><p><strong>Solution:</strong></p><p>We will design and implement an interactive Q&amp;A chat interface powered by RAG and Amazon Knowledge Base. This assistant will retrieve relevant information from API documentation, generate accurate responses, and provide developers with a seamless way to explore and understand APIs.</p><blockquote><strong>03. Compelling reasons why an API Documentation Q&amp;A Assistant is valuable:</strong></blockquote><ul><li>Answer questions about API usage</li><li>Provide relevant code examples</li><li>Explain error scenarios</li><li>Check version compatibility</li><li>Extract relevant documentation sections</li></ul><blockquote><strong>04. What is RAG ?</strong></blockquote><p><strong>RAG (Retrieval-Augmented Generation)</strong> is an AI technique that: <strong>Finds</strong> the right information from a database or documents (Vector Store and <strong>Uses</strong> that information to give clear, accurate answers.</p><blockquote><strong>05. Amazon Bedrock Knowledge Base</strong></blockquote><p><strong>Knowledge Base</strong> is a fully managed service that connects generative AI models (like Claude) to your data sources (e.g., S3, databases) for <strong>retrieval-augmented generation (RAG)</strong>. It simplifies building intelligent applications by automating data ingestion, embedding generation, and semantic search, enabling accurate, context-aware responses</p><blockquote><strong>06. RAG Detail Design &amp; Architecture — without Knowledge Base</strong></blockquote><p>Following diagrams shows, how to implement RAG system, with detailed steps without Knowledge Base.</p><p><strong>** Steps 01 to 04 ** </strong>: These steps outline the process of reading API documents and storing the information in a vector data store, specifically using Amazon OpenSearch in our scenario.</p><p>Step 01: Ensure that all API and design documents are stored in a storage layer, such as Amazon S3 in our case.</p><p>Step 02: Perform a read operation to extract the text, and then divide the documents into smaller segments / chunks.</p><p>Step 03: Apply vector embedding to these chunks / splits.</p><p>Step 04: Save the resulting vector data in a vector data store</p><p><strong>** Steps 05 to 07 **</strong>: These steps describe the process of conducting a similarity search for a user’s query.</p><p>Step 05: Convert the user’s query into a vector using vector embedding.</p><p>Step 06: Use this vector to perform a similarity search within OpenSearch.</p><p>Step 07: Obtain the results of the similarity search from OpenSearch.</p><p><strong>Steps 08 to 09</strong>: These steps involve utilizing the user’s query and the results from the similarity search to generate a response.</p><p>Step 08: Use the user’s query along with the results obtained from the similarity search as context.</p><p>Step 09: Generate and provide a response based on this context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vcPtbm1553OhF7dcjhwXSg.png" /><figcaption><strong>RAG Detail Design &amp; Architecture — without Knowledge Base</strong></figcaption></figure><p>The following diagram illustrates how <strong>Steps 01 to 04</strong> have been simplified using a Knowledge Base. There’s no longer a need for a data pipeline to read documents, split them, and store them in a Vector Store.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_1cIiCo4b-2eCFmmSdo_CA.png" /><figcaption><strong>Step 01 — Step 04 : Simplified using Knowledge Base</strong></figcaption></figure><blockquote><strong>07. Simplified RAG Design &amp; Architecture — using Knowledge Base — Retrieval API</strong></blockquote><p>Knowledge Base Retrieval APIs —</p><ul><li>Simplifies the retrieval process which involves indexing content, generating embeddings, performing similarity searches, and returning the most relevant results based on the query context</li><li>Enable efficient search and extraction of information from structured or unstructured data sources by using vector embeddings and semantic search capabilities to find relevant content.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4glt2r92D9JD69nWYQdH_w.png" /><figcaption><strong>Knowledge Base — Retrieval API</strong></figcaption></figure><blockquote><strong>08. Simplified RAG Design &amp; Architecture — using Knowledge Base — Retrieval &amp; Generate API</strong></blockquote><p>Following diagram, even further simplifies on Retrieval &amp; Generation Phase for end to end flow</p><p>(User Query → Retrieve Relevant Docs → Augment Prompt with Context → Generate Response)</p><p><strong>Retrieve Phase:</strong></p><ul><li>Takes user query and searches knowledge base</li><li>Uses semantic search and vector embeddings</li><li>Returns most relevant documents/passages</li></ul><p><strong>Generate Phase:</strong></p><ul><li>Takes retrieved content as context</li><li>Uses LLM to generate natural language response</li><li>Combines knowledge base facts with model capabilities</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nLDDwIztk0MWbGAUjBmRmg.png" /><figcaption><strong>Knowledge Base with Retrieve &amp; Generate API</strong></figcaption></figure><blockquote><strong>09. Conclusion</strong></blockquote><p>The <strong>Amazon Bedrock Knowledge Base</strong> simplifies the entire process of building intelligent, knowledge-driven applications by:</p><ol><li><strong>Automating data integration and processing</strong>.</li><li><strong>Providing built-in semantic search and RAG capabilities</strong>.</li><li><strong>Handling scalability and maintenance</strong>.</li></ol><p><strong>Without Bedrock Knowledge Base</strong>:</p><ul><li>You’d need to manually set up data pipelines, generate embeddings, manage a vector database, and integrate retrieval with a generative model.</li></ul><p><strong>With Bedrock Knowledge Base</strong>:</p><ul><li>Upload your API documentation to an S3 bucket.</li><li>Bedrock automatically processes the data, generates embeddings, and enables semantic search.</li><li>Use the knowledge base with a foundation model (like Claude) to build a Q&amp;A chat interface for developers.</li></ul><p>In the next article (Part 02), we will delve into the detailed steps involved in creating a Knowledge Base, complete with code snippets and examples.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b54a7ae4d962" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Intro to Amazon Q Business and Create simple business Q&A app for Enterprise Data]]></title>
            <link>https://medium.com/@g.bharthvajan/intro-to-amazon-q-business-and-create-simple-business-q-a-app-for-enterprise-data-c1ccec7dcf4a?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1ccec7dcf4a</guid>
            <category><![CDATA[amazon-q-business]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[amazon-q]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Sun, 22 Sep 2024 17:57:22 GMT</pubDate>
            <atom:updated>2024-09-23T04:05:23.359Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Amazon Q Overview</strong></blockquote><p>Amazon Q is a generative AI-powered assistant for business use</p><ul><li>Designed to help employees search information, solve problems, and complete tasks within their Enterprise systems and data.</li><li>And It can create, test, and fix computer code. It can also plan and think through complex tasks step by step.</li></ul><p>Amazon Q Products:</p><ul><li>Amazon Q For Developer : Helps Developers &amp; IT Professional (during SDLC Phase — development &amp; testing cycle)</li><li>Amazon Q For Business : For Employess &amp; Business Analyst</li></ul><blockquote><strong>Amazon Q Types &amp; Integration</strong></blockquote><p>Following diagram shows capability, features and integration with Amazon-Q</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UC1OSTYLA_ExHowK7Kd0Pg.png" /></figure><blockquote><strong>Amazon Q Business Overview</strong></blockquote><p>Amazon Q Business is generative artificial intelligence (generative AI) powered assistant that can do following — all based on the information in Enterprise</p><ul><li>Answer questions</li><li>Generate content</li><li>Create summaries</li><li>Complete tasks</li></ul><blockquote><strong>Amazon Q Business : Subscriptions Plan &amp; Index Type</strong></blockquote><p>Amazon Q Business offers multiple index types and user subscription tiers. we can choose any combination of index types and user subscriptions for Amazon Q Business application environment.</p><ul><li>There are two types of <strong>Amazon Q — Business subscriptions</strong> (plans). Following diagram depicts the same.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ujqlFmH4QggnTaQtXg6-7g.png" /></figure><ul><li>There are two types of <strong>Amazon Q — Business Index types</strong>. Following diagram depicts the same.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2lGVV2m9mZHQ2O4Jmk9xZQ.png" /></figure><blockquote><strong>Amazon Q Business — DataSource Connector</strong></blockquote><p>It is a tool that combines data from different places into one main collection.</p><p>Amazon Q Business has several of these connectors that can link to your data sources, making it easy to create your AI solution with little setup.</p><ul><li>Adobe Experience Manager</li><li>Alfresco</li><li>Aurora (MySQL + PostgreSQL)</li><li>Amazon FSx (Windows)</li><li>Amazon FSx (NetApp ONTAP)</li><li>Amazon RDS</li><li>Amazon S3</li><li>Amazon WorkDocs</li><li>Confluence</li><li>Dropbox</li></ul><blockquote><strong>Create a Amazon Q Business application — for Q&amp;A</strong></blockquote><p>Here is the high level architecture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qw2z1hP6gxouG6f2b14LVA.png" /></figure><p>In this section, we will see how we can create basic Q&amp;A application with following steps.</p><p><strong>Step-01: </strong>From AWS Management Console, navigate to Amazon Q Business.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CidvypYfAwsYi9zgidvKvQ.png" /></figure><p><strong>Step-02: </strong>Lets start to “Create Application”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OMtchPX0EYiedN4F-AxxAA.png" /></figure><p><strong>Step-03: </strong>Key in application name and select identity provider</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CtQh4WUeNLAji4hJ7uhQkg.png" /></figure><p><strong>Step-04: </strong>Select Retriever and Index type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*az2L6gifxTlcs49ETLWHBw.png" /></figure><p><strong>Step-05: </strong>Connect DataSource</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8po3MMDRXibb6dbITdaBQ.png" /></figure><p>5.1: Choose “Upload file”” section.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmEVuzg1Hl7VqJR4vv84zA.png" /></figure><p>5.2: Ensure the uploaded file is indexed (fyi: Here Git commands pdf file is uploaded)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fwvkgBsj0XU4qNumbiRAhw.png" /></figure><p><strong>Step-06: </strong>Configure the Users &amp; Group. And Web Experience Settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T_9zRXCRW-shNdxqTd7XVw.png" /></figure><p><strong>Step-07:</strong> Navigate to web-experience link and login. And ask question related to content in uploaded document. (Here we are asking for git commands)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tV8ZKmrt7lnFCTDmRUqGg.png" /></figure><p>In case, if we are asking for non-relevant info (other than given datasource), Amazon Q replies with “could not find any info in the provided datasource)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3TCsafEQ8XK9oCrmyxQKeQ.png" /></figure><blockquote><strong>Conclusion</strong></blockquote><p>We covered basic of high level overview of Amazon Q and Amazon Q Business with simple basic Q&amp;A application with list of steps.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1ccec7dcf4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Event Bridge — Send & Receive Custom events]]></title>
            <link>https://medium.com/@g.bharthvajan/amazon-event-bridge-send-receive-custom-events-c3782d2cd722?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3782d2cd722</guid>
            <category><![CDATA[send-event]]></category>
            <category><![CDATA[custom-event-bus]]></category>
            <category><![CDATA[eventbridge]]></category>
            <category><![CDATA[event-rules]]></category>
            <category><![CDATA[custom-events]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Sun, 14 Jul 2024 18:50:17 GMT</pubDate>
            <atom:updated>2024-07-14T18:50:17.676Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon Event Bridge — Send &amp; Receive Custom application events</h3><blockquote><strong>Event Bridge ?</strong></blockquote><ul><li>Event Bridge extends CloudWatch event for the event driven architecture.</li><li>It is a serverless event bus that supports the publish/subscribe model.</li><li><strong>EventBridge introduced to address the problems of SaaS platform integration with AWS services.</strong></li></ul><blockquote><strong>CloudWatch Events vs Event Bridge</strong></blockquote><ul><li>Original goal of CloudWatch events for monitoring AWS Services. And it <strong>can support only AWS services as event sources.</strong></li><li>CloudWatch events uses only “default” Event Bus</li><li>EventBridge provides gives option to create custom event buses and SaaS event bus in addition to default bus.</li><li>Over the time, CloudWatch events will be replaced by EventBridge</li></ul><blockquote><strong>Event Bridge Components</strong></blockquote><p>When we talk about EventBridge, there are four components which we need to understand.</p><ul><li>Event Source : Generate event</li><li>Event Bus: Carries event</li><li>Event Rule : Incoming events needs to match the given rule to route to target.</li><li>Event Target : Process event</li></ul><p>The following diagram talks about Event Bridge components in detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tJEW_OwcjnDwB7wHjL4gxg.png" /></figure><blockquote><strong>Sample EventBridge Event</strong></blockquote><p>Here is the sample event payload in JSON</p><pre>{<br>    &quot;version&quot;: &quot;1&quot;,<br>    &quot;id&quot;: &quot;0d279340-135b-c8c6-95c3-41fb8f496c52&quot;,<br>    &quot;detail-type&quot;: &quot;ABC Event Generated&quot;,<br>    &quot;source&quot;: &quot;my-customapp&quot;,<br>    &quot;account&quot;: &quot;0123456789&quot;,<br>    &quot;time&quot;: &quot;2024-04-01T18:41:53Z&quot;,<br>    &quot;region&quot;: &quot;us-east-1&quot;,<br>    &quot;detail&quot;: { ... } // actual details goes here<br>}</pre><p>Note:</p><p>AWS handles the following fields : <strong>version, account, time and region </strong><br>We need to define the fields: <strong>source,</strong> <strong>detail &amp; detail-type</strong></p><blockquote><strong>Send &amp; Receive Custom OrderCreated events through Custom Event Bus</strong></blockquote><p>In this article, lets see how to send &amp; receive the Custom application event</p><p>Here is diagram represents Use-case scenario.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*trrd-jJEgGoz0J9HUXlvNg.png" /><figcaption><strong>EventBridge Custom Event — UseCase Flow Diagram</strong></figcaption></figure><p><strong>Step-01: Create Custom Event Bus</strong></p><ul><li>Go to AWS Management Console &gt; Select EventBridge Service</li><li>Select Event Bus &gt; Create Custom Event Bus.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6tbHMXkhS8F0dE2P6ZdrA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4sZhWn2lKSYf3D6mdmTikA.png" /></figure><p><strong>Step-02: (FulFillment Service) Target Lambda function to process OrderCreated event.</strong></p><p>Create Lambda Function to process event as when Order is created in OrderService System.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oFujpUlOhY5HdniHfSPlSQ.png" /></figure><pre>import json<br><br>def lambda_handler(event, context):<br>    # TODO implement<br>    <br>    print(events)<br>    <br>    # Process Events<br>    # Custom Code goes here...<br>    <br>    return {<br>        &#39;statusCode&#39;: 200,<br>        &#39;body&#39;: json.dumps(&#39;Succesfully processed OrderCreated event from OrderService!&#39;)<br>    }</pre><p><strong>Step-03: Create Custom Event Rule</strong></p><p>Go to the AWS Management Console &gt; Select Event Bridge &gt; Select Rule &gt; Create Event Rule</p><p>Step: 03.1: Define the Rule details</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3CrMW_tvi9BPVyfJA9NQ2A.png" /></figure><p>Step: 03.2 : Choose Event Source Options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JTMiTHxRUrAa4O6Ryk2wdQ.png" /></figure><p>Step: 03.3: Define event pattern in JSON</p><pre>{<br> &quot;source&quot;: [&quot;OrderService&quot;],<br> &quot;detail&quot;: {<br>    &quot;event_type&quot;: [&quot;order_created&quot;]<br> }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AHce5z9KUYJd_MmD1lm0yw.png" /></figure><p>Step: 03.4 Select the Target</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NvdzlUMgqz7cKFtjjQy-4g.png" /></figure><p>Step: 03.5 : Ensure Rule is created successfully within Custom Event Bus</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SUPFLbWBiJlW1URqCzoYAg.png" /></figure><p><strong>Step-04: Publish event from OrderService Lambda function</strong></p><p>Step 04.1 : Create Lambda function for OrderService</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ywEqVF-Whepfyf6XM2-OOQ.png" /></figure><p>Step 04.2 : OrderService Lambda function to put event.</p><p>Sample Code snippet to show how to publish events in EventBridge.</p><pre>import json<br>import boto3<br><br>def lambda_handler(event, context):<br>    <br>    client = boto3.client(&#39;events&#39;)<br>    <br>    detailJsonString = &#39;{&quot;event_type&quot;: &quot;order_created&quot;, &quot;OrderId&quot; : &quot;001-400-200&quot;}&#39;<br>    response = client.put_events(<br>        Entries=[<br>            {<br>                &#39;Source&#39;:&#39;OrderService&#39;,<br>                &#39;Detail&#39;:  detailJsonString,<br>                &#39;DetailType&#39; : &#39;Order Management Event&#39;,<br>                &#39;EventBusName&#39;:&#39;custom-event-bus&#39;<br>            }<br>        ]<br>    )<br>    <br>    print(response)</pre><p><strong>Step-05: Test Event from Receiver end (Fulfilment Service)</strong></p><p>Go to CloudWatch Logs of FulFilment Service to see the event information.</p><pre>{<br> &#39;version&#39;: &#39;0&#39;, <br> &#39;id&#39;: &#39;eec85261-2148-1514-4bb9-73bed5dc1f00&#39;, <br> &#39;detail-type&#39;: &#39;Order Management Event&#39;, <br> &#39;source&#39;: &#39;OrderService&#39;, <br> &#39;account&#39;: &#39;682960446509&#39;, <br> &#39;time&#39;: &#39;2024-07-14T18:34:06Z&#39;, <br> &#39;region&#39;: &#39;us-east-1&#39;, &#39;resources&#39;: [], <br> &#39;detail&#39;: {&#39;event_type&#39;: &#39;order_created&#39;, &#39;OrderId&#39;: &#39;001-400-200&#39;}<br>}</pre><blockquote><strong>Conclusion</strong></blockquote><p>In this article, we have seen how we can publish and receive Custom event through Custom Evenbridge Event Bus.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3782d2cd722" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWSAppSync Intro— Build the simple GraphQL API with DynamoDB as DataSource]]></title>
            <link>https://medium.com/@g.bharthvajan/awsappsync-intro-build-the-simple-graphql-api-with-dynamodb-as-datasource-e0f8be7b26d4?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0f8be7b26d4</guid>
            <category><![CDATA[graphql]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[graphql-resolver]]></category>
            <category><![CDATA[graphql-api-vs-rest-api]]></category>
            <category><![CDATA[aws-appsync]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Thu, 04 Jul 2024 08:50:39 GMT</pubDate>
            <atom:updated>2024-07-04T08:50:39.569Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS AppSync Intro— Build the simple GraphQL API with DynamoDB as DataSource</h3><blockquote><strong>Introduction</strong></blockquote><p>This article covers the basic introduction &amp; concept of GraphQL &amp; AWS AppSync service. And how to build simple GraphQL api using AWS AppSync with DynamoDB as datasource.</p><blockquote><strong>What is GraphQL API ?</strong></blockquote><ul><li>An open-source data query and manipulation language for APIs.</li><li>It is a modern query language and a runtime for APIs, and seems to be Next-gen to REST APIs.</li><li>It introduces the concept of “<strong>fetch exactly what you required</strong>”, without any <strong>under fetching or over fetching</strong> of data.</li></ul><blockquote><strong>GraphQL Operations</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fT7pFwpy8C9QBavco89tww.png" /></figure><blockquote><strong>REST API vs GraphQL : API Request &amp; Response</strong></blockquote><p>The following diagram shows the difference in making simple api request / response call with REST API vs GraphQL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aUoeZEHO9OIt5K5S0Hhb5w.png" /></figure><blockquote><strong>AppSync Intro</strong></blockquote><p>It allows to develop Serverless GraphQL API</p><p>AWS AppSync works primarily on the GraphQL protocol, enables applications to request what they need, and nothing more, from the following supporting data sources</p><ul><li>Amazon DynamoDB</li><li>Relational Database (Aurora)</li><li>Lambda</li><li>Http Endpoint</li></ul><blockquote><strong>AppSync Capability &amp; Integration</strong></blockquote><p>Apart from the API endpoint, AppSync has rich capability in terms of monitoring, securing &amp; caching the API enpoints. Following digrams covers AppSync capability in detail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8FAoMBz5pwCDqV4_I-MAhA.png" /></figure><blockquote><strong>AppSync Key Components</strong></blockquote><p>The following diagram covers the basic building blocks of AppSync.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZI5RvaGcUgKu82laYf7oRw.png" /></figure><blockquote><strong>Step by Step in Creating Simple GraphQL Custom API</strong></blockquote><p><strong>Step-01: Create DynamoDB “customer” table</strong></p><p>Let&#39;s start with DataSource.</p><ul><li>Go to AWS Management Console &gt; Select DynamoDB Service</li><li>Create Table “customer”, with “id” as partition key</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S_D7RYxyd4AhBk3DGqUdow.png" /></figure><p>Lets create an item with attributes (first_name, last_name etc) as shown in below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p69m4sjPang-KItuyr3HUg.png" /></figure><p><strong>Step-02: Create “Customer”GraphQL API</strong></p><p><strong>2.1 Create DynamoDB table</strong></p><ul><li>Go to AWS Management Console &gt; Select AppSync Service</li><li>Choose API &gt; Click on Create API Button</li><li>Select API Type as GraphQL API</li><li>For the Data source, choose “Start with DynamoDB table”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KBGI1ERiXjze6rQKv6I5qg.png" /></figure><p><strong>2.2 Specify the API Details</strong></p><p>Configure the api details with “API Name”, choose DynamoDB region &amp; table from the dropdown as shown in the below screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctJ7cCjZyjVdSOGZVHAHqQ.png" /></figure><p><strong>2.3 Configure GraphQL resource</strong></p><ul><li>On the GraphQL resources, lets add the fields with field name and required flag. This will create Schema for the GraphQL</li><li>And Select Runtime as Javascript.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bJhzvsWTGmUrPDdMRVnHcA.png" /></figure><p><strong>2.4 Complete the configuration to create API.</strong></p><p><strong>Step-03: Verify the Schema &amp; Resolver scripts.</strong></p><p><strong>3.1 Schema</strong></p><p>Go to AppSync &gt; Select APIs &gt; Select “Customer API” &gt; Choose “Schema” to view the auto generated schema.</p><ul><li><strong>Query</strong> block talks about query from Customer Table</li><li><strong>Mutation</strong> block talks about add / update / delete Customer rows in the table</li></ul><pre>type Customer {<br> id: String!<br> first_name: String!<br> last_name: String!<br> gender: String<br> address: String<br> zipcode: String<br> active: Boolean<br>}<br><br>type Query {<br> getCustomer(id: String!): Customer<br> listCustomers(filter: TableCustomerFilterInput, limit: Int, nextToken: String): CustomerConnection<br>}<br><br>type Mutation {<br> createCustomer(input: CreateCustomerInput!): Customer<br> updateCustomer(input: UpdateCustomerInput!): Customer<br> deleteCustomer(input: DeleteCustomerInput!): Customer<br>}</pre><p><strong>3.2 : Resolver Code (in Javascript)</strong></p><p>From the Schema, on the right side, we can find the resolver for the getCustomer. Click on resolver, which will take to Resolver script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmwv30aZlF6HEn9qq9kCgQ.png" /></figure><p>Simple Resolver code which has always two function (request &amp; response)</p><p>For the Query resolver</p><ul><li>request(ctx): Requedest from DynamoDB Item</li><li>response(ctx) : Returns the fetched DynamdoDB Item</li></ul><pre>import { util } from &#39;@aws-appsync/utils&#39;;<br>import { get } from &#39;@aws-appsync/utils/dynamodb&#39;;<br><br>/**<br> * Sends a request to get an item with id `ctx.args.id` from the DynamoDB table.<br> * @param {import(&#39;@aws-appsync/utils&#39;).Context&lt;{id: unknown;}&gt;} ctx the context<br> * @returns {import(&#39;@aws-appsync/utils&#39;).DynamoDBGetItemRequest} the request<br> */<br>export function request(ctx) {<br>    const { id } = ctx.args;<br>    const key = { id };<br>    return get({<br>        key,<br>    })<br>}<br><br>/**<br> * Returns the fetched DynamoDB item.<br> * @param {import(&#39;@aws-appsync/utils&#39;).Context} ctx the context<br> * @returns {*} the DynamoDB item<br> */<br>export function response(ctx) {<br>    const { error, result } = ctx;<br>    if (error) {<br>        return util.appendError(error.message, error.type, result);<br>    }<br>    return result;<br>}</pre><blockquote><strong>Test the API Endpoint in Postman</strong></blockquote><p>Lets find the API endpoint from Settings screen.</p><p>Go the settings page &gt; API details section &gt; Find the GraphQL Endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-pwl7dmJBOAyMP6B0qxNSQ.png" /></figure><p>And copy the API Key from “Primary Authorisation mode” section in same page.</p><p>To test api endpoint in PostMan, here are the configuration.</p><ul><li>User Http Method as “POST”</li><li>Use the GraphQL Endpoint.</li></ul><p>Request Body Payload:</p><pre>query MyQuery {<br>  getCustomer(id: &quot;123&quot;) {<br>    first_name<br>    last_name<br>  }<br>}</pre><p>Http Header:</p><ul><li>Content-Type : application/graphql</li><li>x-api-key : &lt;&lt;API key retrieved from setting page &gt;&gt;</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uGcb7sjAV1s4wdMZjn10LA.png" /></figure><p>API Response</p><pre>{<br>    &quot;data&quot;: {<br>        &quot;getCustomer&quot;: {<br>            &quot;first_name&quot;: &quot;John&quot;,<br>            &quot;last_name&quot;: &quot;Doe&quot;<br>        }<br>    }<br>}</pre><blockquote><strong>Conclusion</strong></blockquote><p>In this article, we have seen, basic concepts of GraphQL, AppSync and how to build api quickly having dynamodb as Datasource and how to test the API endpoint in the Postman</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0f8be7b26d4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building Movie Recommendation System with AWS ML Services.]]></title>
            <link>https://medium.com/@g.bharthvajan/building-movie-recommendation-system-with-aws-ml-services-869bf2b8486f?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/869bf2b8486f</guid>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[factorization-machine]]></category>
            <category><![CDATA[amazon-personalize]]></category>
            <category><![CDATA[ml-service]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 19:10:52 GMT</pubDate>
            <atom:updated>2024-06-27T04:23:54.377Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Introduction</strong></blockquote><p>Movie or Product recommendation is one of the most popular applications in Machine Learning. And<strong> recommendation systems</strong> are based on modelling the preferences of the users on the items based on their past interactions. (e.g click events, user ratings)</p><p>There are two ways we can build recommendation system in AWS Cloud platform.</p><ol><li><strong>Amazon SageMaker — Factorization Machine Algorithm</strong></li><li><strong>Amazon Personalize</strong></li></ol><blockquote><strong>Amazon Personalize vs SageMaker: Factorization Machine</strong></blockquote><p>Here is the table talks about Amazon Personalize vs SageMaker FM algorithm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9Ru0GqX0Tj1ETWXRUNIMQ.png" /><figcaption><strong>Amazon Personalize vs SageMaker Factorization Machine</strong></figcaption></figure><p>In this article, lets see quick example for Movie recommendation using Factorization Machine.</p><blockquote><strong>Factorization Machine — Intro</strong></blockquote><ul><li>Deals with Sparse data</li><li>It is extension of linear learning model to work on sparse data</li><li>Supervised Algorithm</li><li>Can be used for classification or regression problem</li><li>It expects all categorical values to be OneHotEncoded.</li><li>For model training, it expects recordio protobuf data format</li><li>It expects data in float-32 data type.</li><li>CSV file does not work</li></ul><blockquote><strong>What is Record IO Protobuf ??</strong></blockquote><ul><li>RecordIO is a file format used for efficient data storage and retrieval, particularly in the context of deep learning and data processing.</li><li>It allows to store large amounts of data in binary format, making it more compact and faster to read.</li><li>Protobuf (Protocol Buffers) is a language-neutral, platform-neutral, and extensible data interchange format</li><li>RecordIO + Protobuf, provides a way to store data efficiently in binary format</li></ul><blockquote><strong>OneHotEncoding</strong></blockquote><ul><li>One hot encoding provides a method of having a numeric representation of a feature that does not also have a size difference.</li><li>Binary values are assigned to each category. The zeros and ones form binary variables which show the presence or absence of a category.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ctaEEdVmHkf2khWAOnVXgw.png" /><figcaption><strong>Example : OneHotEncoding</strong></figcaption></figure><blockquote><strong>Building FM Model : High level steps</strong></blockquote><p>Steps involved in dataset preparation, preprocessing, training and deployment of Factorization Machine model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*OMnD9vm5l_A5WTCSRFBM-g.png" /></figure><blockquote><strong>Training &amp; Test DataSet</strong></blockquote><p>In this article, we will use MovieLens data sets, consists of: 100,000 ratings (1–5) from 943 users on 1682 movies.</p><p>Here is dataset link <a href="https://grouplens.org/datasets/movielens/100k/">https://grouplens.org/datasets/movielens/100k/</a></p><p>Dataset consist of the following attributes.</p><ul><li>userId = unique identifier of the user. [Input Feature]</li><li>movieId = unique identifier of the movie. [Input Feature]</li><li>rating = User rating of the movie (1–5). [Target]</li><li>timestamp = date variable.</li></ul><ol><li>Download dataset.</li></ol><pre># !wget http://files.grouplens.org/datasets/movielens/ml-100k.zip<br># !unzip -o ml-100k.zip</pre><p>2. Create training &amp; testing dataframe</p><pre>ratings_train_df = pd.read_csv(&#39;ua.base&#39;, sep=&#39;\t&#39;, names=[&#39;userId&#39;,&#39;movieId&#39;,&#39;rating&#39;,&#39;timestamp&#39;] )<br>ratings_test_df = pd.read_csv(&#39;ua.test&#39;, sep=&#39;\t&#39;, names=[&#39;userId&#39;,&#39;movieId&#39;,&#39;rating&#39;,&#39;timestamp&#39;] )</pre><p>3. Convert the target variable (rating) into binary</p><pre>ratings_train_df[&#39;rating_bin&#39;] = (ratings_train_df.rating&gt;=4).astype(&#39;float32&#39;)<br>ratings_test_df[&#39;rating_bin&#39;] = (ratings_test_df.rating&gt;=4).astype(&#39;float32&#39;)</pre><p>4. Use OneHotEncode strategy</p><pre>encoder = OneHotEncoder(handle_unknown=&#39;ignore&#39;)<br>encoder.fit(ratings_train_df[[&#39;userId&#39;,&#39;movieId&#39;]])<br><br>x_train = encoder.transform(ratings_train_df[[&#39;userId&#39;,&#39;movieId&#39;]]).astype(&#39;float32&#39;)<br>y_train = ratings_train_df[&#39;rating_bin&#39;]<br><br>x_test = encoder.transform(ratings_test_df[[&#39;userId&#39;,&#39;movieId&#39;]]).astype(&#39;float32&#39;)<br>y_test = ratings_test_df[&#39;rating_bin&#39;]</pre><p>5. Prepare for Model training with instance count, instance type, max run time</p><pre>from sagemaker.image_uris import retrieve<br><br>role = get_execution_role()<br>session = sagemaker.Session()<br><br>training_image = retrieve(region=boto3.Session().region_name, framework=&quot;factorization-machines&quot;, version=&#39;latest&#39;)<br><br>fm = sagemaker.estimator.Estimator(<br>    training_image, role,<br>    instance_count=1,<br>    instance_type=&#39;ml.c4.xlarge&#39;,<br>    volume_size=30,<br>    max_run=86400,<br>    output_path=output_path_prefix,<br>    sagemaker_session=session,<br>)</pre><p>5. Set Hyperparameter &amp; channel to initiate training job.</p><pre>fm.set_hyperparameters(<br>    feature_dim=columns,<br>    predictor_type=&#39;binary_classifier&#39;,<br>    mini_batch_size=200<br>)<br><br>data_channels = {<br>    &quot;train&quot;: train_data,<br>    &quot;test&quot;: test_data<br>}<br><br>fm.fit(inputs=data_channels, logs=True)</pre><p>6. Deploy the Model for the prediction (which creates real time endpoint)</p><pre>%%time<br>fm_predictor = fm.deploy(<br>    initial_instance_count=1,<br>    instance_type=&quot;ml.c4.xlarge&quot;,<br>    deserializer= JSONDeserializer()<br>)</pre><p>7. Cleanup (Delete the endpoint)</p><pre>fm_predictor.delete_endpoint()</pre><blockquote><strong>Conclusion</strong></blockquote><p>To summarize</p><ul><li>Amazon Personalize is a fully-managed service focused on real-time recommendation systems, providing ease of use and scalability.</li><li>Amazon SageMaker is a more versatile and customizable service that enables developers to build, train, and deploy custom machine learning models for various tasks</li></ul><p>We’ve seen quick example for item recommendation using Factorization Machine, we ‘ll cover using Amazon Personalize in next article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=869bf2b8486f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Semantic Search by Amazon OpenSearch Serverless & Amazon Bedrock]]></title>
            <link>https://medium.com/@g.bharthvajan/semantic-search-by-amazon-opensearch-serverless-amazon-bedrock-ca21bf42a516?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/ca21bf42a516</guid>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[opensearch]]></category>
            <category><![CDATA[vector-embeddings]]></category>
            <category><![CDATA[opensearch-serverless]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Tue, 09 Apr 2024 19:04:17 GMT</pubDate>
            <atom:updated>2024-04-09T19:04:17.583Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong>Introduction</strong></blockquote><p>In this article, we will cover the topic, “how we can leverage OpenSearch Serverless to perform Semantic search”, this is something different than typical full text search.</p><blockquote><strong>Amazon OpenSearch</strong></blockquote><ul><li>It is derived from a mature version of<strong> </strong>Elasticsearch</li><li>It is a highly scalable, fully managed search engine and analytics service</li></ul><blockquote><strong>Amazon OpenSearch Serverless</strong></blockquote><p>It is a serverless deployment option for OpenSearch that eliminates the need to provision and manage infrastructure.</p><blockquote><strong>Full Text Search</strong></blockquote><ul><li>It is a search technique that looks for matches of a search query within the entire text of a document rows or a set of documents.</li><li>It searches for all occurrences of the words or phrases that are specified in the search query, regardless of their location or context within the document.</li></ul><blockquote><strong>Semantic Search</strong></blockquote><ul><li>It is a more advanced search technique understands the meaning of the search query and the context in which it is used.</li><li>It uses natural language processing (NLP) and machine learning to understand the intent behind the search query and provide more relevant results.</li></ul><blockquote><strong>Vector Embeddings</strong></blockquote><ul><li>Way to represent complex data, such as words, sentences, or even images as points in a vector space, using vectors of real numbers</li><li>Vector embeddings are a way to convert words and sentences and other data (audio, image etc) into numbers that capture their meaning and relationships</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-6n8_UolHj64BPfKFX-bwQ.png" /></figure><blockquote><strong>Semantic Search &amp; Vector Embedding</strong></blockquote><ul><li>Semantic search is one of the most popular uses of vector embeddings. Search algorithms like KNN and ANN require us to calculate distance between vectors to determine similarity.</li></ul><blockquote><strong>Types of Vector Embedding</strong></blockquote><ul><li>Word / Text Embedding</li><li>Document Embedding</li><li>Image Embedding</li><li>Audio Embedding</li></ul><blockquote><strong>Create a Collection</strong></blockquote><p>Collection is very similar to Database in RDBMS world. Here are the steps to create a collection.</p><ul><li>Go to AWS Management Console</li><li>From the Services -&gt; select OpenSearch</li><li>Choose Serverless</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CS1-kDWNy6UIFshOy-UJvQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tO8k7GM0CgkXnw5ajkuZFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zzhEDObwbodYjgiYgGBqw.png" /></figure><blockquote><strong>Create Vector Index with JSON configuration</strong></blockquote><p>Index is similar to Table in the Database. Here are steps covers to create vector index in a collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zaLIiupeXZVYAj4vHMP8xg.png" /></figure><p>Refer to the following JSON configuration, which has “mappings” &amp; “settings” details to create an index</p><p>Note: We have only two properties (fields (or) columns) in this index(table)</p><ul><li>doc_text : Data type is text</li><li>doc_vector: Data type is vector with dimension 4096</li></ul><pre>{<br>    &quot;mappings&quot;: {<br>        &quot;properties&quot;: {<br>            &quot;doc_text&quot;: {&quot;type&quot;: &quot;text&quot;},<br>            &quot;doc_vector&quot;: {<br>                &quot;type&quot;: &quot;knn_vector&quot;,<br>                &quot;dimension&quot;: 4096,<br>                &quot;method&quot;: {<br>                    &quot;engine&quot;: &quot;nmslib&quot;,<br>                    &quot;space_type&quot;: &quot;cosinesimil&quot;,<br>                    &quot;name&quot;: &quot;hnsw&quot;,<br>                    &quot;parameters&quot;: {&quot;ef_construction&quot;: 512, &quot;m&quot;: 16}<br>                }<br>            }<br>        }<br>    },<br>    &quot;settings&quot;: {<br>        &quot;index&quot;: {<br>            &quot;number_of_shards&quot;: 1,<br>            &quot;knn.algo_param&quot;: {&quot;ef_search&quot;: 512},<br>            &quot;knn&quot;: true<br>        }<br>    }<br>}</pre><p>Ensure the index is created within the collection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kcQ3b2uVCaAi5WStfdtag.png" /></figure><blockquote><strong>Create Lambda function to ingest words &amp; perform semantic search</strong></blockquote><ul><li>Go to AWS Management Console</li><li>Choose Lambda service</li><li>Create Function &amp; enter the function name</li><li>Select Runtime as latest python 3.12 [Pls note: This runtime have latest boto3 having bedrock service.]</li><li>Ensure lambda’s IAM role has required policy permission for Bedrock and OpenSearch Service.</li></ul><p><strong>Code snippet :</strong> Create Vector Embedding for text/words leveraging Amazon Titan model.</p><pre>import json<br>import boto3<br>import logging<br>from opensearchpy import OpenSearch, RequestsHttpConnection<br><br>logger = logging.getLogger()<br>logger.setLevel(logging.INFO)<br><br>bedrock = boto3.client(service_name=&#39;bedrock-runtime&#39;)<br><br>def lambda_handler(event, context):<br><br>    # Covert Word to Vector<br>    <br>    text_obj1 = &quot;Tital Model : Text &amp; Image generation, Summarization,&quot;<br>    text_obj2 = &quot;Stable Diffusion: Generate high quality image&quot;<br>    text_obj3 = &quot;Claude: Content Creation and Complex Reasoning&quot;<br><br>    vector_obj1 = word_embedding(text_object1)<br>    vector_obj2 = word_embedding(text_object2)    <br>    vector_obj3 = word_embedding(text_object2)<br><br>    # Ingest vector embedding to OpenSearch<br>    ingest_document(text_obj1, vector_obj1)<br>    ingest_document(text_obj2, vector_obj2)<br>    ingest_document(text_obj3, vector_obj3)<br><br>def word_embedding(text):<br>    body=json.dumps({&quot;inputText&quot;: text})<br>    response = bedrock.invoke_model(body=body, modelId=&#39;amazon.titan-embed-text-v1&#39;, accept=&#39;application/json&#39;, contentType=&#39;application/json&#39;)<br>    response_body = json.loads(response.get(&#39;body&#39;).read())<br>    embedding = response_body.get(&#39;embedding&#39;)<br>    return embedding</pre><p><strong>Code Snippet: Ingest Vector Embedding to OpenSearch</strong></p><pre>opensearch_client = OpenSearch(<br>    hosts = [{&quot;host&quot;: &quot;opensearch_endpoint_placeholder&quot;, &quot;port&quot;: 443}],<br>    http_auth = auth, use_ssl = True, verify_certs = True,<br>    connection_class = RequestsHttpConnection,<br>    pool_maxsize = 10<br>)<br><br>def ingest_document(text_obj, vector_obj):<br>    document = {<br>      &quot;doc_text&quot;: text_obj,<br>      &quot;doc_vector&quot;: vector_obj<br>    }<br>    <br>    response = client.index(<br>        index = &#39;doc_index1&#39;,<br>        body = document<br>    )</pre><p><strong>Code snippet : </strong>Perform Semantic Search using OpenSearch Query DSL</p><p>Lets say we want to perform semantic search for “Image Model” from the index, first we need to convent search query text to vector embedding and then call the following method.</p><pre>def perform_vector_search(vector):<br>    document = {<br>        &quot;size&quot;: 15,<br>        &quot;_source&quot;: {&quot;excludes&quot;: [&quot;doc_vector&quot;]},<br>        &quot;query&quot;: {<br>            &quot;knn&quot;: {<br>                 &quot;doc_vector&quot;: {<br>                     &quot;vector&quot;: vector,<br>                     &quot;k&quot;:10<br>                 }<br>            }<br>        }<br>    }<br>    response = client.search(<br>    body = document,<br>    index = &quot;doc_index1&quot;<br>    )<br>    return response</pre><blockquote><strong>Conclusion</strong></blockquote><p>Finally to conclude, we have seen, how the OpenSearch provides efficient vector similiarity search by providing specialized k-NN index.</p><p>In next article, we will cover the use case ofOpenSearch Service’s vector database with Retrieval Augmented Generation (RAG) with LLMs, recommendation engines, and search rich media.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca21bf42a516" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Bedrock : Generate Image using Stability AI Model from Lambda function.]]></title>
            <link>https://medium.com/@g.bharthvajan/amazon-bedrock-generate-image-using-stability-ai-model-from-lambda-function-807b22081c36?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/807b22081c36</guid>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[bedrock]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[stable-diffusion]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Sun, 14 Jan 2024 11:25:11 GMT</pubDate>
            <atom:updated>2024-01-14T11:25:11.953Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon Bedrock : Generate Image using Stability AI Model from Lambda function.</h3><blockquote><strong>What is Amazon Bedrock ?</strong></blockquote><ul><li>It is a solution for Generative AI on AWS</li><li>Build and scale generative AI applications, that can generate text, images, audio, and synthetic data in response to prompts.</li><li>It gives the platform allows to choose AI models they would like to build their apps on top of, and then customise them with their own private data</li><li>It Provides many of the leading AI models (such as Anthropic’s Claude and Meta’s Llama 2) under one roof, allowing businesses to easily pick and choose the models they like, and experiment for different use cases</li></ul><blockquote><strong>Available Generative AI Models in Amazon Bedrock</strong></blockquote><p>Following diagram covers all the supported Generative AI models &amp; respective use-case in the Amazon Bedrock.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWh9Z70fKf1Acru9OFykvA.png" /></figure><blockquote><strong>Request Model Access </strong>(Important Step before accessing Model APIs.)</blockquote><p>By defaults models are not enabled in AWS Account. To access the Models, we need to request for granting access to Models (Note: it is available only in certain regions only).</p><ul><li>Go to AWS Management Console</li><li>Choose Amazon Bedrock service</li><li>Select “Model Access” to manage</li><li>Choose models to request for access (as shown below)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1VydnOAIUoNkZUa6IoZRyw.png" /><figcaption><strong>Request for Model Access</strong></figcaption></figure><ul><li>Ensure model access is granted as shown in following picture.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H4rDHMR1g6JTdytE7dEVng.png" /><figcaption><strong>Requested Model Access — granted</strong></figcaption></figure><blockquote><strong>Examples &amp; API Request in Amazon Bedrock</strong></blockquote><p>We can also refer some Examples mentioned in Amazon Bedrock, which based on search, providers or user-case.</p><p>Here is the example to create an image with text prompt using stability model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jwtMdx5aFW0M9eDJ_kDWDg.png" /></figure><blockquote>Create Lambda function with requirement IAM role &amp; Permission</blockquote><ul><li>Go to AWS Management Console</li><li>Choose Lambda service</li><li>Create Function &amp; enter the function name</li><li>Select Runtime as latest python 3.12 [Pls note: This runtime have latest boto3 having bedrock service.]</li><li>Ensure lambda’s IAM role has required policy permission for Bedrock, S3 services.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cglnXTyh_kDJeYP7QROxBg.png" /></figure><blockquote><strong>Coding — Steps involved in text to image in the Lamba function.</strong></blockquote><p><strong>Step-1:</strong> Import libraries</p><pre>import base64<br>import io<br>import json<br>import os<br>import sys<br>import boto3<br><br># Bedrock Runtime client used to invoke and question the models<br>bedrock_runtime = boto3.client(service_name=&#39;bedrock-runtime&#39;)</pre><p><strong>Step-2:</strong> Configure the Model id</p><pre>model_id = &quot;stability.stable-diffusion-xl-v0&quot;</pre><p><strong>Step-3: </strong>Create Prompt &amp; form the payload with steps</p><pre>def lambda_handler(event, context):<br>    <br>    prompt = &quot;a beautiful lake with cat and fish&quot;    <br>    <br>    payload = {<br>        &quot;text_prompts&quot;: [{&quot;text&quot;: prompt}],<br>        &quot;cfg_scale&quot;: 12,<br>        &quot;seed&quot;: 452345,<br>        &quot;steps&quot;: 80,<br>    } <br>    body = json.dumps(payload)</pre><p><strong>Step-4:</strong> Invoke the Model</p><pre>    <br>    response = bedrock_runtime.invoke_model(<br>        body=body,<br>        modelId=model_id,<br>        accept=&quot;application/json&quot;,<br>        contentType=&quot;application/json&quot;,<br>    )</pre><p><strong>Step-5:</strong> Get the response API and save image in S3 bucket</p><pre>    # Get the image from the API response. It is base64 encoded.<br>    response_body = json.loads(response.get(&quot;body&quot;).read())<br>    artifact = response_body.get(&quot;artifacts&quot;)[0]<br>    image_encoded = artifact.get(&quot;base64&quot;).encode(&quot;utf-8&quot;)<br>    image_bytes = base64.b64decode(image_encoded)<br>    <br>    # Save image to S3 location.<br>    content=&quot;String content to write to a new S3 file&quot;<br>    s3_client.Object(&#39;s3-bucket&#39;, &#39;image-name.png&#39;).put(Body=image_bytes)  </pre><p><strong>Step-6: </strong>Test the function with sample event and check the image generated in S3 bucket.</p><p>Here is the sample output from Stable Diffusion Model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*yfO4qLCu_7h5nmIKaJ5-jw.png" /></figure><blockquote><strong>Conclusion</strong></blockquote><p>Amazon Bedrock provides developers access to a diverse array of foundation models through a serverless API.</p><p>It simplifies the application development and deployment process by offering access to foundational models and removes the necessity for developers to build their infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=807b22081c36" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon SageMaker AutoPilot 101 — Create Experiment programatically]]></title>
            <link>https://medium.com/@g.bharthvajan/amazon-sagemaker-autopilot-101-create-experiment-programatically-25cbc98da44b?source=rss-d572efccbdfa------2</link>
            <guid isPermaLink="false">https://medium.com/p/25cbc98da44b</guid>
            <category><![CDATA[mls]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[autopilot]]></category>
            <category><![CDATA[automl]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Bharathvajan G]]></dc:creator>
            <pubDate>Sun, 19 Nov 2023 15:46:20 GMT</pubDate>
            <atom:updated>2023-11-19T15:51:43.042Z</atom:updated>
            <content:encoded><![CDATA[<h3>Amazon SageMaker AutoPilot 101 — Create Experiment programatically</h3><blockquote><strong>Amazon SageMaker</strong></blockquote><ul><li>AWS SageMaker is a fully-managed service for machine learning in the cloud.</li><li>It lets you build and train machine learning models, directly deploying them into a production-ready, hosted environment.</li><li>SageMaker providing various following features</li></ul><p><strong>Jupyter Notebooks</strong> — SageMaker provides an integrated Jupyter notebook authoring instance. It offers easy access to data sources for exploration and analysis. There is no need to manage servers.</p><p><strong>Machine Learning Algorithms</strong> — SageMaker provides common machine learning algorithms optimized to run against large data in a distributed environment.</p><blockquote><strong>Amazon SageMaker AutoPilot</strong></blockquote><ul><li>It <strong>automatically</strong> builds, trains, and tunes machine learning models based on your data, by giving full control and visibility.</li><li>It prepares data, tests different algorithms, and optimizes model parameters to find the best approach for your data.</li><li>It has full visibility and control, transparent approach to AutoML, where — developers can manually inspect all the steps taken by the auto-ml algorithm from feature engineering to model training and selection.</li></ul><blockquote><strong>AutoPilot Experiment</strong></blockquote><ul><li>AutoPilot Experiment is used to start the AutoPilot job in Amazon SageMaker.</li><li>Experiment can be created using AWS SDK (programatically) or by Studio.</li></ul><blockquote><strong>AutoPilot : Process Activity</strong></blockquote><p>AutoML Process involves — following steps</p><ul><li>Input data</li><li>Selecting target column</li><li>Choose right algorithm, Create Model automatically</li><li>Selecting best models</li><li>Model deployment</li></ul><p>Following diagram describes about activities involved in AutoML process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRBKSWBMR6pAfiBcBr_YDA.png" /><figcaption><strong>Activity Steps involved in Auto ML Process.</strong></figcaption></figure><blockquote><strong>AutoPilot — Supporting ML Problem statement</strong></blockquote><p>Following diagram shows — supported ML problem statement by AutoPilot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wjpn5S_cNss2S3brnc-DQ.png" /></figure><blockquote><strong>Steps : To Create Experiment Programatically</strong></blockquote><ul><li><strong>Step-1 : Add Import Statement</strong></li></ul><pre>import boto3<br>import sagemaker</pre><ul><li><strong>Step-2 : Create Session:</strong></li></ul><pre>session = sagemaker.Session()<br>bucket = session.default_bucket()<br>role = sagemaker.get_execution_role()<br>region = boto3.Session().region_name</pre><ul><li><strong>Step-3 : Create SageMaker Client:</strong></li></ul><pre>sagemaker = boto3.Session().client(service_name=&#39;sagemaker&#39;, <br>                        region_name=region)</pre><ul><li><strong>Step-4 : </strong>Configure Job: Training time, Number of candidate models</li></ul><pre>aupilot_job_config = {<br>  &#39;CompletionCriteria&#39;: {<br>    &#39;MaxRuntimePerTrainingJobInSeconds&#39;: 900,<br>    &#39;MaxCandidates&#39;: 5,<br>    &#39;MaxAutoMLJobRuntimeInSeconds&#39;: 5000<br>  },<br>}</pre><ul><li><strong>Step-5 : </strong>Configure — S3 Input Data location of CSV &amp; label column name</li></ul><pre>job_input_data_config = [{<br>  &#39;DataSource&#39;: {<br>    &#39;S3DataSource&#39;: {<br>      &#39;S3DataType&#39;: &#39;S3Prefix&#39;,<br>      &#39;S3Uri&#39;: &#39;s3://path-to-train-dataset/&#39;<br>    }<br>  },<br>  &#39;TargetAttributeName&#39;: &#39;&lt;target_column_name&gt;&#39;<br>}</pre><ul><li><strong>Step-6 : </strong>Configure output location for the Autopilot-Generated Assets</li></ul><pre>job_output_data_config = {<br>  &#39;S3OutputPath&#39;: f&#39;s3://{bucket}/models/autopilot&#39;<br>}</pre><p><strong>Step-7: </strong>Launch AutoPilot Experiment</p><pre>sagemaker.create_auto_ml_job(<br>  AutoMLJobName    = &#39;sample_auto_mljob_1&#39;,<br>  InputDataConfig  = job_input_data_config,<br>  OutputDataConfig = job_output_data_config,<br>  AutoMLJobConfig  = autopilot_job_config,<br>  RoleArn          = role<br>)</pre><p><strong>Step-8: </strong>To get to know the information about the job</p><pre>job_details = sagemaker.describe_auto_ml_job(<br>  AutoMLJobName = &#39;sample_auto_mljob_1&#39;<br>)<br>print(job_details)</pre><blockquote><strong>AutoML vs AutoPilot</strong></blockquote><p>As we have seen, end-to-end machine learning pipeline has the different stages like 1.Data Acquisition &gt; 2.Data Exploration &gt; 3.Data Preparation &gt; 4.Feature Engineering &gt; 5.Algorithm Section &gt; 6. Model Training &gt; 7.Model Tuning &gt; 8. Model Deployment</p><p>Auto ML automates &amp; simplifies Machine Learning Pipeline. Where as SageMaker Autopilot performs the same with full visibility and transparency.</p><blockquote><strong>Conclusion</strong></blockquote><p>Amazon SageMaker Autopilot aims to empower developers to create sophisticated ML models without having to deal with all the phases of ML workflow.</p><p>Developers can bring a dataset, start a SageMaker Autopilot job and walk away with the best model.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=25cbc98da44b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>