<?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 Saurabh Naik on Medium]]></title>
        <description><![CDATA[Stories by Saurabh Naik on Medium]]></description>
        <link>https://medium.com/@naiksaurabhd?source=rss-89c2bd4bba5d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*K0NisF1xUjGyA44s-y6XAA.jpeg</url>
            <title>Stories by Saurabh Naik on Medium</title>
            <link>https://medium.com/@naiksaurabhd?source=rss-89c2bd4bba5d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 17:00:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@naiksaurabhd/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[Long Videos Retrieval Augmented Generation]]></title>
            <link>https://medium.com/codex/the-future-of-video-comprehension-introducing-video-rag-328be4067f51?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/328be4067f51</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[video-compression]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Sat, 08 Feb 2025 06:44:02 GMT</pubDate>
            <atom:updated>2025-02-10T11:35:01.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NsB2eIt4zN7c2DwjTPHQhw.png" /></figure><h3>Ever wondered how we can efficiently understand and process lengthy videos using AI?</h3><p>In today’s digital age, videos are a dominant form of content, but analyzing long videos remains a challenge for Large Video-Language Models (LVLMs) due to their limited context windows. Traditional solutions, like fine-tuning LVLMs or employing GPT-based agents, often demand extensive resources or rely on proprietary models. However, a groundbreaking approach called Video Retrieval-Augmented Generation (Video-RAG) offers a training-free, cost-effective solution to this problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*Afj_kx7UQx_2D3tb" /></figure><h3>Understanding Video-RAG:</h3><p>Video-RAG is designed to enhance the comprehension capabilities of LVLMs by incorporating auxiliary texts aligned with visual content. Instead of solely processing raw video frames, Video-RAG integrates information from various modalities such as audio transcripts, optical character recognition (OCR), and object detection outputs. This enriched data provides a more comprehensive understanding of the video’s content.</p><h3>Key Advantages of Video-RAG</h3><ol><li><strong>Efficiency</strong>: By utilizing single-turn retrieval, Video-RAG minimizes computational overhead, making it lightweight and swift.</li><li><strong>Flexibility</strong>: This approach is compatible with any existing LVLM without the need for additional training or fine-tuning.</li><li><strong>Proven Performance</strong>: Video-RAG has demonstrated superior accuracy on long-video understanding benchmarks, outperforming proprietary models like Gemini 1.5-Pro and GPT-4o when paired with a 72B model.</li></ol><p>To effectively utilize Video-RAG, follow these three essential steps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-_5x80nMyUhyed9p" /></figure><h3>1. Query Decoupling</h3><p><strong>Objective</strong>: Transform the user’s query to extract pertinent information from the target video.</p><p><strong>Process</strong>: The user query is analyzed by the LVLM to determine the type of information required. The system identifies three categories:</p><ul><li><strong>ASR (Automatic Speech Recognition)</strong>: For answers found in the video’s audio.</li><li><strong>DET (Object Detection)</strong>: For answers found through object detection.</li><li><strong>TYPE</strong>: For relationship or quantity-based questions.</li><li>The LVLM responds with a JSON indicating which categories are relevant, and some categories may be null based on the query.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/0*pznNiAxXnyr0qCXX" /></figure><h3>2. Auxiliary Text Generation and Retrieval</h3><p><strong>Objective:</strong> Generate and retrieve relevant auxiliary texts in parallel, based on the decoupled query.</p><p><strong>Process:</strong></p><ul><li>The system sends the JSON request to dedicated agents for each category (ASR, DET, TYPE).</li><li>Each agent provides a response in plain text.</li><li>From the video, the system creates three databases:</li><li>OCR Database: Converts video frames into text using OCR, encodes the text, and stores it for quick retrieval.</li><li>ASR Database: Extracts audio from the video, converts it to text using models like Whisper, chunks the text, encodes it, and stores it for retrieval.</li><li>DET Table: Identifies keyframes based on object detection, extracts object information, and stores it in the database.</li></ul><h3>3. Integration and Generation</h3><p>Objective: Combine the retrieved auxiliary texts with the user’s query and process them through the LVLM.</p><p><strong>Process:</strong></p><ul><li>Encode the user query along with the OCR and ASR queries generated during decoupling.</li><li>Append the encoded user query, OCR, and ASR values together.</li><li>Calculate the similarity between this combined query and the context in the database.</li><li>If the similarity exceeds a certain threshold, retrieve the relevant information.</li><li>Convert DET values into a scene graph to make them understandable by the LVLM.</li><li>Finally, pass the original user query, combined auxiliary texts (DET, OCR, ASR), and sampled video frames to the LVLM for processing.</li></ul><h3>Factors Influencing Video-RAG’s Performance</h3><ol><li><strong>Number of Sampling Frames</strong>: Increasing the frame rate can improve performance up to a point, after which it may decline.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*vYbBRlAnYdALI66S" /></figure><p><strong>2. Auxiliary Text Impact</strong>: ASR significantly enhances performance compared to OCR and DET.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*i1SnWbukraWevGnK" /></figure><p><strong>3.Retrieval Threshold</strong>: A threshold of 0.3 is optimal; lower values may select too much information, while higher values may reject relevant data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/688/0*mo2ZVA1hm3s5DK_w" /></figure><h3>Call-to-Action:</h3><p>What are your thoughts on Video-RAG and its potential applications? Let’s discuss in the comments!</p><p>Found this article insightful? Share it with your network and follow me for more cutting-edge AI developments.</p><h3>Conclusion:</h3><p>Video-RAG represents a significant advancement in long-video comprehension, offering a resource-efficient and flexible solution that enhances the capabilities of LVLMs. By following the outlined steps, you can harness Video-RAG to improve your video analysis workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rOvE2h0-jobGQNrk" /></figure><p><em>This article is based on the research paper “</em><a href="https://arxiv.org/pdf/2411.13093"><em>Video-RAG: Visually-aligned Retrieval-Augmented Long Video Comprehension</em></a><em>.”</em></p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/the-future-of-video-comprehension-introducing-video-rag"><em>https://saurabhz.hashnode.dev</em></a><em> on February 8, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=328be4067f51" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/the-future-of-video-comprehension-introducing-video-rag-328be4067f51">Long Videos Retrieval Augmented Generation</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling the Future of AI with LLaMA 3.1 and 3.2: What’s New and Why It Matters]]></title>
            <link>https://ai.plainenglish.io/unveiling-the-future-of-ai-with-llama-3-1-and-3-2-whats-new-and-why-it-matters-a75de3831394?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a75de3831394</guid>
            <category><![CDATA[llama-3]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[meta]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 10:36:04 GMT</pubDate>
            <atom:updated>2025-02-10T06:54:15.206Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sXaF0MkpPM4oWaW4" /></figure><h3><strong>Introduction:</strong></h3><p>Ever wondered how AI models are transforming into more powerful, multilingual, and versatile tools for diverse applications? The release of LLaMA 3.1 and 3.2 is a game-changer in this evolution. From supporting multimodal inputs to enabling real-time tool calling, these advancements redefine what AI can achieve.</p><p>In this article, we’ll explore the groundbreaking features of LLaMA 3.1 and 3.2, how they outshine their predecessors, and why you should care. Whether you’re an AI enthusiast, developer, or industry leader, these insights will reveal how LLaMA can elevate your applications and drive innovation.</p><h3>What’s New in LLaMA 3.1 and 3.2 Compared to LLaMA 2 and 3?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ahIQtFYUySIGSKBM" /></figure><h3>1. Tokenizer Upgrades</h3><ul><li><strong>LLaMA 3.1 &amp; 3.2:</strong> Introduce a massive <strong>128k-token vocabulary</strong>, significantly improving text comprehension and generation.</li><li><strong>LLaMA 2:</strong> Only supported a <strong>32k-token vocabulary</strong>, limiting its ability to handle complex linguistic nuances.</li></ul><h3>2. Expanded Context Window</h3><ul><li>The context window in LLaMA 3.1 &amp; 3.2 spans a whopping 128k tokens, compared to the 8k tokens of earlier models. This enables it to process extensive inputs, such as lengthy documents or conversations, without losing context.</li></ul><h3>3. Multilingual Capabilities</h3><ul><li>While LLaMA 3 supported only English, the 3.1 and 3.2 versions now support eight languages, making them versatile tools for global applications.</li></ul><h3>4. Native Tool Calling Support</h3><ul><li>Tool calling was absent in LLaMA 3, but 3.1 &amp; 3.2 bring inbuilt tool calling capabilities, allowing access to real-time data, complex computations, and dynamic agent interactions.</li></ul><h3>5. Introducing LLaMAStack</h3><ul><li>The LLaMAStack provides a series of APIs for customizing models and building agentic applications. It offers two types of APIs:</li><li>Agentic System API: For features like memory, orchestrators, and shields.</li><li>Model Toolchain API: For pretraining, inference, and synthetic data generation.</li></ul><h3>What Sets LLaMA 3.2 Apart from 3.1?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2828Xcwk7aNFq-_Q" /></figure><h3>1. Multimodal Input Capabilities</h3><ul><li>LLaMA 3.2 extends support to 11B and 90B models for handling image and OCR understanding, captioning, QA, and visual reasoning.</li></ul><h3>2. Smaller, Efficient Models</h3><ul><li>With 1B and 3B text models, LLaMA 3.2 offers lightweight solutions for on-device summarization, writing, and translation, ensuring versatility and efficiency.</li></ul><h3>Where Can You Run LLaMA 3.2?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FLkorYS16y8-p7qy" /></figure><h3>1. In the Cloud</h3><ul><li>AWS and Databricks offer seamless integration for deploying LLaMA models at scale.</li></ul><h3>2. On-Premise</h3><ul><li>Use platforms like TorchServe, vLLM, or TGI for secure, enterprise-grade implementations.</li></ul><h3>3. Local Systems</h3><ul><li>Windows and Mac systems support LLaMA 3.2 through tools like Ollama and LM Studio, making AI accessible on personal devices.</li></ul><h3>4. On-Device</h3><ul><li>Optimized for smartphones and edge devices, LLaMA 3.2 ensures real-time processing, even without internet connectivity.</li></ul><h3>Prompt Format: Structuring Effective Interactions</h3><h3>Roles in LLaMA Models:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/0*w2_0WaYHTyYnuJXr" /></figure><ol><li><strong>System:</strong> Defines rules and guidelines for effective responses.</li><li><strong>User:</strong> The input prompt provided by the user.</li><li><strong>Ipython:</strong> A tool role, extending beyond Python for advanced functionalities.</li><li><strong>Assistant:</strong> Represents the model’s output response.</li></ol><h3>Special Tokens for Single/Multi-Turn Chat</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/0*JQidHmrbsx8GLQep" /></figure><ul><li><strong>begin_of_text:</strong> Marks the start of the prompt.</li><li><strong>start_header_id &amp; end_header_id:</strong> Indicate the start and end of a role.</li><li><strong>eot_id:</strong> Signals the end of an interaction.</li></ul><h3>The Power of the New Tokenizer:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/684/0*OCuh3nDhns0O31Km" /></figure><ul><li>LLaMA 3’s tokenizer converts text into numerical data, offering an unparalleled 128k-token vocabulary. This boosts accuracy in understanding and generating diverse, complex content.</li></ul><h3>Revolutionizing AI with Tool Calling</h3><p>Tool calling in <strong>LLaMA 3.1 and 3.2</strong> opens new possibilities, enabling:</p><ul><li><strong>Real-Time Info Retrieval:</strong> Access up-to-date data dynamically.</li><li><strong>Complex Task Execution:</strong> Perform advanced math, coding, and data analysis.</li><li><strong>Dynamic Agent Building:</strong> Create responsive, intelligent systems.</li></ul><h3>Call-to-Action (CTA)</h3><p>What are your thoughts on these transformative updates in LLaMA 3.1 and 3.2? Have you explored their potential in your projects? Let’s discuss in the comments!</p><p>Found this helpful? Share it with your network, and don’t forget to follow me on <a href="https://www.linkedin.com/in/saurabh-naik-981b611a3/">LinkedIn</a> and check out my <a href="https://github.com/saurabhznaikz">GitHub</a> for more insights.</p><h3>Conclusion: Embrace the Future of AI</h3><p>The advancements in LLaMA 3.1 and 3.2 are not just incremental but transformative, enabling developers and businesses to achieve more than ever before. From expanded context windows and multilingual support to groundbreaking tool-calling capabilities, these models are setting new benchmarks in AI innovation.</p><p>Your journey with LLaMA begins now-explore, innovate, and redefine possibilities!</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/unveiling-the-future-of-ai-with-llama-31-and-32-whats-new-and-why-it-matters"><em>https://saurabhz.hashnode.dev</em></a><em> on January 28, 2025.</em></p><h3>Thank you for being a part of the community</h3><p><em>Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://x.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a> | <a href="https://open.spotify.com/show/7qxylRWKhvZwMz2WuEoua0"><strong>Podcast</strong></a></li><li><a href="https://cofeed.app/"><strong>Check out CoFeed, the smart way to stay up-to-date with the latest in tech</strong></a> <strong>🧪</strong></li><li><a href="https://differ.blog/"><strong>Start your own free AI-powered blog on Differ</strong></a> 🚀</li><li><a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Join our content creators community on Discord</strong></a> 🧑🏻‍💻</li><li>For more content, visit <a href="https://plainenglish.io/"><strong>plainenglish.io</strong></a> + <a href="https://stackademic.com/"><strong>stackademic.com</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a75de3831394" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/unveiling-the-future-of-ai-with-llama-3-1-and-3-2-whats-new-and-why-it-matters-a75de3831394">Unveiling the Future of AI with LLaMA 3.1 and 3.2: What’s New and Why It Matters</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of Serverless Agentic Workflows with Amazon Bedrock]]></title>
            <link>https://medium.com/codex/unlocking-the-power-of-serverless-agentic-workflows-with-amazon-bedrock-bb24e27e930c?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb24e27e930c</guid>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[amazon-bedrock]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Tue, 28 Jan 2025 07:04:36 GMT</pubDate>
            <atom:updated>2025-02-06T15:53:09.072Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pnUNbqw4d54Rcb_U" /></figure><h3><strong>Introduction:</strong></h3><p><strong>Ever wondered how serverless AI workflows can revolutionize your business operations?</strong> Amazon Bedrock provides an innovative way to create, invoke, and connect intelligent agents seamlessly to existing systems, empowering you to achieve more with less complexity.</p><p>In this article, you’ll learn:</p><ul><li>How to create, invoke, and trace a Bedrock agent.</li><li>Techniques to connect agents to CRM systems and FAQ documents.</li><li>How to enable calculations, implement guardrails, and more.</li></ul><p>By the end, you’ll have a roadmap to harness the full potential of Amazon Bedrock for building scalable and secure agentic workflows.</p><h3>1. Getting Started with Bedrock Agents</h3><h3>Creating and Invoking a Bedrock Agent:</h3><p>To create your first Bedrock agent:</p><ol><li><strong>Set Up the Client</strong>: Use the boto3 SDK and provide the service and region names.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/0*ettq6kAzAldl2fYj" /></figure><p>2. <strong>Define the Agent</strong>: Use create_agent to define the agent’s name, foundation model, and system instructions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*ag4Fo1VbJr90ufTV" /></figure><p>3. <strong>Create an Alias</strong>: Generate an alias for versioning, ensuring easy updates and rollbacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/919/0*C6w1ZQ6pVDtgptzc" /></figure><p><strong>4. Invoke the Agent:</strong> Pass inputs such as agentId, sessionId, and inputText using the invoke_agent method to receive a response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*0-lT3HF1BCDtpRwD" /></figure><p><em>Example Use Case:</em> Create a support agent to handle customer queries with personalized, context-aware responses.</p><h3>2. Integrating Bedrock Agents with CRM Systems</h3><h3>Steps to Connect</h3><ol><li><strong>Define Action Groups:</strong> Attach external tools using the create_agent_action_group method, specifying the functions and parameters for integration.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*oIYeq_xuj3aeSITM" /></figure><p><strong>2. Lambda Functions as Executors:</strong> Use AWS Lambda to handle agent requests, such as creating support tickets in a CRM system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/0*6GMsfzXS22Bc47m0" /></figure><p><strong>3. Update and Test:</strong> Ensure the agent is in a prepared state before testing the workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*NQS-vLlqE0G5BsVW" /></figure><p><em>Real-World Application:</em> Automate ticket creation by extracting user input and passing it to a CRM, significantly reducing manual effort.</p><h3>3. Performing Calculations Using Bedrock</h3><h3>Bind a Code Interpreter</h3><p>Enable complex calculations by creating an action group with the Amazon Code Interpreter. This setup allows agents to handle numerical data or execute scripts dynamically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*S3nJGxt-CJfKz6PG" /></figure><p><em>Example Scenario:</em> Process financial data and provide real-time insights to decision-makers.</p><h3>4. Implementing Guardrails for Safer Interactions</h3><h3>Why Guardrails Matter</h3><p>Guardrails ensure ethical, safe, and compliant interactions by blocking inappropriate inputs or outputs.</p><h3>How to Set Up</h3><ol><li>Define Policies: Specify rules for topics, content, and context.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/0*bYrAkebs5YCI2sQJ" /></figure><p>2. Configure Messages: Customize messages for blocked inputs and outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/0*ozQV4ZVzT0F6YFUa" /></figure><p>3. Update Agents: Add guardrail configurations to agents and test different scenarios.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*R3yEYMfou9RUahN8" /></figure><p><em>Outcome:</em> Build trust and reliability into your AI systems, making them suitable for sensitive industries.</p><h3>5. Connecting Agents to FAQ Documents</h3><h3>Steps to Enhance Knowledge Retrieval</h3><ol><li>Associate Knowledge Bases: Link agents to FAQ documents using associate_agent_knowledge_base.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/0*aUhNHrATrxj0A1Kl" /></figure><p>2. Prepare and Test: Ensure the agent can access and retrieve relevant information accurately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/829/0*Zx6o8DaNWtf5VbZ2" /></figure><p><em>Impact:</em> Enable faster query resolution by empowering agents with direct access to organizational knowledge.</p><h3>Call-to-Action</h3><p>Have you explored serverless AI workflows yet? Start building intelligent solutions today with Amazon Bedrock!</p><p>💬 <em>What are your thoughts on integrating Bedrock into your workflows? Share your experiences in the comments below.</em></p><p>🔗 <em>Found this helpful? Share it with your network or connect with me on</em> <em>for more insights!</em></p><h3>Conclusion</h3><p>By leveraging Amazon Bedrock’s powerful features, you can create, customize, and scale serverless agentic workflows tailored to your needs. From CRM integration to advanced guardrails, Bedrock enables innovation while maintaining simplicity and safety.</p><p><em>Your next breakthrough is just a step away. Start experimenting with Bedrock today and transform how you build intelligent workflows!</em></p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/unlocking-the-power-of-serverless-agentic-workflows-with-amazon-bedrock"><em>https://saurabhz.hashnode.dev</em></a><em> on January 28, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb24e27e930c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/unlocking-the-power-of-serverless-agentic-workflows-with-amazon-bedrock-bb24e27e930c">Unlocking the Power of Serverless Agentic Workflows with Amazon Bedrock</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Google Gemini: Transforming Multimodal AI into Real-World Solutions]]></title>
            <link>https://medium.com/codex/mastering-google-gemini-transforming-multimodal-ai-into-real-world-solutions-e1b6fde5f703?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/e1b6fde5f703</guid>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[multimodal]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 16:18:56 GMT</pubDate>
            <atom:updated>2025-02-06T15:53:11.586Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyNtMsSZWhKdSkBBjne_Aw.png" /></figure><h3>Ever wondered how advanced AI models like Google Gemini can revolutionize your workflow?</h3><p>In today’s fast-paced world, businesses and developers are constantly searching for cutting-edge solutions that bridge the gap between technology and creativity. Google Gemini, a state-of-the-art multimodal model, offers just that. Whether you’re analyzing images, videos, or combining them with text, Gemini unlocks limitless possibilities.</p><p>In this article, we’ll explore how you can leverage Google Gemini for real-world use cases, including image-based Q&amp;A, recommendation systems, and video analysis. From setup to execution, we’ve got you covered.</p><h3>Setting Up Google Gemini</h3><p>Before diving into use cases, let’s walk through the basic setup to get started with Google Gemini.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ltUrU_njjQnZW2wb.png" /></figure><ol><li><strong>Import Credentials from Helper Functions</strong><br> Ensure you have the correct authentication credentials. Import them using your helper function to establish a secure connection with the Google Cloud platform.</li><li><strong>Set Up the Vertex AI Object</strong><br> Initialize the Vertex AI object using credentials, your project ID, and the region.</li><li><strong>Initialize the Gemini Multimodal Object</strong><br> Create and configure the Gemini multimodal object to begin interacting with the model.</li></ol><h3>Use Cases for Images:</h3><h4>1. Answering Complex Questions Using Images</h4><p>Google Gemini excels at understanding and answering queries based on visual input. Here’s how you can implement this:</p><ul><li>Step 1: Load the images into a list.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*IPQzToYS2C5Xs8La" /></figure><ul><li>Step 2: Create detailed instructions to guide the model on understanding the images.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Kb9Y-dKiJjqqNC90" /></figure><ul><li>Step 3: Frame multiple questions you want the model to answer.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*vXok9ELFign1EqJz" /></figure><ul><li>Step 4: Combine the instructions, images, and questions into a single prompt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/328/0*cTYkk-ei2PDGuLz4" /></figure><ul><li>Step 5: Define and use a helper function to call the model API, passing the prompt and retrieving the response.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*Nemfe2s8diYDoJ5p" /></figure><p><em>Example:</em> Suppose you have two medical X-rays and want to understand abnormalities. Gemini can analyze both images and provide an insightful diagnosis.</p><h4>2. Building a Recommendation System</h4><p>Use Gemini to provide personalized recommendations based on images.</p><ul><li>Step 1: Load the images and the scenario (e.g., recommend a chair for a specific living room).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ETWdBteixnY9DhL_" /></figure><ul><li>Step 2: Create a prompt with instructions and images.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*sq5Vfl3RB5IwTtlH" /></figure><ul><li>Step 3: Pass this input through a helper function to the API and retrieve the response.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*ekBz2QBM_-TZP3p0" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/0*GFtM81ZS4UYOM-eA" /></figure><p><em>Example:</em> For interior designers, Gemini can recommend the best furniture placements based on room images.</p><h4>3. Multimodal Q&amp;A</h4><p>Combine images and text for a seamless question-answering experience.</p><ul><li>Step 1: Load images into a list.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*fRfzqZDKSJRWgplF" /></figure><ul><li>Step 2: Store text data in a variable.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/745/0*KSUGvzj3HvINGybV" /></figure><ul><li>Step 3: Provide instructions, role expectations, and task breakdown for the model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*CWlLUeLq-IOJLQpm" /></figure><ul><li>Step 4: Create a consolidated input list with instructions, images, roles, and tasks.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*eqsOk50JKxUQjyjL" /></figure><ul><li>Step 5: Retrieve responses using a helper function.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*n3b7IGalsQG8p051" /></figure><p><em>Example:</em> Legal professionals can use this to analyze court diagrams and related documents together.</p><h3>Use Cases for Videos</h3><h4>1. Assisting Digital Marketers</h4><p>Leverage Gemini to generate detailed video insights for websites.</p><ul><li>Step 1: Load the video file path and format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*eFgxm61hG5mvAUeh" /></figure><ul><li>Step 2: Create roles, output formats, and tasks for the model.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Ek0RJ2PCeDtBa88i" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*36c0iszOWvxgFn9O" /></figure><ul><li>Step 3: Combine the video, role, and task into a prompt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*yxfH-qKSGNTdseZn" /></figure><ul><li>Step 4: Configure the generation settings, including temperature.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*-fYOkeOsbu6nn8ky" /></figure><ul><li>Step 5: Retrieve responses by passing the prompt and configuration.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*QogG-NXU0ei4zguM" /></figure><p><em>Example:</em> A digital marketer can upload promotional videos and receive tailored summaries or captions.</p><h3>2. Advanced Video Q&amp;A</h3><p>Google Gemini handles complex queries based on video content.</p><ul><li>Step 1: Load the video directory path.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*E4K-pijVXU065Jqr" /></figure><ul><li>Step 2: Frame your questions in the prompt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Bf_XqnbgWLSbFwkU" /></figure><ul><li>Step 3: Combine the video path and prompt into an input variable.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/538/0*VpfCMvUwH-JbfTB5" /></figure><ul><li>Step 4: Retrieve responses using the API and stream settings.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/0*TUuwyQGnDPT6dOWP" /></figure><p><em>Example:</em> A sports analyst can upload game footage and ask detailed questions about player performance or strategies.</p><h3>Call-to-Action (CTA)</h3><p>What are your favorite use cases for multimodal AI? Share your thoughts in the comments! Found this helpful? Share it with your network or follow me for more insights.</p><h3>Conclusion</h3><p>Google Gemini’s multimodal capabilities empower professionals across industries to analyze, create, and innovate in ways never imagined before. By following these strategies, you can harness its full potential to enhance your productivity and creativity.</p><h3>Connect with Me</h3><h3><a href="https://www.linkedin.com/in/saurabh-naik-981b611a3/">LinkedIn</a> | <a href="https://github.com/saurabhznaikz">GitHub</a> | <a href="https://saurabhznaikz.github.io/Saurabh_Portfolio/">Portfolio</a></h3><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/mastering-google-gemini-transforming-multimodal-ai-into-real-world-solutions-d675cff3ad60"><em>https://saurabhz.hashnode.dev</em></a><em> on January 27, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e1b6fde5f703" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/mastering-google-gemini-transforming-multimodal-ai-into-real-world-solutions-e1b6fde5f703">Mastering Google Gemini: Transforming Multimodal AI into Real-World Solutions</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unlocking the Power of Google Gemini: The Future of Multimodal AI]]></title>
            <link>https://medium.com/codex/unlocking-the-power-of-google-gemini-the-future-of-multimodal-ai-a2c4de667b58?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2c4de667b58</guid>
            <category><![CDATA[multimodal-ai]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[gemini]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 16:13:55 GMT</pubDate>
            <atom:updated>2025-02-06T15:53:05.905Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*xz0tWg591eml5PFY7ppToQ.png" /></figure><h3>Introduction:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8gURRvpIpN5frAuB.png" /></figure><p>Ever wondered what lies at the cutting edge of AI technology? Meet <strong>Gemini</strong>, Google DeepMind’s revolutionary multimodal model. Imagine a single AI that understands images, text, audio, and even video simultaneously. It can describe a cat in a picture, recognize its sound, and even compose a poem about it. That’s the astounding capability of Gemini — a game-changer in the world of artificial intelligence.</p><p>In this article, we’ll explore Gemini’s variants, its unique features, and practical tips on leveraging this multimodal marvel. Whether you’re an AI enthusiast, a developer, or a business leader, there’s something here for you.</p><h3>What is Gemini?</h3><p>Gemini is Google’s state-of-the-art multimodal AI model. Unlike traditional models that focus solely on text or images, Gemini is trained on a diverse dataset encompassing:</p><ul><li>Text</li><li>Images</li><li>Audio</li><li>Video</li></ul><p>This multimodal approach allows Gemini to perform tasks across different media types, such as analyzing scientific images, processing satellite data, or extracting insights from temperature graphs.</p><h3>Variants of Gemini</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*WpuAmuT_q6TUPPuZ" /></figure><p>Gemini comes in four tailored variants, each designed for specific needs:</p><h4>1. Ultra:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*lwkXERzr4Beg3KjS" /></figure><p>The largest and most powerful model in the Gemini family. It excels at handling complex tasks and delivering unparalleled performance.</p><h4>2. Pro</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*1eg4-1H_JzqaGFna" /></figure><p>A versatile workhorse optimized for performance and speed. Ideal for balancing capability with efficiency.</p><h4>3. Flash</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*R7OBkMTHd_GZMD3h" /></figure><p>The fastest and most cost-effective option. Perfect when speed is paramount.</p><h4>4. Nano</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*S22VhWIiyD3bMf1K" /></figure><p>A lightweight variant designed to operate seamlessly on user devices like Pixel phones, making it ideal for on-device AI tasks.</p><h3>Choosing the Right Gemini Model</h3><p>Selecting the right Gemini variant depends on your use case. Consider these three factors:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*P92L8yNGeFkxRI-v" /></figure><h4>1. Model Capabilities</h4><p>Can the model handle your task? For instance, do you need it to analyze both text and images?</p><h4>2. Latency</h4><p>If speed is critical, prioritize faster variants like Flash or Nano.</p><h4>3. Cost</h4><p>Complex models like Ultra offer top-tier performance but come with higher costs. Choose a model that fits your budget.</p><h3>Key Features of Gemini:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pdexgxv-VK5F-352" /></figure><h4>1. Interleaved Inputs and Responses</h4><p>Gemini accepts a combination of inputs — text, images, videos, and audio — to deliver insightful responses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Ki6YjaSpOt-ufbLR" /></figure><h4>2. Cross-Model Reasoning</h4><p>It can analyze complex, multimodal data and extract valuable insights, such as interpreting scientific graphs or satellite imagery.</p><h3>Prompting Gemini: Best Practices</h3><p>Getting the best out of Gemini requires well-structured prompts. Here’s how:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*45F6ukrzENcJ5gLc" /></figure><h4>1. Be Clear and Concise</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*Ho75P27RwkiMrwMG" /></figure><p>Explain your query as if you’re addressing another person. Clear instructions yield better results.</p><h4>2. Assign Roles:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*nmbZiSvmBRGMISTI" /></figure><p>Define roles for Gemini, such as “Be a data analyst” or “Act as a content creator.” This sharpens its focus.</p><h3>3. Structure Prompts</h3><p>Organize your prompt into:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*3AakzZNoMMf1vAt1" /></figure><ul><li><strong>Role</strong>: Define the purpose.</li><li><strong>Objective</strong>: Specify the goal (e.g., summarization or question-answering).</li><li><strong>Context</strong>: Provide background information, like charts or images.</li><li><strong>Constraints</strong>: Set limitations, such as output length or format.</li></ul><p>The order of these elements significantly impacts the output quality.</p><h3>Function Calling: Real-Time Query Resolution</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*nqm0gs_bfSyRJWe4" /></figure><p>Gemini supports <strong>function calling</strong>, enabling it to handle real-time data queries. Here’s an example:</p><h3>Use Case: Finding Stock Prices Using Frankfurter:</h3><ol><li>Declare a Function: Define a function with parameters like currency_from, currency_to, and currency_date.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*d63kE3WgYB1CFZ3X" /></figure><p><strong>2. Integrate the Function</strong>: Pass it into Gemini using SDK classes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*8nl7EJoImw92CzOl" /></figure><p><strong>3. Execute the Query</strong>: Use a multi-turn chat to retrieve real-time data, such as current stock prices.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*gg-UwrBL4-ocHIE9" /></figure><p><strong>4. API Integration</strong>: Pass parameters to an API, retrieve data, and deliver the result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*B9DnxmM4zvUY34II" /></figure><p>This functionality makes Gemini a practical tool for tasks requiring real-time insights.</p><h3>Practical Applications of Gemini</h3><p>From developers building cutting-edge apps to researchers analyzing complex data, Gemini’s capabilities span multiple domains:</p><ul><li><strong>Business Intelligence</strong>: Analyze multimodal data to drive decisions.</li><li><strong>Scientific Research</strong>: Extract insights from specialized data like satellite images.</li><li><strong>Creative Tasks</strong>: Generate art, music, or literature using multimodal prompts.</li></ul><h3>Call-to-Action</h3><p>Ready to harness the power of Google Gemini? Start by exploring its variants and features to find the right fit for your needs.</p><p>What tasks would you tackle with Gemini? Let’s discuss in the comments!</p><p>If you found this helpful, share it with your network and follow me for more AI insights. You can also connect with me on LinkedIn or check out my portfolio and GitHub for more projects:</p><ul><li><a href="https://www.linkedin.com/in/saurabh-naik-981b611a3/">LinkedIn</a></li><li><a href="https://github.com/saurabhznaikz">GitHub</a></li><li><a href="https://saurabhznaikz.github.io/Saurabh_Portfolio/">Portfolio</a></li></ul><h3>Conclusion</h3><p>Gemini represents a monumental leap in AI — a model capable of understanding and interacting with the world across multiple dimensions. By choosing the right variant, structuring your prompts effectively, and leveraging features like function calling, you can unlock its full potential.</p><p>Your voice deserves to be heard. Take these steps, and let Gemini amplify it!</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/unlocking-the-power-of-google-gemini-the-future-of-multimodal-ai-1881644478c5"><em>https://saurabhz.hashnode.dev</em></a><em> on January 27, 2025.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2c4de667b58" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/unlocking-the-power-of-google-gemini-the-future-of-multimodal-ai-a2c4de667b58">Unlocking the Power of Google Gemini: The Future of Multimodal AI</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an End-to-End Multimodal RAG System: A Comprehensive Guide]]></title>
            <link>https://medium.com/codex/building-an-end-to-end-multimodal-rag-system-a-comprehensive-guide-899b43f3f00d?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/899b43f3f00d</guid>
            <category><![CDATA[rags]]></category>
            <category><![CDATA[intel]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[multimodal]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Thu, 26 Sep 2024 12:06:59 GMT</pubDate>
            <atom:updated>2024-09-30T12:15:39.182Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lqYFcwEmlQTX_j0u" /></figure><h3><strong>Introduction:</strong></h3><p>In the rapidly evolving world of AI, the ability to effectively manage and retrieve multimodal data-information that spans multiple formats like text, images, and videos-is becoming increasingly critical. Enter the Multimodal Retrieval-Augmented Generation (RAG) system, a powerful solution that combines vision and language models to handle complex tasks across different data types. In this blog, we’ll dive deep into the process of creating an end-to-end Multimodal RAG system, covering everything from generating vision embeddings to leveraging the LLava model for diverse tasks.</p><h3>How to Create Vision Embeddings</h3><p>Creating vision embeddings is the first step in building a multimodal RAG system. Here’s how you can do it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/0*3FIR6XmmVJ9t8lqO" /></figure><ol><li><strong>Pass Image-Text Pair into the Bridge-Tower Embedding Model</strong>: The Bridge-Tower model, specifically designed to handle both visual and textual data, takes image-text pairs as input.</li><li><strong>Generate Multimodal Embedding</strong>: The model outputs a 512-dimensional vector, which effectively represents the combined visual and textual features in a single embedding.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*WrDI0UeHNOus2PBA" /></figure><p>The concept of a semantic space, where similar items are positioned close to each other, extends into the multimodal realm with a twist. In a multimodal semantic space, image-text pairs that share semantic similarities are clustered together, while dissimilar pairs are spaced apart. This spatial arrangement enables efficient retrieval and analysis of multimodal data.</p><h3>Bridge-Tower Embedding Model: An Overview</h3><p>The Bridge-Tower model stands out due to its architecture, which mirrors the structure of a bridge:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/0*PnVRYg9KHhDx5kfI" /></figure><ol><li><strong>Textual Transformer (Left Tower)</strong>: Handles textual features.</li><li><strong>Vision Transformer (Right Tower)</strong>: Manages visual features.</li><li><strong>Cross-Modal Fusion (Middle Section)</strong>: The transformers converge here, using cross-attention mechanisms to generate joint embeddings that encapsulate the contextual relationships between text and images.</li></ol><h3>How to Create Multimodal Embeddings</h3><p>Creating multimodal embeddings involves several key steps:</p><ol><li><strong>Collect Image-Caption Data</strong>: Gather a dataset of images and their corresponding captions.</li><li><strong>Convert Images to Base64 Format</strong>: Before feeding the images into the Bridge-Tower model, convert them to Base64 format.</li><li><strong>Generate and Store Embeddings</strong>: The model processes each image-caption pair, producing a 512-dimensional embedding that is stored in a list.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*OlZtSVY5zyP_ldFx" /></figure><p>4. <strong>Evaluate Similarity</strong>: Use cosine similarity or Euclidean distance with L2 normalization to measure the closeness of embeddings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/0*jnYPE8KhfN7SkrQH" /></figure><p>5. <strong>Visualize with UMAP and Scatter Plot</strong>: To understand the relationships between embeddings, reduce the dimensionality using UMAP and visualize the results with a scatter plot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/813/0*IIuJxjhXiM-gjRJ7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*rtw84XOxbI4eeROQ" /></figure><h3>How to Preprocess Video for a Multimodal System:</h3><p>Preprocessing video to generate image-text pairs for the embedding model is crucial. Here’s how to handle different cases:</p><ol><li><strong>Video with Transcript Available</strong>:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*SgOhTLmH3I8SCY-r" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*a_RxmOd-baLiP3s9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/0*PS8hNe50BeGlkYDy" /></figure><ul><li><strong>Extract Frames</strong>: Loop through the transcript, finding the midpoint of each text segment to extract video frames.</li><li><strong>Store Metadata</strong>: Save the extracted frame along with its transcript, video segment, and the timestamp of the frame’s midpoint.</li></ul><p><strong>2. Video without Transcript</strong>:</p><ul><li><strong>Generate Transcript with Whisper Model</strong>: Extract audio from the video, feed it into the Whisper model, and convert the output to a VTT format.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/735/0*IfNUk2xbfqsvL1kV" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/0*lo_jIVBZU7fSIhfW" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*7VS8GDgpLO66XPG-" /></figure><p><strong>Extract Frames and Metadata</strong>: Follow the same process as above to create image-text pairs.</p><p>3.<strong> Video without Language:</strong></p><ul><li><strong>Generate Captions</strong>: Extract frames from the video, encode them to Base64, and use the LLava large vision model to generate captions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/0*6l2ALmApY9MGbLKw" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/730/0*zDvih4mt5BGf3KfR" /></figure><ul><li><strong>Store Metadata</strong>: Similar to the other cases, but captions are generated directly from the visual data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/0*DMMVw1TUq6QVGM4a" /></figure><h3>Steps to Populate and Retrieve Data from a Multimodal Vector Store</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*k7oPEKAewyhAwkWE" /></figure><p>Vector stores are optimized databases for managing high-dimensionality vectors. Here’s how to populate and retrieve data:</p><ol><li>Setup LanceDB VectorStore: Initialize the database connection.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/0*MKkuaTeyuxwsDuUc" /></figure><p>2. Augment Video Frames: To create richer data, augment small video frames before storing them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*0B9oChndYcExBTET" /></figure><p>3. Ingest Data into Bridge-Tower Model: Pass video and transcript data through the embedding model and store the output in the VectorStore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*66bys_RDUY8Whxg0" /></figure><p>4. Add Retriever: Configure the retriever with parameters like the number of similar results (k) and the type of search.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/0*uA8ALPrEb5HayDhD" /></figure><p>5. Query and Retrieve: Use the retriever to find relevant video frames and transcript sections based on user queries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*vQmnBHkStJ6B740X" /></figure><h3>How to Use LLava Model for Different Tasks:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/898/0*w-5uVPctEcxP4IY_" /></figure><p>The LLava model can be used for a variety of tasks, including image captioning. Here’s a quick guide:</p><ul><li><strong>Create a Prompt</strong>: Formulate a task-specific prompt.</li><li><strong>Encode Image</strong>: Convert the image to Base64 format.</li><li><strong>Generate Caption</strong>: Use the LLava model’s inference module with the provided prompt and image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/0*bf9PB8wHQ0yYjBBp" /></figure><h3>Steps to Create an End-to-End Multimodal RAG System</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*t9gXQPpmIzU3goC3" /></figure><p>Bringing everything together, here’s how to create a full Multimodal RAG system:</p><ol><li><strong>Setup and Initialization</strong>: Import necessary modules, set up the database, initialize the embedding model, and the vector store, and configure the retrieval model.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/0*CCHFpgwYPxrJ_qtH" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/697/0*OOdz1wDgi6QuWgec" /></figure><p>2.<strong> Prompt Processing Module:</strong> Develop a module to handle user queries and retrieved results, augmenting the prompt with relevant transcript information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*_EcdGhq9NDXTHXcI" /></figure><p>3. Chain Modules Together: Create a chain that integrates the user query, retrieval results, prompt processing, and inference modules.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*QiXZotSnUmGk_glk" /></figure><p>4. Parallel Execution: Implement parallel processing to handle video frame retrieval alongside query processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*Rju5gZALXjKomPUE" /></figure><p>5. Test with Queries: Run queries through the chain and refine based on the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/0*-9e3QkwXckScVwN7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*iegLWPIg9jCO61EI" /></figure><h3>Conclusion</h3><p>The fusion of text, image, and video data into a cohesive multimodal system represents the next frontier in AI-powered solutions. By following the steps outlined in this blog, you can create a robust Multimodal RAG system capable of handling complex, multimodal tasks. Whether it’s generating captions for images or retrieving specific video frames based on a query, the possibilities are endless. Embrace this powerful technology to unlock new capabilities in data retrieval and generation!</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/building-an-end-to-end-multimodal-rag-system-a-comprehensive-guide"><em>https://saurabhz.hashnode.dev</em></a><em> on September 26, 2024.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=899b43f3f00d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/building-an-end-to-end-multimodal-rag-system-a-comprehensive-guide-899b43f3f00d">Building an End-to-End Multimodal RAG System: A Comprehensive Guide</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Costs of Large Language Models (LLMs): A Comprehensive Guide]]></title>
            <link>https://ai.plainenglish.io/understanding-the-costs-of-large-language-models-llms-a-comprehensive-guide-dbc7eb578de6?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbc7eb578de6</guid>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[cost]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 06:55:56 GMT</pubDate>
            <atom:updated>2024-09-24T08:29:11.749Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*T0qKZh-ipkl_u7SA" /></figure><p>The rise of Large Language Models (LLMs) has revolutionized the world of Natural Language Processing (NLP), powering applications from chatbots to content generation tools. However, deploying and running LLMs comes with significant costs that businesses must carefully consider. Whether you’re opting for a pay-per-token API model or hosting your LLM on your infrastructure, understanding the various cost factors is essential for making informed financial decisions. In this blog, we will explore the different pricing models, the key factors influencing costs, and compare hosted versus API-based LLMs to help you select the best solution for your needs.</p><h3>Paying for Using LLMs</h3><p>When utilizing LLMs, there are two primary pricing models:</p><ul><li><strong>Pay-by-Token:</strong> This model charges based on the amount of data processed by the LLM service. Pricing is determined by the number of tokens-essentially words or symbols-processed during both input and output operations. For instance, OpenAI uses a specific formula to calculate the token count in queries, which directly impacts the cost.</li><li><strong>Hosting Your Own Model:</strong> Alternatively, you can host an LLM on your infrastructure, which incurs costs for the hardware and computational resources, especially GPUs, needed to run the model. You may also need to pay licensing fees for the LLM itself.</li></ul><p>Each model comes with its pros and cons. The pay-by-token option offers simplicity and scalability, making it ideal for smaller projects with unpredictable traffic. On the other hand, hosting your model provides more control over data privacy and operational flexibility but requires a higher initial investment in infrastructure and ongoing maintenance.</p><h3>Hosting an LLM on Your Cloud Infrastructure</h3><p>When hosting an LLM on the cloud, the primary expense is hardware. For example, consider hosting an open-source <strong>Llama3</strong> model on AWS. AWS recommends using the ml.p4d.24xlarge instance, which costs nearly <strong>$38 USD per hour</strong> on-demand. Over a month, this translates to a cost of at least <strong>$23,924 USD</strong>, assuming 24/7 uptime without scaling adjustments or discounts.</p><h4>Llama3 on AWS SageMaker</h4><p>AWS does offer scaling options, allowing you to scale up or down based on traffic, but costs remain high for large-scale deployments. You will also need to factor in additional configuration, optimization processes, and the potential for unexpected spikes in demand, all of which can affect your overall expenses.</p><h3>Paying Per Token</h3><p>Another option is to utilize SaaS models that charge based on the number of tokens processed. <strong>Tokens</strong> are units that vendors use to price API calls. Different vendors have different tokenization methods and costs per token. For instance, OpenAI charges based on whether the token is input or output, as well as the size of the model used. Non-English characters and special symbols may require more tokens, further increasing costs.</p><h4>Example: OpenAI Token Calculation</h4><p>OpenAI token costs vary by language, with English typically being more cost-effective than languages like Hebrew, which require more tokens per word. For instance, special characters in a text generate more tokens, driving up the price. Understanding how tokenization works is crucial for budgeting your API costs effectively.</p><h3>Three Key Factors Affecting LLM Costs</h3><h3>1. Cost of Project Setup and Inference</h3><p>Setting up an LLM involves two major components: the cost of storing the model and the cost of making predictions (inference). Depending on your use case, you can opt for either API access or an on-premise solution:</p><ul><li><strong>API Access Solution:</strong> This is often a preferred choice for companies looking to avoid infrastructure costs. Common providers include OpenAI, Anthropic, and Google’s VertexAI.</li><li><strong>On-Premise Solution:</strong> Smaller LLMs can be hosted on local infrastructure, while larger models require cloud services like AWS or Google Cloud Platform. For highly secure environments, internal GPU servers may be used.</li></ul><h3>2. Cost of Maintenance</h3><p>Over time, models must be retrained or fine-tuned as data distribution changes. The cost of maintenance includes redeploying models and updating infrastructure.</p><ul><li><strong>API Access Solution:</strong> Providers like OpenAI and VertexAI offer pricing models for fine-tuning on new data, with costs depending on data size and complexity.</li><li><strong>On-Premise Solution:</strong> Maintenance costs scale with the duration of server usage, dataset size, and the training process itself (batch size, number of epochs). The total cost formula is:</li><li>Total Cost = Hourly cost of rented instance x Number of hours for training</li></ul><h3>3. Other Associated Costs</h3><p>There are additional costs beyond direct infrastructure and API usage:</p><ul><li><strong>Environmental Costs:</strong> LLMs consume vast amounts of computational resources. For instance, training OpenAI’s GPT-3 was estimated to emit over 500 metric tons of CO2. Several factors, such as computing power (FLOPs), data center efficiency, and hardware type (CPU, GPU, TPU), affect the environmental impact.</li><li><strong>Expertise:</strong> Open-source models may be free, but the expertise required to train, deploy, and maintain them adds significant costs in the form of highly skilled staff.</li></ul><h3>Case Study: Cost Estimation for Chatbot API:</h3><p>Let’s assume you want to create an API for a chatbot application that handles <strong>50 discussions per day</strong>, with each discussion containing <strong>1,000 words</strong>. On average, 1 token is equivalent to <strong>3/4th of an English word</strong>. Therefore, each day you would process:</p><pre>Total tokens = 50 discussions * 1,000 words * (3/4 tokens per word) = 37,500 tokens per day</pre><p>At OpenAI’s rate of <strong>$0.02 per token</strong>, the daily cost would be approximately <strong>$0.075 USD</strong>, translating to <strong>$270 USD per year</strong>. As token usage increases, costs scale linearly. If you were processing <strong>100,000 tokens per day</strong>, your annual cost would jump to <strong>$2,700 USD</strong>.</p><p>By contrast, for an on-premise solution, you would need to allocate significant IT infrastructure to handle the same traffic, though this might be more cost-effective for high-volume use cases. API solutions tend to be more economical for low-volume tasks, while on-premise hosting becomes more efficient at scale.</p><h3>Summary</h3><p>Choosing the right cost model for deploying LLMs depends heavily on your use case and expected volume of traffic. Pay-per-token API models are suitable for applications with less frequent usage or unpredictable demand, offering scalability without the need for significant infrastructure investments. However, hosting your own LLM provides greater control, privacy, and long-term cost savings, especially for large-scale or mission-critical applications. By understanding the various cost factors-setup, maintenance, and additional environmental or staffing costs-you can select the most appropriate solution for your LLM deployment.</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/understanding-the-costs-of-large-language-models-llms-a-comprehensive-guide"><em>https://saurabhz.hashnode.dev</em></a><em> on September 10, 2024.</em></p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbc7eb578de6" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/understanding-the-costs-of-large-language-models-llms-a-comprehensive-guide-dbc7eb578de6">Understanding the Costs of Large Language Models (LLMs): A Comprehensive Guide</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Selecting the Best Large Language Model (LLM) for Your Use Case:]]></title>
            <link>https://ai.plainenglish.io/selecting-the-best-large-language-model-llm-for-your-use-case-f3262ad607f7?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3262ad607f7</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[costing]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[case-study]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Tue, 10 Sep 2024 06:42:52 GMT</pubDate>
            <atom:updated>2024-09-30T11:34:09.541Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_BTdT8Acsb-rH6R" /></figure><p>With the rapid advancements in artificial intelligence, selecting the right Large Language Model (LLM) is critical for developing efficient, scalable, and cost-effective NLP solutions. LLMs have become the backbone of numerous applications, from chatbots and virtual assistants to complex domain-specific systems. But how do you choose the best LLM for your use case? In this blog, we’ll explore key factors such as model size, domain-specific training, cost, and more to help you make an informed decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ltXaQHeCLegp5fns" /></figure><p>A Large Language Model (LLM) is a highly sophisticated deep learning algorithm designed to perform various Natural Language Processing (NLP) tasks, including text generation, translation, summarization, and more. These models are typically trained on massive datasets and have millions (or even billions) of parameters, allowing them to understand and generate human-like text.</p><h3>7 Key Factors to Consider When Choosing an LLM:</h3><h4><strong>The size of an LLM often correlates with its performance.</strong></h4><p>Larger models typically have a higher number of parameters, enabling them to grasp more nuanced meanings in text. However, bigger is not always better. Large models require more computational resources, leading to increased costs and latency during inference. Moreover, some tasks may not require the power of a massive LLM, so carefully weigh performance needs against computational costs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XLkjTpOIC1QNM5_j" /></figure><h4>Key takeaway:</h4><p>Larger models offer better understanding, but at the expense of speed and cost. Smaller models might suffice for simpler tasks, so always match model size with your application’s requirements.</p><h4><strong>2. Domain Specific Training:</strong></h4><p>While general-purpose LLMs are trained on diverse datasets, domain-specific models are fine-tuned on data tailored to particular industries, such as medical, legal, or financial sectors. Domain-specific models often outperform larger, more generalized models in their respective fields. For example:</p><ul><li>Galactica is an LLM optimized for science, trained on scientific datasets, with built-in capabilities for handling scientific notations.</li><li>BloombergGPT is a financial LLM, trained on 51% financial data and 49% public datasets.</li></ul><h4>Key takeaway:</h4><p>For specialized tasks, domain-specific LLMs are often more effective than general-purpose models, even if they are smaller in size.</p><h4>3.Cost and Budget:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/0*tEOfzH9bzO9akYPx" /></figure><p>One of the most important considerations when selecting an LLM is cost. Beyond licensing fees, you need to factor in the expenses related to computational resources required for training, fine-tuning, and inference. Running larger models may demand expensive hardware or cloud services, which can quickly exceed enterprise budgets. Always align your model choice with both short-term and long-term budget constraints.</p><h4>Key takeaway:</h4><p>Keep an eye on the total cost of ownership-license fees, hardware, cloud services, and long-term scalability all contribute to the financial implications of using an LLM.</p><h4>4.Latency and Speed:</h4><p>Latency, the time it takes for the model to respond to queries, is critical for real-time applications such as customer service chatbots or virtual assistants. Larger models, while more capable, often come with higher latency, which may not be suitable for real-time interactions. Consider smaller, more optimized models when low-latency responses are essential.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/0*Xa8HVPaAY0wvKwcJ" /></figure><h4>Key takeaway:</h4><p>For real-time applications, prioritize latency and responsiveness. Larger models may not always be the best fit for real-time interactions.</p><h4>5.Integration and Deployment:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2fup_ZMPAkmlxA5L" /></figure><p>Efficient integration and deployment can make or break a project. You want to spend time solving business problems, not fighting with technical bottlenecks during integration. Here are some critical factors to consider:</p><ul><li><strong>API Availability:</strong></li></ul><p>Ensure that the LLM provides easy-to-use API endpoints for seamless communication between your systems and the model.</p><ul><li><strong>Compatibility:</strong></li></ul><p>The model should be compatible with your current tech stack, including programming languages, databases, and infrastructure.</p><ul><li><strong>Flexibility:</strong></li></ul><p>Opt for models that offer multiple deployment options, such as cloud-based, on-premises, or hybrid, to meet your scalability and data sovereignty needs.</p><h4>Key takeaway:</h4><p>Choose an LLM that offers smooth integration with your existing systems, flexible deployment options, and robust APIs.</p><h4>6. Ethical considerations and Bias</h4><p>LLMs are trained on historical data, which may embed biases from that data into the model. Left unchecked, these biases can lead to discriminatory outcomes. To mitigate bias, ensure that the model has been trained with fairness in mind, promote algorithmic transparency, and consider post-deployment monitoring to catch unintended bias.</p><h4>Key takeaway:</h4><p>Prioritize models that emphasize ethical considerations, fairness, and transparency, especially if your use case involves sensitive information or high societal impact.</p><h4>7. Support and Community:</h4><p>The quality of support and the strength of the community around an LLM can significantly influence the success of your project. Access to thorough documentation, responsive customer support, and an active user community can ease the process of integrating, deploying, and troubleshooting your model.</p><h4>Key takeaway:</h4><p>Opt for models that are backed by a robust support network and a thriving community, as they can provide valuable resources for resolving issues and improving performance.</p><h3>Summary:</h3><p>Selecting the best LLM for your use case requires balancing several factors, including model size, domain-specific capabilities, cost, latency, and ethical considerations. While larger models may offer better performance, smaller, domain-specific models can often provide greater efficiency for specialized tasks. Understanding your project’s specific needs-whether they involve real-time interactions, complex integrations, or ethical challenges-will guide you in choosing the most suitable LLM. By considering factors like support and community, you can ensure that your model will be easier to implement and maintain over time.</p><p>Choosing the right LLM is a nuanced process, but with a thoughtful approach, you can harness the power of AI to transform your applications and meet business goals effectively.</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/selecting-the-best-large-language-model-llm-for-your-use-case"><em>https://saurabhz.hashnode.dev</em></a><em> on September 10, 2024.</em></p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3262ad607f7" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/selecting-the-best-large-language-model-llm-for-your-use-case-f3262ad607f7">Selecting the Best Large Language Model (LLM) for Your Use Case:</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI Agents Using Langraph: A Comprehensive Guide]]></title>
            <link>https://ai.plainenglish.io/ai-agents-using-langraph-a-comprehensive-guide-d0a63a8db17d?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0a63a8db17d</guid>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[langgraph]]></category>
            <category><![CDATA[components]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 10:44:53 GMT</pubDate>
            <atom:updated>2024-10-01T12:38:03.394Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0wzMcjJYIqvwJySy" /></figure><h3>Introduction:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*Qzn-8yHAARzbv8CW" /></figure><p>Creating AI agents is a complex yet fascinating task that involves multiple components and intricate workflows. Langraph is a powerful tool designed to simplify this process, enabling developers to build, manage, and enhance AI agents efficiently. This blog will walk you through the essential components of Langraph, explain how to create a simple Langraph, and delve into advanced concepts such as persistence, streaming, human-in-the-loop, and state memory. To illustrate the entire process, we will conclude with a case study on creating an essay writer AI agent.</p><h3>Components of a Graph</h3><p>Langraph leverages a graph-based approach to design AI agents. A typical graph consists of three main components:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/853/0*AXNOFrj4bTV3ordK" /></figure><ol><li><strong>Nodes</strong>: Represent agents or functions.</li><li><strong>Edges</strong>: Connect nodes to define the flow.</li><li><strong>Conditional Edges</strong>: Enable decision-making within the graph.</li></ol><p>The basic workflow of a langraph can be shown as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/0*_oz3ClHrUOGvh7IG" /></figure><h3>Data/State</h3><p>The agent’s state in Langraph is accessible throughout the graph and can be stored in a persistence layer. There are two types of states: simple and complex.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/0*qNaRuIIA7Kgt3xf8" /></figure><h3>Simple State</h3><p>A simple state contains a single parameter called message, which is annotated, meaning each new message is appended to the existing messages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/0*GHypmBYoXHpGPNoB" /></figure><h3>Complex State</h3><p>A complex state includes four parameters: input, chat_history, agent_outcome, and intermediate_steps. Among these, only intermediate_steps is annotated, allowing for appending, while the other features are updated with each new entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/0*g6UWK7cKyDKwZtPJ" /></figure><h3>Creating a Simple Langraph</h3><p>Creating a simple Langraph involves several steps:</p><ol><li>Import Necessary Libraries and Define Tools:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*kNnAVfW8PQ8xxTMn" /></figure><p>2. Define AgentState to Store Messages Across the Application:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/0*-cCXcGFwKARgTvU3" /></figure><p>3. Define the Agent Class:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/964/0*bcl1ViBxDECYdbv5" /></figure><ul><li>Align the system message through the input.</li><li>Integrate AgentState into the graph.</li><li>Add nodes and conditional edges by specifying the node’s name and function.</li><li>Set the entry point of the application.</li><li>Create an instance of Langchain runnable using the compile method.</li><li>Store a list of tool names and attach tools to the model.</li><li>Pass the system prompt, list of tools, and model to the agent instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*FVYP1H8C6OgdJCAw" /></figure><ul><li>Visualize the graph.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*WvlRI-omNM9WjsTW" /></figure><ul><li>Pass the query inside the invoke method of the agent.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*Q951f42QAyVQgQfK" /></figure><h3>Persistence</h3><p>Persistence allows maintaining an agent’s state at a specific point in time, enabling you to revert to that state and resume operations from there. To add persistence, include a checkpointer while compiling the graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*oEcoKa5RXPOmUoIL" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/0*QxqALg6TOezCzwCU" /></figure><h3>Streaming</h3><p>Streaming lets you emit a list of signals to show real-time operations. For streaming messages, add the threading configuration and use the stream method along with the thread configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/963/0*WHbWDiYegb_HzdHX" /></figure><p>For streaming tokens, use the astream method asynchronously, employing AsyncSqliteSaver as a checkpoint instead of SqliteSaver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*Y9NItfUkLJNjVgFL" /></figure><h3>Human in the Loop</h3><p>Human-in-the-loop involves integrating human oversight into the AI workflow. This can be achieved by:</p><ol><li>Creating a custom function to update the user message in the state.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*V83R0wCE139HJeYo" /></figure><p>2. Adding an interrupt point on the node where human intervention is required while compiling the graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/0*FCpnaQUK9Qh_CuGf" /></figure><p>3. Creating the agent with the prompt, model, and tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*8uHFt4kElXnrgIDe" /></figure><p>4. Using threading and streaming to call the agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*GLOTKkJWfrRv387D" /></figure><h3>State Memory</h3><p>As the graph executes, a snapshot of each memory state is stored. This snapshot includes agentstate and useful attributes like thread and a unique identifier called thread_ts. Thread_ts is crucial for accessing and modifying specific states if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*BMCgNzrsDIDvOL69" /></figure><h3>Case Study: Creating an Essay Writer:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/933/0*mbZT9KTRzeZPqLez" /></figure><p>To illustrate the process, let’s create an essay writer AI agent:</p><ol><li><strong>Import Essentials and Setup Memory:</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/0*p8Tv7t10K_seQ_zQ" /></figure><p><strong>2. Define AgentState</strong> with attributes: task (topic of essay), plan (generated by the planning agent), draft (essay content), critique (populated by the critique agent), content (documents retrieved by the search tool), revision_number (track of revisions), and max_revision (maximum number of revisions).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/384/0*Pz2aj4ThANPidUQC" /></figure><p><strong>3. Define the Model:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/0*ijZFKhn42TC_FN0Y" /></figure><p><strong>4. Write Prompts for Each Agent:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*BWU7mMyw9aCnUL7V" /></figure><p><strong>5. Import Tavily as a Searching Tool and define the structure of queries.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/0*GAEIBF9Vo-DOo8fJ" /></figure><p><strong>6.Declare and Define Each Agent Individually</strong>:</p><ul><li>Start with the planning agent to generate a plan using AgentState and the planning prompt.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/0*GDdtv8-H5hcwtzHL" /></figure><ul><li>Create a research agent to generate a query based on the task and retrieve documents using Tavily, storing the output in content.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*hLOkblD_pvza7PNN" /></figure><ul><li>Develop a generation node to create the draft of the essay, utilizing the topic, plan, and documents.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/0*-v4qUlUhZjza8hKs" /></figure><ul><li>Implement a reflection node to review the rough draft and store feedback in critique.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/0*u00jmGoIwPHT8Nfv" /></figure><ul><li>Create a research critique node to refine the critique, passing the response through Tavily search and appending the results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/0*yGV3sEx_Af6eJne5" /></figure><p>Add a function to check if the revision number exceeds the maximum and determine whether to continue or stop revisions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*ybKBcfB97qQaYcNt" /></figure><p><strong>7. Initialize the Graph</strong> with AgentState and add the nodes separately.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/820/0*41w2z6J6V5NlZxZX" /></figure><p><strong>8.Set the Entry Point and Add Conditional Edges.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/561/0*rIkajcP4LcVgyCax" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*wxjqbE6HePCXmnsA" /></figure><p><strong>9. Complete the Graph by Compiling the Memory.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/621/0*iQkB46g2uE6aCLcZ" /></figure><p><strong>10. Test with an Input Subject:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/0*DMEC1Nw1XQ1AdAWo" /></figure><h3>Summary</h3><p>This blog provided an in-depth look at creating AI agents using Langraph, covering the core components, data/state types, the step-by-step process of building a simple Langraph, and advanced features like persistence, streaming, human-in-the-loop, and state memory. The case study on creating an essay writer AI agent demonstrated how these concepts come together to build a functional and sophisticated AI solution. By following this guide, you can harness the power of Langraph to develop robust AI agents tailored to your specific needs.</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/ai-agents-using-langraph-a-comprehensive-guide"><em>https://saurabhz.hashnode.dev</em></a><em> on June 24, 2024.</em></p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0a63a8db17d" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/ai-agents-using-langraph-a-comprehensive-guide-d0a63a8db17d">AI Agents Using Langraph: A Comprehensive Guide</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering Multi-Agent Systems with AutoGen: A Comprehensive Guide]]></title>
            <link>https://ai.plainenglish.io/mastering-multi-agent-systems-with-autogen-a-comprehensive-guide-22a465155358?source=rss-89c2bd4bba5d------2</link>
            <guid isPermaLink="false">https://medium.com/p/22a465155358</guid>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[autogen]]></category>
            <category><![CDATA[agents]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[data-scie]]></category>
            <dc:creator><![CDATA[Saurabh Naik]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 09:41:50 GMT</pubDate>
            <atom:updated>2024-10-01T12:38:13.191Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bsYGPFIh9eitQx_U" /></figure><h3>Introduction:</h3><p>As artificial intelligence continues to evolve, the ability to create, manage, and optimize agent-based systems becomes increasingly crucial. AutoGen, a powerful framework for building conversational agents, simplifies this process by providing robust tools for creating both simple and complex multi-agent systems. This blog post will guide you through the essential features of AutoGen, from creating a single agent to managing intricate multi-agent group chats, including tools and techniques to enhance agent capabilities and the importance of human feedback.</p><h3>What are AutoGen Agents?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/0*n8QplQ6_fkjN2p_Q" /></figure><p>In AutoGen, an agent is an entity that can act on behalf of human intent, sending and receiving messages and taking actions based on its programming. The framework includes a built-in class called the ConversableAgent, designed to facilitate these interactions seamlessly.</p><h3>How to Create a Simple Agent in AutoGen</h3><ol><li>Define your Language Model (LLM): Choose the LLM that your agent will use.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/0*yEU5VG7K3nIbczUn" /></figure><p>2. Create an Instance of ConversableAgent: Set up the agent with three parameters:</p><ul><li>name: The agent&#39;s name.</li><li>llm_config: Configuration settings for the LLM.</li><li>human_input_mode: Define whether the agent will accept human input.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/0*qDXceZ2_UmsfBckN" /></figure><p>3. Generate Replies: Use the generate_reply method to receive output from the agent by passing in content and role parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/0*iBXGO-ak7ksXM5FJ" /></figure><h3>How to Create a Multi-Agent System in AutoGen</h3><ol><li><strong>Define Agents:</strong> Create multiple agents by passing in parameters such as name, system_message, llm_config, and human_input_mode.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*47lGfuE70HTow93X" /></figure><p><strong>2. Initiate Chat:</strong> Decide which agent will start the process and use the initiate_chat function, passing in the recipient agent, initial message, and max_turns (the maximum number of conversation turns).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*r3Omuq9FFljQ77IG" /></figure><p>3. <strong>Monitor the Conversation:</strong> Check the entire chat history, token usage, and chat summary.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/0*F1slBusUyqfWu8Yv" /></figure><h3>How to Decide When to Stop the Conversation Between Multi-Agents</h3><p>If the exact number of conversation turns is uncertain, avoid using the max_turns parameter. Instead, use the is_termination_message parameter with a specific string value to signal when the conversation should end. Update the prompt accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*k2vUkebveE-BQRB0" /></figure><h3>Reflection: A Powerful Agentic Design Pattern</h3><p>Reflection involves creating an additional agent that acts as a critic, reviewing and improving the work of the original agent. This method enhances the overall performance and accuracy of the agents’ outputs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/0*fmhKYdvpkU4wFm4X" /></figure><h3>Nested Chat: Enhancing Inner Monologue</h3><p>Nested chat registers as the inner monologue of an agent, allowing for more complex and nuanced interactions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*fumimQLpHHCkuTKH" /></figure><h3>How to Use Tools to Help the Agents:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/0*XFO-itC7fA96w-Gg" /></figure><ol><li>Make Essential Imports and Create an Agent: Ensure the agent is aware of the tools in the system prompt.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*7OwzFk2_o3TWE0ic" /></figure><p>2. Create Python Functions: Define the logic and annotations clearly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*ft6oDS3ghvHQ01JU" /></figure><p>3. Register Functions: Use the register function from the AutoGen library, passing in the functions, agent name, executor agent, tool name, and description.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/789/0*XwJIeiOmCiRZp2_q" /></figure><p>4. Create a Nested Chat: Enable two agents to work with the executor agent before making a move.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/0*RSpYMREHtk7eolaS" /></figure><p>5. Initiate Chat: Start the execution using the initiate_chat function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*yLjwcsEiUvRsJf0L" /></figure><h3>Adding Coding Capabilities with Human Feedback for Multi-Agent Systems</h3><p><strong>a) Code Generated by the Agent:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/0*Hqc-Pvn6wre81Jhc" /></figure><ol><li>Import and Instantiate LocalCommandLineCodeExecutor: Provide necessary parameters.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/0*_iCbMCcpl8u-1CSa" /></figure><p>2. Create a Code Executor Agent: This agent executes the provided code without using an LLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/0*vRMAsCes2Zo54QMz" /></figure><p>3. Create a Code Writer Agent: Use a configured LLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/0*XLLeaqH1Jjhmv9CJ" /></figure><p>4. Define Tasks: Assign tasks to these agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/0*J48M0ofqm4gNSvLf" /></figure><p>5. Initiate the System: Start with the code executor agent and proceed to the code writer agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/685/0*TNJb3Js_eWkL56Jn" /></figure><p><strong>b) User-Defined Code:</strong></p><ol><li>Create User-Defined Functions: Develop custom functions for the agent system.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/0*zlEqp2k6paJH_7H9" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/907/0*Z7uSB0zSyJmp1HLQ" /></figure><p>2. Pass Functions to LocalCommandLineCodeExecutor: Include these functions during instantiation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/726/0*r4Fbqajx566vrcTl" /></figure><p>3. Inform Code Writer: Update the prompt to include knowledge of custom functions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/0*LIbdbVR0-VnLamAj" /></figure><p>4. Create Agents Separately: Set up code writer and code executor agents.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/0*7KiMvaMKJXv1x0mT" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/934/0*Cu2-ai3ovOJpXJ_w" /></figure><p>5. Initiate the System: Start the process from the code executor to the code writer agent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/0*31OoEPwm9Spc-dGG" /></figure><h3>How to Create a Multi-Agent Group Chat</h3><ol><li>Set Up LLM Configuration and Define Tasks.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/0*Bxyx6W_QPi2z7X_8" /></figure><p><strong>2.Create Agents Using AutoGen:</strong></p><ul><li>User Proxy Agent: Sends tasks to other agents.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/0*NTnQLq16ADtTluuX" /></figure><ul><li>Planner Agent: Decomposes complex tasks into smaller ones.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/0*EyOOjRpVQ8O3u-Yj" /></figure><ul><li>Engineer Agent: Executes Python code given by the planner.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/0*Spyu9XhM7AeGrBCB" /></figure><ul><li>Executor Agent: Executes the code.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/0*ZYPWtvZE2A1jObiJ" /></figure><ul><li>Writer Agent: Blogs about the task.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*zajdgkhvd-Ln2kXE" /></figure><p>3. Create a GroupChat Instance: Add all agents to the group chat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/0*Ik7EsFW8oZYuChGx" /></figure><p>4. Manage the Group with GroupChatManager: This special agent handles the group chat and initiates workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*Hw2YUlrW8LG-SsDA" /></figure><p>5. Initiate Workflow: Start from the user proxy to the GroupChatManager and pass the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/634/0*r7-Io8zycazI28EI" /></figure><p>6. Summarize Workflow: Assign tasks to agents based on chat history and their specialties. Repeat the process until the maximum number of iterations is reached.</p><p>7. Maintain Sequence: Add restrictions to the order of agents to ensure a defined sequence, preventing arbitrary decision-making by the LLM.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/846/0*cqJ9cQxGEynRDMPh" /></figure><h3>Summary</h3><p>AutoGen provides a versatile platform for creating and managing both simple and complex multi-agent systems. By understanding how to create agents, manage conversations, utilize tools, and integrate coding capabilities, you can leverage AutoGen to build sophisticated AI-driven solutions. Whether you’re implementing reflection and nested chats or orchestrating a multi-agent group chat, the principles and techniques covered in this guide will help you harness the full potential of AutoGen for your AI projects.</p><p><em>Originally published at </em><a href="https://saurabhz.hashnode.dev/mastering-multi-agent-systems-with-autogen-a-comprehensive-guide"><em>https://saurabhz.hashnode.dev</em></a><em> on June 13, 2024.</em></p><h3>In Plain English 🚀</h3><p><em>Thank you for being a part of the </em><a href="https://plainenglish.io/"><strong><em>In Plain English</em></strong></a><em> community! Before you go:</em></p><ul><li>Be sure to <strong>clap</strong> and <strong>follow</strong> the writer ️👏<strong>️️</strong></li><li>Follow us: <a href="https://twitter.com/inPlainEngHQ"><strong>X</strong></a> | <a href="https://www.linkedin.com/company/inplainenglish/"><strong>LinkedIn</strong></a> | <a href="https://www.youtube.com/channel/UCtipWUghju290NWcn8jhyAw"><strong>YouTube</strong></a> | <a href="https://discord.gg/in-plain-english-709094664682340443"><strong>Discord</strong></a> | <a href="https://newsletter.plainenglish.io/"><strong>Newsletter</strong></a></li><li>Visit our other platforms: <a href="https://cofeed.app/"><strong>CoFeed</strong></a> | <a href="https://differ.blog/"><strong>Differ</strong></a></li><li>More content at <a href="https://plainenglish.io/"><strong>PlainEnglish.io</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22a465155358" width="1" height="1" alt=""><hr><p><a href="https://ai.plainenglish.io/mastering-multi-agent-systems-with-autogen-a-comprehensive-guide-22a465155358">Mastering Multi-Agent Systems with AutoGen: A Comprehensive Guide</a> was originally published in <a href="https://ai.plainenglish.io/">Artificial Intelligence in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>