<?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 Martin Dieste on Medium]]></title>
        <description><![CDATA[Stories by Martin Dieste on Medium]]></description>
        <link>https://medium.com/@martindieste?source=rss-9d7129416df3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*6ijaQSbH4vvgHGnxDzFObQ.jpeg</url>
            <title>Stories by Martin Dieste on Medium</title>
            <link>https://medium.com/@martindieste?source=rss-9d7129416df3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 06:20:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@martindieste/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[AI Agents in KNIME 5.5 Part 2]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-part-2-eded98a9f57b?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/eded98a9f57b</guid>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Mon, 07 Jul 2025 18:42:06 GMT</pubDate>
            <atom:updated>2025-07-14T07:06:27.758Z</atom:updated>
            <content:encoded><![CDATA[<h4>GETTING STARTED | AGENTIC AI | KNIME ANALYTICS PLATFORM</h4><h4><em>Expanding our Agents capabilities with more tools! — Check </em><a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-933ac54dca84"><em>Part 1</em></a><em> for an intro</em></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*r2aPgXEJNeiPAfaA" /><figcaption>Image after feeding my article to ChatGPT :-).</figcaption></figure><h3>Recap Part 1</h3><p>A week ago, I <a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-933ac54dca84">released part one</a> of this multi-part series about the new AI agent features in <a href="https://www.knime.com/downloads?utm_term=knime&amp;utm_campaign=Brand-Knime-Theme-EMEA&amp;utm_source=google&amp;utm_medium=cpc&amp;hsa_acc=1079364086&amp;hsa_cam=21031129327&amp;hsa_grp=162669096207&amp;hsa_ad=691087344187&amp;hsa_src=g&amp;hsa_tgt=kwd-6339162182&amp;hsa_kw=knime&amp;hsa_mt=b&amp;hsa_net=adwords&amp;hsa_ver=3&amp;gad_source=1&amp;gad_campaignid=21031129327&amp;gbraid=0AAAAA9UkMJCD9BmwQVPQOSitKscwrIdLn&amp;gclid=Cj0KCQjww-HABhCGARIsALLO6XxO-L1vRzZDFLUlBu0PTxQQY5orE-s64PZXInwtfPNfeLHh5yxyn48aAnwZEALw_wcB">KNIME 5.5</a> (free download!). Before diving into part two, let’s briefly recap what we achieved in part one:</p><ul><li>Built a basic agent workflow using the <a href="https://hub.knime.com/n/bEaOBBaf9xZobrZ4"><strong>Agent Prompter</strong></a><strong> </strong>node.</li><li>Learned how to build a tool workflow with a <a href="https://hub.knime.com/search?q=configuration+nodes&amp;type=node&amp;tag=Configuration&amp;sort=best">configuration node</a> to pass parameters.</li><li>Learned how to pass information back from a tool to the agent using the <a href="https://hub.knime.com/n/LjX0xMliAKUvMIpY"><strong>Tool Message Output</strong></a><strong> node</strong>.</li><li>Explored other nodes that can be handy when building agentic workflows.</li><li>Gave our agent a basic tool to retrieve profit center revenue information.</li><li>Tested our AI agent setup by asking two questions: one requiring a tool, and one requiring general knowledge.</li></ul><p>We’ll continue from where we left off and enhance our AI agent. The objective is to understand more advanced concepts in building AI agents in KNIME through simple examples.</p><h3>Outlook Part 2</h3><h4>What we will cover today</h4><p>We will equip our agent with two additional tools that were mentioned in part one:</p><ol><li><strong>Product Master Retrieval Tool</strong></li><li><strong>Sum Up Price Tool</strong></li></ol><p>The <strong>Product Master Retrieval Tool</strong> will be similar to the Profit Center Revenue Retrieval Tool from part one.</p><h4>Product Master Retrieval Tool Setup</h4><p>This tool contains a table of dummy data mapping product groups to their products, each with a price column.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*DDETcPRz1r5dNMx6KYhliQ.png" /><figcaption>Dummy data of product master retrieval tool.</figcaption></figure><p>The agent can use this tool to return data for one product group. The data will be accessible in an output table port of the <em>Agent Prompter Node</em>, and the agent can send this data to another tool.</p><h4>Sum Up Price Tool</h4><p>This tool requires, as input, a table with the same structure as the Product Master Retrieval Tools&#39; dummy table. It sums the pricing column for all rows in the input table and sends the sum back to the agent via the <em>Tool Message Output Node</em>.</p><p>Let’s now go ahead and build both of these tools!</p><h3>Building the Tools</h3><h4>Step 1: Set up additional workflows in the Tools folder</h4><p>Navigate to your workflow explorer’s Tools folder (created in part one) and add two additional workflows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*vE1dI_tFPG67H7HJ3xvOKg.png" /><figcaption>Create additional workflows in Tools folder.</figcaption></figure><ul><li>ProductMasterDataRetrieval</li><li>SumUpPriceTool</li></ul><p>I named mine clearly so both I and the AI Agent understand their purposes.</p><h4>Step 2: Build the Product Master Retrieval Tool</h4><p>You can again start by dragging the nodes as shown in the screenshot below onto your workflow canvas and also to connect them in a similar way. The <em>Table Creator node</em> contains the dummy data shown in the screenshot above. If you want to follow this tutorial, I suggest that you set it up in a similar way, or at least make sure that the column naming and column structure is the same. Alternatively, you can navigate to the bottom of this article where you will find a link to the workflow on my KNIME Hub space where you can download it from.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GzVsn9hFYoMr1Uu_6uJu7g.png" /><figcaption>Product Master Retrieval Tool overview.</figcaption></figure><p>The tool uses a <em>Single Selection Configuration node</em> which allows the selection of a product group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*B7A323rRhemtFdiWyKBHAA.png" /><figcaption>Configuration Dialogue of Single Selection Configuration node.</figcaption></figure><p>Make sure to put the Label and Description as well as the variable name field to good use to give the agent additional information as to what the inputs are for. The “Possible Choices” Field matches the Product Groups in our dummy data</p><p>The <em>Row Filter node</em> uses the flow variable “selectedProductGroup” generated by the <em>Single Selection Configuration node</em> to filter the dummy data for the selected product group:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/901/1*EZPtv4K6bVnS_nLOZKpJPg.png" /><figcaption>Row Filter node configuration.</figcaption></figure><p>This part is similar to the Profit Center Revenue Retrieval Tool that we have built in part 1.</p><p>From the <em>Row Filter node</em>, the workflow continues in two branches.</p><p>The bottom branch goes straight to a <em>Workflow Output node</em>. This node was also introduced in part 1, however we did not use it yet. This node allows us to pass the table that the <em>Row Filter node</em> delivers to the <em>Agent Prompter node,</em> so that we can use it either outside the <em>Agent Prompter node</em> in downstream nodes, or the agent will be able to use the data that comes through the tool’s output port and send it to a different tool as input. We’ll see how both these scenarios work out in a moment.</p><p>The upper branch goes to the <em>Expression node</em> and in this node we create a simple message column containing a message to the agent, e.g.:</p><blockquote>”The data for A has been retrieved and can be used for further processing.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*SDBeGsOlfTJuxiPn-w9M1w.png" /><figcaption>Expression node configuration.</figcaption></figure><p>The <em>Column Filter node</em> then removes any other column, but this new Message column. This Message columns is then send to the <em>Tool Message Output node</em>, which allows the agent to read and understand it once the tool has been executed. This message should nudge the agent that it may have to use another tool once the data has been retrieved using this first tool — obviously depending on the user query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*O1CalvjhLXf-vkdxxJNO1Q.png" /><figcaption>Column Filter configuration.</figcaption></figure><p>Let’s now built the second new tool.</p><h4>Step 2: Build the Sum Up Price Tool</h4><p>To build this additional tool you can start by opening up the workflow that you have created, and by copying the<em> Table Creator node</em> from the previous workflow. We will need this just for development purposes.</p><p>As this is a rather short workflow, please look at the screenshot below and add the corresponding nodes in the right order to your workflow canvas:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D3KA_EkN9CNHP6LkcXen0A.png" /><figcaption>Sum Up Price Tool overview.</figcaption></figure><p>You can see there are just five nodes on the workflow canvas, however, we will need five nodes during the development of this tool, but only the last three are executed when our agent uses this tool.</p><p>The first two nodes serve for development purposes only, so that we can work with some dummy data while we develop this tool. The <em>Table Creator node</em> should reflect the structure of data that we expect to come into this tool when the agent is using it. That’s why I have copied across the <em>Table Creator node</em> from the previous workflow, and then used a <em>Row Filter node</em> to filter for product group A.</p><p>This data is then sent into the <em>Workflow Input node</em>, another node that we have heard about in part 1, but that we haven’t used yet. During development, this nodes passes through the data that we send to its “white arrow” input port. When it is used by the agent, this data is ignored and replaced with the actual data the agent has retrieved previously and decided to sent to this tool.</p><p>After the <em>Workflow Input node,</em> we add a simple <em>Row Aggregator node</em>. This <em>Row Aggregator node</em> is configured to sum up the column that is labeled “Price”. We expect that the data that comes in is already filtered for a specific product group. Therefore, we do not need any group column in the <em>Row Aggregator node</em> configuration, and it also means that we know there will be only one row and one column in the table that comes through the output port. That’s why we can then connect it straight to the <em>Tool Message Output node </em>to deliver the sum of all product prices to the agent. And with that, we are also done with the second tool!</p><p>Before we can put both of these tools to good use, though, we have to help our agent better understand what each of the three tools at its disposal are for. We can do this by editing the workflow description of each of the three tools.</p><h4>Step 3: Edit Tool descriptions</h4><p>Open up all three workflows inside the Tools folder. One by one, open them up in your workflow editor and click anywhere on the workflow canvas to make sure that no node is selected.</p><p>In the navigation bar to the left of your application, click on the Info button and then click the “Edit” icon as shown below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/464/1*L9m_hlX4ED7hVpD6H7qCXg.png" /><figcaption>Navigate to Workflow Description.</figcaption></figure><p>Enter a description that explains what the tool is to be used for. When we convert this workflow to a tool via a <em>Workflow to Tool node</em>, this description, amongst other things, will be extracted and will be provided to the agent so that it knows what to use these tools for. When you are done editing, click the yellow checkmark to close the edit menu and then do not forget to save your workflow. See below an example of the Sum Up Price Tool description I have used:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*CBFSOUVQKx5kl1LCiCrBNQ.png" /><figcaption>Sum Up Price Tool workflow description.</figcaption></figure><p>Here are the tool descriptions for all of my tools:</p><p><strong>Dummy_retrieval_tool (from Part 1):</strong></p><blockquote>This tool allows to provide a Profit Center and returns the revenue for that Profit Center</blockquote><p><strong>ProductMasterRetrieval:</strong></p><blockquote>Use this tool to retrieve Products of a specific product group and their price.</blockquote><p><strong>SumUpPricingTool:</strong></p><blockquote>Use this tool to get the total price of all products that were retrieved using the ProductMasterDataRetrieval tool</blockquote><p>Once you have edited the workflow descriptions of all these three tools and you have saved them, we are now ready to put our agent to a test.</p><h4>Step 4: Test Agent capabilities</h4><p>Open up the <em>AgenticFeatures</em> workflow that we have built in part one. Make sure that you reset it entirely to make sure that the <em>List Files/Folders node</em> reads the new two tools in addition to the tool that we’ve built in part 1 to pass them to the <em>Agent Prompter node</em>. Once you execute the <em>Workflow to Tool node</em>, you should see something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2e4W3nOHJemm0gk4go2XDg.png" /><figcaption>Workflow to Tool node showing all three tools!</figcaption></figure><p>Yes, that’s it, you do not have to change anything else in the basic Agent Workflow from part one. The tools are being made available to the agent automatically since they have been placed in the Tools folder. You can move on immediately to think of which tasks you want to give to your agent, and then enter them as a User Message in the <em>Agent Prompter</em> configuration.</p><p>Don’t believe me? Let’s check it out!</p><blockquote>Test 1: User Message: Retrieve all products for product group C</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t0jNCPK8g1ODmSSDl9ou3g.png" /><figcaption>Prompt and Output in data port.</figcaption></figure><p>That’s a pass. If you scroll back up to the screenshot of my dummy data, there were exactly these two products listed, a GPU and a CPU priced at exactly the prices that you see in the screenshot above.</p><blockquote>Test 2: What is the total price for all products in Product Group B?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xoE7enjPYOgbAtNKqHpKhQ.png" /><figcaption>Test 2: Prompt, Conversation and Table Output.</figcaption></figure><p>And another pass! As you can see, the agent uses the information provided by the Sum Up Price Tool in its final response. If you check out the data output port, it also delivers the right set of data.</p><blockquote>Test 3: How much revenue was booked on Profit Center C?</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fx3xTgGPrk6EYyJBA5oEJg.png" /><figcaption>Test 3: Using Tool from Part 1</figcaption></figure><p>Yes — our agent still knows how to use the tool from part 1.</p><h3>Wrap up</h3><p>We provided our agent two additional tools in this tutorial and made sure that they can be used successfully. You can see this as a basic example as to how to build a very basic agent and how to enhance the capabilities of your agent by providing it more and more tools. Now imagine a world where you have built multiple specialized agents that each have specialized tools designed for their specific purposes. And then you make these agents a tool for an orchestration agent.</p><p>Does that sound far-fetched? To be honest I don’t think so and that is definitely where I want to take this going forward. That said I have to admit I have not yet experimented with it. But you never know… so stay tuned!</p><blockquote>You can find the workflow on my account on the <a href="https://hub.knime.com/martindddd/spaces/Public/Projects/24%20AI%20Agents%205.5/BasicAgent-Part1~trKOHVnjpXRFEEuz/"><strong>KNIME Community Hub</strong></a><strong>.</strong></blockquote><h3>Get in touch with me</h3><p>I appreciate any connections on <a href="https://www.linkedin.com/in/martindieste/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>And any visitors to my <a href="https://finnovationflows.com/"><strong>website</strong></a><strong>.</strong></p><p>As well as new viewers on my <a href="https://www.youtube.com/channel/UCEN433pXyRVFKlgwjJl0bwg?sub_confirmation=1"><strong>YouTube</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eded98a9f57b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-part-2-eded98a9f57b">AI Agents in KNIME 5.5 Part 2</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</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 in KNIME 5.5]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-933ac54dca84?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/933ac54dca84</guid>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[agentic-ai]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Wed, 02 Jul 2025 18:47:22 GMT</pubDate>
            <atom:updated>2025-07-21T07:17:36.623Z</atom:updated>
            <content:encoded><![CDATA[<h4>GETTING STARTED | AGENTIC AI | KNIME ANALYTICS PLATFORM</h4><h4>A walkthrough of the new agentic AI framework — fully no code</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*57Cn77_1_p0GtNZR3f3doQ.png" /><figcaption>Source Pexels (by Nidia Dias)</figcaption></figure><blockquote><strong>Note. </strong>For a more advanced walkthrough, check <a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-part-2-eded98a9f57b">Part 2</a>!</blockquote><p>It’s been a minute since I came across a topic that I’m excited enough about to take the time to write an article.</p><p>That has drastically changed pretty much just right now as <a href="https://www.knime.com/blog/whats-new-knime-analytics-platform-55?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME has released version 5.5</a> of their Analytics Platform. Amongst a lot of other great improvements, they also made building AI agents, the basis to enable Agentic AI, much more accessible.</p><p>And that’s exactly what I want to dedicate this article to. I want to help you build a minimal agent, something like <strong>the “hello world” of AI Agents</strong> in KNIME 5.5 (and maybe just a bit more… in Part 2 in the not too distant future!)</p><p>Before we dive into the detail, let’s reflect on the history of AI agents in KNIME. It all started earlier this year at the<a href="https://www.knime.com/events/spring-summit-2025"> KNIME Summit 2025 in Berlin</a>, when AI agents as a framework were introduced to KNIME. Prior to this, some nodes were available that allowed people to pass vectors to stores as tools to agents. This enabled the classic Retrieval Augmented Generation (RAG) use case, which, to this date, probably is one of the highest Return-On-Investment use cases to be found in the corporate world when it comes to Gen AI.</p><p>The release at the summit certainly made AI agents much more accessible, however, there was one challenge for non-programmers in the concept and there was the need to be familiar with JavaScript Object Notation, in short JSON, and how to work with that in KNIME. Defining JSON as an input and parsing it is quite achievable and has a steep learning curve. Nodes like <strong>JSON Path</strong> make extracting data from JSON objects easy. The hard part, however, is to turn a table into JSON that can be passed to the required <strong>Container Output (JSON)</strong> nodes.</p><p>Luckily, that has changed substantially. Let’s start by looking at what the new or improved nodes are that are now made available with version 5.5, before we then dive into how we can put them to very good use.</p><h3>AI Agent Nodes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/662/1*tYCPqL67AKbW3djxpyrG6w.png" /><figcaption>Nodes available for AI Agent development</figcaption></figure><p>It’s obvious there are two nodes that make AI Agent development in KNIME very easy:</p><ul><li>the <a href="https://hub.knime.com/n/VsPBMcO08qozLkxB"><strong>Agent Chat View</strong></a><strong> </strong>node and</li><li>the <a href="https://hub.knime.com/n/bEaOBBaf9xZobrZ4"><strong>Agent Prompter</strong></a> node</li></ul><p>The <strong>Agent Chat View</strong> node has been designed with conversational chatbots in mind. In addition to the large language model input port, a table input port can be added in order to pass tools to it as well. Optionally, data input ports can be added dynamically, if needed. Thanks to its chat view, this node can be embedded in data apps that are designed to let the human query the LLM by simply chatting with it.</p><p>The <strong>Agent Prompter</strong> node is a lot more flexible and can be embedded in custom data apps as well. A main difference to the Agent Chat View node is that it does not come by default with a chat interface. However, you can add data output ports. This means that when the tools that the agent has access to deliver a data table as an output. These can be made accessible to downstream processes in your workflow or the agent can use them as inputs into different tools.</p><p>The next three nodes, in addition with any configuration node, are used to manage tool input and output:</p><ul><li>Workflow Input</li><li>Any Configuration node (typically used to built configurable components)</li><li>Workflow Output</li><li>Tool Message Output</li></ul><p><strong>Workflow Input and Output nodes </strong>build on existing nodes that typically are being used in callable workflows. You can learn more about workflow invocation in the <a href="https://www.knime.com/learning">Level 2 Courses that KNIME offers for free</a>. Their purpose in the context of AI agents is very similar. You can use these to pass data tables into a tool and can use them to pass data tables out from a tool back to the agent. A really cool thing is that the agent can pass these data tables from one tool to another other. So you could have one tool that fetches data from a database and a second tool that transforms that data say into a PDF report.</p><p>The <strong>Tool Message Output</strong> node is used to generate a custom message that the tool passes back to the agent. You do not necessarily have to have a Tool Output Message in every tool that you design, because there will be a default message that tells the agent whether the tool has been successfully executed or not. That said, it is still best practice to do so. There may even be tools that only use the <strong>Tool Message Output</strong> node to pass information that the tool generated back to the agent, given that there may not be in all the cases the need to pass a table via the Workflow Output node.</p><p>And lastly, probably one of the greatest changes that come to AI agent development in KNIME version 5.5 is that instead of using Container Input and Output (JSON) nodes to define parameters that are required by tools as inputs or that should be delivered by tools as outputs, you can simply use any <strong>Configuration nodes,</strong> like <strong>String Configuration</strong> or <strong>Integer Configuration</strong> to define input parameters.</p><p>Alone this new feature makes developing agents and their tools much more accessible to people without having any programming knowledge at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*_2Y1pUjD0HeHuKS9PBPh1A.png" /><figcaption>Configuration nodes used to define Tool parameters.</figcaption></figure><h3>Building a simple AI Agent in KNIME</h3><p>Let’s now build a simple agent that uses some dummy data just to better understand the concept of how it all comes together in KNIME.</p><p>The final agent will have access to three tools that we will build step by step. Each tool will extend the agents capabilities a little bit more and enable more complex use cases.</p><ul><li>Profit Center Revenue Retrieval tool (Part 1)</li><li>Product Master Retrieval Tool (Part 2)</li><li>Sum Up Price Tool (sums up data retrieved by Product Master Retrieval Tool) (Part 2)</li></ul><p>In this initial article, I want to cover the generic agent setup workflow as well as creating the first tool, the Profit Center Revenue Retrieval Tool. In the future Part 2, I will cover a more complex scenario where two tools depend on each other. The first tool retrieves data that the agent can pass to a second tool, if the task requires it.</p><p>If you want to follow this tutorial or if you want to download the workflow which is linked at the bottom, you will need to install the <a href="https://hub.knime.com/knime/extensions/org.knime.python.features.llm/latest"><strong>KNIME AI extension</strong></a>. Follow the link and simply drag and drop it into your KNIME Analytics Platform, and follow the instructions on screen to get it installed.</p><h4><strong>Step 1: Folder Structure in your KNIME Workspace</strong></h4><p>First create a new folder inside your KNIME workspace. Mine is called “BasicMVP”. Inside this folder create another folder called “Tools” and a workflow called “AgenticFeatures” as an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/365/1*UYB7WzOj75dL6ET8wY9zHg.png" /><figcaption>Example Folder Structure.</figcaption></figure><h4>Step 2: Setup basic agent workflow</h4><p>Take a look at the screenshot below and find the relevant nodes in your node repository, drag them onto the workflow canvas and connect them in the order as you see below. We will go through any necessary configuration in the next part of this tutorial.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*QgoDLG4YpOTCW5TG9mtAWw.png" /><figcaption>Basic Agent setup.</figcaption></figure><p>The <strong>Credentials Configuration</strong> node is used to enter your API key as a password for whatever LLM service provider you are using.</p><p>If you’re using OpenAI, which I would recommend to get started in this tutorial, then you don’t need to change any other configuration in the <strong>OpenAI Authenticator</strong> node. If you want to use a different LLM provider (Google’s Gemini, Anthropic’s Claude, etc.), drag and drop the pertinent Authenticator node and make sure to provide the relevant API key.</p><p>In the <strong>OpenAI LLM Selector</strong> node, select a model from the Model ID dropdown. I will be using GPT 4.1. If you are using a different provider than OpenAI, make sure to drag and drop the proper LLM Selector node. I recommend increasing the maximum response length from 200 to about 800 tokens.</p><p>In the bottom branch leading to the Agent Prompter, configure the <strong>List Files/Folders node </strong>to read files relative to the current Workflow. Then click the browse button and select the tools folder that you have created in step 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*d3J2QAK8EoXJE9syAija8Q.png" /><figcaption>List Files/Folders node configuration.</figcaption></figure><p>Once all the previous nodes have been executed, you can move to the <strong>Agent Prompter</strong> node. Here, you can select “Tool” as the “Tool column” and leave the “Conversation column name” as it is. Later on, in the “User message” field, you can define the initial message that you want to send to the agent to start the thinking and tool calling process. I would recommend not to change the default system message for now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/352/1*X6NLbv6rWY2DNHQm7Zvvww.png" /><figcaption>Agent Prompter configuration.</figcaption></figure><p>Finally, connect the upper output port of the Agent Prompter to a <strong>Message Part Extractor</strong> node. This node will come incredibly handy to better understand what’s going on under the hood once the agent has delivered its final response.</p><h4>Step 3: Building the first tool</h4><p>With the basic setup complete, you may now be wondering what tools this agent can use. And the simple answer is: Whatever tool we put into the tools folder. However, as you may have noticed, for now there is none. So let’s change that next.</p><p>Navigate into the <strong>Tools</strong> folder and create a new workflow. I have called mine <strong>“Dummy_retrieval_tool”</strong>.</p><p>This workflow will consist of a <strong>Single Selection Configuration</strong> node, a <strong>Row Filter</strong>, a <strong>Table Creator</strong>, a <strong>Column Filter</strong> and finally a <strong>Tool Message Output</strong> node. Set it up as per the screenshot below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avU2jZXHa7LD_iOGBnSYNA.png" /><figcaption>Dummy Retrieval Tool set up.</figcaption></figure><p>In the <strong>Table Creator</strong> you can create an arbitrary set of data to whatever your liking is. Given that I have a finance background, I decided to use a string column with arbitrary profit centers and a revenue column with values per profit center. The important thing here is that whatever options you have in the profit center column, these are also reflected in the Single Selection Configuration node as possible choices. Make sure that there is a default value selected as you can see in the screenshot above. Also, make sure that you choose <strong><em>“telling” variable names</em></strong> and that you provide a <strong><em>proper description in the Single Selection Configuration node</em></strong>.</p><p>All these are pieces of information that the agent can use to determine whether this tool is the right tool to use for a given task. You see variables generated by this <strong>Single Selection Configuration</strong> node to drive what is filtered out in the <strong>Row Filter</strong> node. Given that the example data I have created only has each profit center in the dataset once, it is ensured that after using the Row Filter node there will be only one row remaining. This is important because the <strong>Tool Message Output</strong> node only passes the data in the first cell of a table, so the very top left. That is also why in the <strong>Column Filter</strong> you should filter out the profit center column and only pass the revenue column, in my example.</p><p>Lastly, make sure to provide a tool description in the <strong>Workflow Info </strong>tab, as this description will be used by the agent to understand what tool(s) to use to solve the task at hand.</p><p>Now all that is left to do is to save this very first tool as a workflow and then to go and try out what our agent can do with it.</p><h4>Step 4: Asking the Agent questions and to retrieve Profit Center information</h4><p>Go back to the agentic features workflow which contains the generic agent setup. In the Agent Prompter configuration provide a user message. You could ask a question, for example, about who was the 2014 FIFA World Cup Winner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DxwNhvKSbvNHlviOikVzA.png" /><figcaption>Agent answers a general question.</figcaption></figure><p>Given that information related to this question was part of the model’s training data, it provides an answer straight away without using any tool.</p><p>Now ask the agent to provide information about revenue on profit center A. You can do this by simply reconfiguring the user message of the <strong>Agent Prompter</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*le5Pc9_RD9H3HRwHH7uKVQ.png" /><figcaption>Answering a question using the tool.</figcaption></figure><p>If you open the output conversation table, you will notice that there are a couple of more rows. After the initial question, AI has decided to use the dummy retrieval tool passing in the parameter of selected profit center equals a. The next row is the answer from the retrieval tool, which is 500 — i.e., what is left in the table that is passed to the Tool Message Output node. This number is then used by the AI to generate the final result message at the very bottom.</p><h4><strong>Step 5: Inspect the details using the Message Part Extractor</strong></h4><p>After having asked the revenue question and having received the answer, I highly recommend that you execute the <strong>Message Part Extractor</strong> node.</p><p>This note shows you additional information that is hidden in the background but is generated as part of the internal agent conversation.</p><p>For example, in the column Tool Call you can see the JSON object that gets generated based on your initial user question that is then passed to the dummy retrieval tool. The Tool Call ID column provides additional information that I am very sure in the future can be used to better debug these agent type of workflows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0S1_d-4imCDgPfbAm6TRBQ.png" /><figcaption>Message Part Extractor provides additional information.</figcaption></figure><h3>Agentic AI made simple</h3><p>Let’s leave it at that for part one. You have now successfully set up a basic agent workflow in KNIME where the agent can use a basic dummy tool.</p><p>The great thing about building tools in KNIME is that every tool is just a configurable workflow that is made available to the agent. That also makes it very easy to convert any existing workflows into a tool that the agent can use. Just imagine that you have a workflow that obtains data from a database. You can now simply add some configuration nodes that then allow the agent to pass data to this tool and retrieve information.</p><p>How exactly that process works to then pass the obtained data back to the agent or to the user or to another tool, we will cover it in <a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-part-2-eded98a9f57b">Part 2</a>!</p><blockquote>You can find the workflow on my account on the <a href="https://hub.knime.com/martindddd/spaces/Public/Projects/24%20AI%20Agents%205.5/BasicAgent-Part1~trKOHVnjpXRFEEuz/"><strong>KNIME Community Hub</strong></a><strong>.</strong></blockquote><h4>Get in touch with me</h4><p>I appreciate any connections on <a href="https://www.linkedin.com/in/martindieste/"><strong>LinkedIn</strong></a><strong>.</strong></p><p>And any visitors to my <a href="https://finnovationflows.com/"><strong>website</strong></a><strong>.</strong></p><p>As well as new viewers on my <a href="https://www.youtube.com/channel/UCEN433pXyRVFKlgwjJl0bwg?sub_confirmation=1"><strong>YouTube</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=933ac54dca84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/ai-agents-in-knime-5-5-933ac54dca84">AI Agents in KNIME 5.5</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No-code Financial Modelling Pipelines in KNIME]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/no-code-financial-modelling-pipelines-in-knime-1afe790d7506?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1afe790d7506</guid>
            <category><![CDATA[financial-modelling]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[getting-started]]></category>
            <category><![CDATA[finance]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 11:24:09 GMT</pubDate>
            <atom:updated>2025-01-31T09:18:08.589Z</atom:updated>
            <content:encoded><![CDATA[<h4>GETTING STARTED | FINANCIAL MODELLING | KNIME ANALYTICS PLATFORM</h4><h4>How to create a reliable financial modelling pipeline that delivers a uniform data structure for easy consumption</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZCyCRqPt0Yn3OiWQClxeQ.jpeg" /><figcaption>Financial Model Overview.</figcaption></figure><p>I’ve recently explored <a href="https://www.knime.com/knime-analytics-platform?utm_source=website&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=evangelism">KNIME</a>’s capabilities when it comes to financial modeling. I have documented the process of building a minimal viable product in a YouTube video series which you can find following the link at the very end of this article. I have thought about how to possibly fit the content of a total of four videos (to date) into an article — the best idea was not to try that at all, but to cover the raw basics and use it as a pre-read to for readers to make up their mind if diving into this topic in-depth is for them or not.</p><p>This article guides you through 6 steps that turn what looks like a very simplistic dataset of just 4 rows into a bottom-up data set containing periodic accounting journals that make the transactions flow from Profit and Loss Statement to Balance Sheet and finally to Cash Flow Statement. The final data set will contain almost <strong>1500 </strong>rows of transactional data and it will take about 20 nodes and not a single line of code to transform it.</p><h3>Financial Modelling — Why in KNIME?</h3><p>Let’s start with why I thought it to be a good idea to build what I call a Financial Modelling Pipeline in <a href="https://www.knime.com/knime-analytics-platform?utm_source=website&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=evangelism">KNIME</a>:</p><p>My background is Finance / Controlling and Accounting. During my career, which spans almost 20 years across various functions and companies, I had to built financial models and projects for many different occasions. Short-term models to produce budgets and forecasts in FP&amp;A, Offer/bid models to turn various costing and profitability inputs into a final customer price, operational/accounting models to apply complex accounting rules like IFRS15 revenue recognition and IFRS16 leasing, to long-term projects and business plan models to quantify and assess the opportunity of new business ventures.</p><p>I’ve used various technologies to achieve this. From basic models in spreadsheet tools like Excel, to combining spreadsheets with new technologies to take care of calculations — e.g., capturing input in a spreadsheet and taking care of calculations in PowerPivot or PowerBI and storing results in databases like Access or SQL. I’ve also reverted back to KNIME.</p><p>I’ve witnessed first-hand many cases where traditional spreadsheet and formula-based models that were supposed to be “robust” actually caused issues:</p><ul><li>That one time when a project requiring board approval that looked way too appealing only did so because of formula inconsistencies due to user error.</li><li>All those times when the numbers did not turned out as modelled and the question “why” came up — sorting through many different version… “vFinal_Draft3_Submitted”…</li><li>Difficulties in finding answers to supposedly easy question because of having to pull them out of a variety of different sheets.</li><li>Complex, long-term model turning large in size to the extent that frequent crashes occur and user experience gets impacted adversely.</li><li>Understanding complex formulas after “getting handed over” a complex model build by someone else (Admittedly, I may have granted some former colleagues the same favor at times…).</li></ul><p>Don’t get me wrong — I don’t make this article about bashing spreadsheets or traditional financial modelling — it is to showcase and further explore what I have found to be a good alternative. The above is a collection of my experience over almost 20 years <strong><em>on the negative </em></strong>side. I think I made those experiences not necessarily because Financial Models are bad in general, but because not every financial model is built by a highly skilled modeler that can implement the right measures to avoid the above, but rather by your average employee that somehow got known to be an Excel-Wizard.</p><h4>So why KNIME again?</h4><p>Ah right — I went a bit on a tangent here.</p><p>Well KNIME allows you to build very complex logic step by step. This allows you to document what your workflow is doing on the fly and, if done right, does not require understanding complex formulas that cover 4 or more lines in your formula bar. With KNIME’s extensive data wrangling capabilities, it is simple to apply business logic to a dataset with few nodes and especially when it comes to double-entry bookkeeping logic, it is easy to re-use certain parts of your dataset that model the initial transaction — e.g., once you’ve worked out at what point in time your revenue should be recognized, it is easy to model first the balance sheet side of that journal and then using the same outcome to model the balance sheet release and cash flow postings. If you read on you will see what I am talking about!</p><h3>Introduction to data and model logic</h3><p>I want to dedicate this article to narrowing done the very basics to get started with Financial Modelling in KNIME.</p><p>Along the way, these basics will be applied to a very simple example.</p><p>More specifically, we will generate a Financial Modelling Pipeline that models basic Profit and Loss, Balance Sheet and Cash Flow Accounting Journal entries for this simple data set below:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtozlPiqvS7D5oucK0ceWA.png" /><figcaption>Example data.</figcaption></figure><p>The above table outlines example planning data of a company that manufactures machines for industrial use and offers maintenance services. For each planned delivery the table outlines Total Revenue, Total Cost, a Start Date, a Duration over which costs / revenues will be recognized and a Type: Either Product Sales or Service Delivery. From a logic perspective a duration of 120 means that the total amount of Revenue and Costs should be equally spread across 120 months starting with the Start Date.</p><p>So what are we going to do with this data? We will put logic in place within our workflow to generate accounting journal entries that follow double-bookkeeping practice. This means that via a range of accounting journals we will make the above transaction flow from Profit and Loss to recognize revenues costs and the consequential profit, to the Balance Sheet where we record resulting assets (Invoice to be paid by the customer) and liabilities (e.g., Invoices paid to suppliers) and finally to the Cash Flow Statement where we record expected incoming payments from invoices to customers and outgoing payments from invoices to suppliers.</p><p>The image below gives you an overview of the journals we will model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XuBUdDOM8O2SAVAd-y9nUg.png" /><figcaption>Journal entry overview.</figcaption></figure><p>When modelling our data there is one decision to make before we get started: Which of the 2 options — debit and credit — will have a negative sign and which a positive? The reason why this is a decision to be taken is that from a pure Accounting perspective, somewhat counterintuitively, credits in general are shown with a negative sign. On the assumption that the output of this model will be consumed by decision makers rather than accountants, in this model credits will be shown as positive, debits as negative. We will also take the assumption that, in general, each supplier invoice is paid 2 months after it was received and each customer invoice is paid 1 month after it was issued.</p><p>Both the example data and the journal overview will be available with the <a href="https://hub.knime.com/s/apcztNLMEyO0etpN">workflow on my KNIME Community Hub</a> — you can find the link at the bottom of this article.</p><p>Now let’s move ahead and built this workflow!</p><h3><strong>Step 1 — Reading in the data</strong></h3><p>We start simple by reading in the data. I have saved the data in .xlsx format in the “Current Workflow Data Area” — this is a folder named “data” in the Workflow folder and can read it from there with an Excel Reader:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exNdriHm4P3t_lF92YRNgg.png" /><figcaption>Step 1: Read the data.</figcaption></figure><h3>Step 2 — Adding columns for Revenue and Costing recognition</h3><p>Next we use the new Expression node to add in total four new columns to the data set. Each column will show the periodic value (Cost or Revenue divided by Duration) and we will also ensure values have the correct sign according to the logic outlined above: “pRevenues” and “pAccountsPayable” will be positive, whereas “pCostsOfGoodSold” and “pAccountsPayable” will be negative. For good measure, we round the values to two decimal places. For this, we can use one node to generate 4 expressions using the KNIME Expression language — e.g., for “pAccountsReceivable” we use this expression:</p><pre>-round($[&quot;Revenue&quot;] / $[&quot;Duration (Months)&quot;],2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vxrqRMTAlgdcz3IM0mnCqA.png" /><figcaption>Expressions in Expression node and current workflow state.</figcaption></figure><h3>Step 3 — “Explode” the data set</h3><p>Next, we want to ensure that we have one row per period that each of the original rows will generate transaction for — that is the number of months specified in the Duration (Months) column. There are different way how to achieve that — in my videos I typically used a loop — however, here I have a very simple trick: the One Row To Many node!</p><p>Simply select the column that holds the number of rows required, in our case that is column “Duration (Months)”, and this node takes care of the rest for us! If you inspect the image below closely, you will notice that the RowID column looks interesting. For each original row it has “m_” followed by a number added to it. This will come in incredibly handy in the next step as this is a sequential numbering of the rows that has been generated for an existing row.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E4u_XVTPL5S2jblpGqeiyg.png" /><figcaption>One Row to Many node — configuration and result.</figcaption></figure><h3>Step 4 — Generating the right date for each journal</h3><p>Now that we have one row for each period that revenues and costs will be recognized for, we need to determine the correct date. As mentioned above, a good starting point is a sequential numbering of the newly generated rows in step 3. This can be extracted from the end of the current RowID — more specifically we need to extract anything after the “_” — e.g. from “Row1m_2” we want to extract 2.</p><p>To do this we perform a series of transformations. There are ways to do this with potentially a node or two less, but in order to stay entirely “no code” I decided to go a slightly longer, but easier to understand way:</p><ul><li>4a) Using the RowID node to extract current RowIDs into a new column “periodNumberMapping”</li><li>4b) Using the Cell Splitter By Position node to split the newly created column “periodNumberMapping” at the 6th character to generate two new columns: “x” for the first characters that we do not need anymore and “periodNo” for the relevant part after the “_”</li><li>4c) Using Expression node to convert the number in column “periodNo” from string to integer and to deduct 1. This is to prepare for creating the correct date in the next node.</li><li>4d) Using the Date&amp;Time Shift node to shift each rows Start Date by the number in column “periodNo”. As the sequential numbering in the RowID we extracted before starts with 1, we deducted 1 already in 4c to avoid that e.g. if a Start Date was 2025–05–01 that this is shifted to 2025–06–01 in the first row.</li><li>4e) Using the Column Filter to remove columns we won’t need for next steps</li></ul><p>For brevity I did not screenshot each individual configuration dialogue. If interested, please go ahead and download the workflow linked at the bottom and inspect it node-by-node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bYIjnnAnhFGGur5wYChzzQ.png" /><figcaption>Workflow status after steps 4a-4e.</figcaption></figure><h3>Step 5 — Cash Collection and Cash Outflow Journals</h3><p>In case you have not realized it, for the journals listed as 1. for both revenue and cost, we are done! The date set is complete to the extent that we have the correct period values and the correct dates for each journal we need according to the model logic we wanted to build.</p><p>We are now close to the goal of having all journals modelled.</p><p>We branch out the workflow now — the upper branch removes all value columns except “pAccountsReceivable” and the bottom branch does the same except we keep “pAccountsPayable”. Both of these accounts, as we can see from the journal entries, will receive another posting, but with the initial sign inverted and in a different month.</p><p>In both branches, we start by determining the correct month for the next posting: The Start Date in the upper branch is shifted forward by 1 month, the Start Date in the bottom branch is shifted forward by 2 month. For sake of simplicity and brevity both values are hardcoded for now — there are different ways of how this can be handled in a more flexible manner to account, e.g., for different payment terms for different products, customer etc.</p><p>After having implemented the above we have now three nodes which hold all the journals we had to model: 4e for all initial journals to cover revenue and cost recognition, and both 5c nodes for the final journals to cover cash collection and cash outflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJfSdTEvCVWR9qfCGuyHOg.png" /><figcaption>Nodes labelled 4e and 5c hold all required journals.</figcaption></figure><h3>Step 6 — Merging data sets into one uniform data structure</h3><p>In order to finalize our pipeline and to ensure that we have all data in one final table, we start by adding a Column Renamer node to each of the 3 nodes with relevant data to rename column Start Date to “date”.</p><p>After that, we need to work towards a solution that allows us to have exactly the same column names across all three tables. The tricky part to solve here is how to deal with the columns that hold the data for the different accounts — i.e., 4e has “pRevenue”, “pCostsOfGoodsSold”, “pAccountsReceivable” and “pAccountsPayable”, but does not have Bank and 5c nodes have Bank and either “pAccountsReceivable” or “pAccountsPayable”.</p><p>To solve this we dis-aggregate or flatten all three tables by using an Unpivot node. This allows us to move the above-referenced columns into individual rows. The outcome is a a table structure that is the same across all three tables after unpivoting in that they now hold a column “ColumnNames” and a column “ColumnValues” and have more rows initially.</p><p>With all tables in the same structure we can now use Concatenate to bring them all into one table.</p><p>The last and very much cosmetic step is to do some renaming again.</p><p>ColumnNames column turns into “Account” and ColumnValues turns into “Values”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MsM0N1l7hWHhhISZ_g_dqw.png" /><figcaption>The final table now contains close to 1500 rows to capture all journals</figcaption></figure><h3>Wrapping up</h3><p>The above 6 steps outline how to create a reliable financial modelling pipeline that delivers a uniform data structure which allows for easy data consumption, e.g., via common Business Intelligence Tools. Whereas the example chosen was deliberately of low complexity, even more complex scenarios can be added by following the same principles.</p><p>If this tutorial has made you want to find out more I recommend checking out my video series on YouTube, which covers building even more functionality — saving versions, building dashboards with waterfall diagrams to dynamically analyze differences between saved versions and so on and so forth.</p><h3>Resources</h3><ul><li><a href="https://hub.knime.com/s/apcztNLMEyO0etpN">Workflow to download on the KNIME Community Hub</a></li><li><a href="https://www.youtube.com/watch?v=KumFbA_6PcY&amp;list=PL9i7OViap4WOjNT9VyXXFililZpS61JPv">Link to Video Series</a></li></ul><p>Contact for more information:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRAjew1Qicp8xLcDb_SOYQ.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKumFbA_6PcY%3Flist%3DPL9i7OViap4WOjNT9VyXXFililZpS61JPv&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKumFbA_6PcY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKumFbA_6PcY%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a4ed939af95ab776ba9ae01ffb3d13ea/href">https://medium.com/media/a4ed939af95ab776ba9ae01ffb3d13ea/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1afe790d7506" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/no-code-financial-modelling-pipelines-in-knime-1afe790d7506">No-code Financial Modelling Pipelines in KNIME</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating Report Generation and Email Distribution with KNIME — or: My Journey to becoming a…]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/automating-report-generation-and-email-distribution-with-knime-or-my-journey-to-becoming-a-a6229d3f3799?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6229d3f3799</guid>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[teaching]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Mon, 21 Oct 2024 14:06:02 GMT</pubDate>
            <atom:updated>2024-10-28T07:40:14.259Z</atom:updated>
            <content:encoded><![CDATA[<h4>DATA STORIES | DATA LITERACY | KNIME ANALYTICS PLATFORM</h4><h3>Automating Report Generation and Email Distribution with KNIME — or: My Journey to becoming a KNIME Certified Trainer!</h3><h4>Mastering workflow automation and data literacy training with KNIME</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NaLJYxD7s8GuoB2l6kG_1Q.png" /><figcaption>Reports in a corporate business setting.</figcaption></figure><p>I’ve published a fair few articles on Medium related to <a href="https://knime.com/knime-analytics-platform?utm_source=website&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=evangelism">KNIME Analytics Platform</a> before — yet this for me is a special one!</p><p>Why? Quite simple: It is the first one I publish since <a href="https://www.knime.com/certified-trainers/martin-dieste">becoming a KNIME Certified Trainer</a> and it is also the exact topic I chose for the last step to obtain the certificate: The Teaching Evaluation.</p><p>I decided to create a tutorial on my own to teach — and the topic was chosen purposefully: In my long career as a finance professional in the corporate world I lost count of the number of management reports I compiled and distributed to various stakeholders. Whereas over time things got easier and quicker — in some cases because of experience and others because of technological evolution — it always involved numbers crunching in spreadsheets, copy and pasting data into Presentations and so on and so forth.</p><p>That’s why I was really excited when I discovered the <a href="https://hub.knime.com/knime/extensions/org.knime.features.email/latest"><strong>KNIME Email Processing Extension</strong></a>, which when paired with the <a href="https://hub.knime.com/knime/extensions/org.knime.features.reporting2/latest"><strong>KNIME Reporting Extension</strong></a>, can unlock significant efficiency gains when it comes to generating reports and also distributing them via Email to your audience of stakeholders.</p><p>As the KNIME team already provides really good content on how to generate reports, I decided to focus this article on walking you through the steps you have to take to convert your data app with interactive view into either images or a PDF Report that can then be distributed via the Email Processing Extension.</p><p>If you want to learn how to create Data Apps I highly recommend this blog article:</p><p><a href="https://www.knime.com/blog/knime-reporting"><strong><em>Generate reports faster with KNIME Reporting</em></strong></a><strong><em> </em></strong>as well as this collection on <a href="https://hub.knime.com/knime/collections/First%20Steps%20with%20KNIME%20Reporting~BmSxAYmlmIJtTh7i"><strong>“First Steps with KNIME Reporting”</strong></a>:</p><p>Let’s get started!</p><h3>Requirements to follow along:</h3><p>In order to follow along, make sure to have the following installed:</p><ul><li><a href="https://www.knime.com/downloads"><strong><em>KNIME Analytics Platform 5.3x</em></strong></a></li><li><a href="https://hub.knime.com/knime/extensions/org.knime.features.email/latest"><strong><em>KNIME Email Processing Extension</em></strong></a></li><li><a href="https://hub.knime.com/knime/extensions/org.knime.features.reporting2/latest"><strong><em>KNIME Reporting Extension</em></strong></a></li></ul><h3>1. Starting with Data Apps about Finance KPIs from the KNIME for Finance space</h3><p>The KNIME Community hub provides plentiful resources either developed by the KNIME team or contributed by the highly active community. Amongst many other things it contains a space dedicated to KNIME for Finance.</p><p>Amongst the available resources is a folder containing <a href="https://hub.knime.com/knime/spaces/KNIME%20for%20Finance/KPI~XYR1s7dGhLJtvQ6F/"><strong>example Data Apps for Finance KPIs</strong></a>.</p><p>I picked the following KPIs as a starting point:</p><ul><li><a href="https://hub.knime.com/s/ykOiy1CrFCFbj_4Y"><strong>Revenue Growth</strong></a></li><li><a href="https://hub.knime.com/s/wQCtPd1-TmTg3l7n"><strong>Employee Turnover</strong></a></li><li><a href="https://hub.knime.com/s/3IMpJN9lt3vAVKe4"><strong>Customer Churn</strong></a></li></ul><p>I merged the content of all three examples into one Workflow and bundled all pre-processing steps in a metanode, that feeds the three Data Apps.</p><p>Below image illustrates the set up and shows and example of what the interactive view of the Revenue Growth Data App looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qLcr1CeU28ftkvbjObCvmA.png" /><figcaption>Workflow Starting Point.</figcaption></figure><p>What the three Data Apps have in common is the ability to interactively change the reporting year. Every time the radio button selection is changed, the data displayed will be updated dynamically.</p><h3><strong>2. Enable Reporting for data apps</strong></h3><p>The first step we must follow is to switch on reporting mode for all of our three data apps. To enable reporting for data apps, we need to navigate inside the components and go to the layout editor. This can be done by right-clicking on the data app, selecting component from the context menu and then selecting open component:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_kO0mwndDCGMPEDyeS6x6A.png" /><figcaption>Navigating inside a data app to enable reporting.</figcaption></figure><p>Once inside the component we click the open layout editor button (1) and once it has opened, we check the box for enable reporting (2) in the bottom left corner. Once the box has been checked you can click the finish button (3) and after that navigate outside of the component by clicking on the main workflow (4). This step must be repeated for all three Data Apps:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*btUhnPU3ZQJeouy9fi1Pgw.png" /><figcaption>Enable Reporting inside a Data App.</figcaption></figure><h3>3. Remove interactive elements from Data Apps</h3><p>Once reporting has been enabled for all the different components you will notice that a new blue square input port appears for each of the data apps. The corresponding node that can connect to this new reporting port is the Report Template Creator node. This node allows you to configure the page size as well as the page orientation. For this example, I’ve decided to go with a size of A4 and a landscape layout. Once we connect the report template creator node to one of our data apps, it can be executed again. In the interactive view, you can still see the three radio buttons that allow you to select the year. But if you open the preview of the newly created reporting output port, you will notice that there’s a red tag saying this view is not supported:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S7PtvaiJWVTaP-kx7qpXBQ.png" /><figcaption>First view after enabling reporting.</figcaption></figure><p>The reason for that is that the selection widget which allows us to select the year cannot be correctly displayed inside a report. This makes a lot of sense, given that a PDF report really is of static nature, whereas the interactive data apps that you can run inside of KNIME are of dynamic nature. This means that we will have to remove the selection widgets from all the data apps and move it out of them so that they are not showing up in our PDF report anymore.</p><p>To make this change, we again navigate into the different components and simply delete the selection widgets. Also, I’ve decided to just copy one of them and move it to outside of the component and inside the main workflow. Given that the flow variable name in all of the three data apps is selected-year, we can reuse one of the selection widgets to pass a flow variable inside each of the three different data apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oHH0sOH3k6rEkIang7s49Q.png" /><figcaption>Moving year selection outside of data apps.</figcaption></figure><p>After making this change when trying to execute the data apps you’ll notice that things fail because the variable selected year is not recognized. This is because by default flow variables are of local scope. That means unless we make a minor and quick change, the flow variables that live and come from the main workflow will not be recognized inside the data apps. In order to make this change, navigate back again in each of the three data apps and click on the configuration input node and open its configuration menu. You will notice that the selected year variable is in the red box to the left and all you have to do is double click it to move it to the green box on the right and then click on ok to close the configuration dialogue. After that move back to the main workflow and repeat this for all the three data apps.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OlFKmH7UKJEwF8Ux7Nd8bg.png" /><figcaption>Configuring data apps to allow flow variables from main workflow.</figcaption></figure><p>With this change done, we have finished modifying the Data Apps to be compatible with the KNIME reporting extension and if you inspect the preview again you will notice that the red text about a view that is not supported has vanished.</p><h3>4. Combine Reports from different Data Apps into one</h3><p>Now that the reports from the individual data apps are good to go we need to find a way to put them into one document. Luckily using the KNIME reporting extension this is very easy because there is a report concatenate node included. This node works very similar to the normal concatenate node that allows you to concatenate tables and you can dynamically add as many report input ports as you need. In our case we will make sure to add three and connect all of the output ports of our data apps. Once the node has been added and the data apps have been connected, open the report concatenate nodes configuration dialog and make sure to check the box “Insert page break between reports”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PiMn3akpO_RfT7Bph-GblA.png" /><figcaption>Merging individual reports into one.</figcaption></figure><h3>5. Configure Email Processing Extension and send report as individual images</h3><p>Now that the report itself is ready to go, we can move ahead with the workflow and focus on configuring the KNIME email processing extension. I will walk you through the different steps as outlined in the screenshot below in the next section of this article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lKLchMNe0JJ0ofH3UzOU3A.png" /><figcaption>EMail Processing — Set up to send report as individual images</figcaption></figure><ol><li>Setting up Email credentials: To start with, we will have to input our email account credentials. Put in the email address as user name and then your email password as password.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*SyYKpG2OQIbVimK68niSbw.png" /><figcaption>Configure Email Credentials.</figcaption></figure><p>2. Connect the credential widget flow variable to an email connector node and after that in the configuration menu go to the incoming and outgoing connection type. You can obtain the details for your IMAP server and your outgoing SMTP server from your email provider. It is very important that in the authentication section at the very bottom you click on the flow variable button and select the credentials input flow variable that was generated by the credential widget earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*6giKbdWT1DOoia7F1iLvLw.png" /><figcaption>Email Connector Configuration.</figcaption></figure><p>3. Sending Reports as individual images: Next, you can connect the email connector node to an email sender node and also add a reporting port by clicking on the plus button and connect the output port from report concatenate. Then in the configuration dialog, you can input your email addresses that you want to send to. You can give the email a subject and a message. And that’s all that needs to happen in order to send our generated reports as individual images.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/502/1*eikdGlXlwq2wsE2ivKH7MQ.png" /><figcaption>Email Sender node configuration.</figcaption></figure><p>When you now execute the email sender node, you will receive an email to your target address and this email will have various images attached to that. One image per widget or visualization in the reports.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/725/1*XdwBqak_yWBez_Q-nD7t9w.png" /><figcaption>Part of Email received.</figcaption></figure><p>Whereas this achieves our goal to send reports via email, it is not yet the ideal outcome because you lose the coherence that you would get by having a nicely formatted report in PDF format.</p><h3>6. Sending a PDF Report</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TAxdFchCTosdc0TQCDhk7A.png" /><figcaption>Workflow and configuration details to send report as PDF.</figcaption></figure><p>In order to be able to send a PDF attachment we will first have to save it locally. In order to do that we can use a create temp folder node to create a temporary folder relative to the current workflow data area. In the configuration dialog we will create a new variable pdf_report_path and give it a value pdf_report as well as a file extension .pdf.</p><p>Next, we will use the path to string (variable) node to turn this created path from a path type variable to a string type variable because that is what the report PDF writer node accepts. The input ports of the report pdf writer are connected to the path to string node as well as to the report concatenate node. We use the created string variable that contains the path to the temporary folder to define the Output location in the configuration dialogue of the Report PDF Writer Node.</p><p>After that, we connect the variable port of the report PDF writer node to a variable to table row node and in the configuration dialog, we only select the pdf_report_path variable, which is of type path. This way we get a table with just one row and one column and this column is named after the variable name. We can now grab another email sender node and connect it to the email connector node. This time around we add a table input port to our email sender node and connect it to the variable to table row node. With this new input port there is now an additional configuration option in the email sender node at the bottom which is called attachments and brackets input column. Here we select the column name pdf_ report_path which holds the location of where our pdf report was saved. If we now execute this email sender node, an email will be sent with a PDF attached. This PDF contains exactly one page for each of the three data apps that we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*jtnysviMm4xP3bpsUkrstA.png" /><figcaption>Email with Attachment.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/884/1*8ZIYt-dSrsxWMqG_nJ23mw.png" /><figcaption>Attachment Preview in Gmail.</figcaption></figure><p>And there you have it. This is how you can automate one of the probably most tedious processes that you may encounter in a finance or analyst role.</p><p>If you want me to walk you through this in a more like a live setting, then feel free to also check out my <a href="https://www.youtube.com/watch?v=3bPRB_dkzdY&amp;list=PL9i7OViap4WPTElPf6znBCHPep5hgtvcG&amp;index=1&amp;pp=gAQBiAQB"><strong>YouTube video</strong></a>, which is the actual video submission to the KNIME education team that they assessed in order to see whether they want to make me a certified trainer or not:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8VMt32mza_pp9FvKZ7e8Bg.png" /></figure><p>You can find the full workflow incl. a bonus condensed section in my space on the <a href="https://hub.knime.com/s/MpFugFPdESqnskOb"><strong>KNIME Community Hub</strong></a><strong>.</strong></p><p><strong>If you enjoyed this article the I’d appreciate your support by following me, liking my videos and subscribing to my </strong><a href="https://www.youtube.com/channel/UCEN433pXyRVFKlgwjJl0bwg?sub_confirmation=1"><strong><em>YouTube channel</em></strong></a><strong> as well as dropping me a connection request on </strong><a href="https://www.linkedin.com/in/martindieste/"><strong>LinkedIn</strong></a><strong>.</strong></p><p><strong>I’m also open for consulting and project delivery opportunities so feel free to reach out if you need help with building workflows that unleash productivity gains!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6229d3f3799" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/automating-report-generation-and-email-distribution-with-knime-or-my-journey-to-becoming-a-a6229d3f3799">Automating Report Generation and Email Distribution with KNIME — or: My Journey to becoming a…</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evaluating Large Language Models with Vision Capabilities for potential Business Use Cases]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/evaluating-large-language-models-with-vision-capabilities-for-potential-business-use-cases-6344d883a286?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6344d883a286</guid>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[vision]]></category>
            <category><![CDATA[stories]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Wed, 11 Sep 2024 08:33:03 GMT</pubDate>
            <atom:updated>2024-09-18T08:05:25.944Z</atom:updated>
            <content:encoded><![CDATA[<h4>DATA STORIES | VISION GENAI | KNIME ANALYTICS PLATFORM</h4><h4>What model works best for image description? Object recognition? Or chart reasoning?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xNZMYsGg7RnTJLMA" /><figcaption>Photo by <a href="https://unsplash.com/@dtravisphd?utm_source=medium&amp;utm_medium=referral">David Travis</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>.</figcaption></figure><h3><strong>Introduction</strong></h3><p>Technology in the large language model and AI space is evolving rapidly. Just recently there have been a few new models being released that also feature vision capability. Some of them even in sizes that can potentially run on device. I decided to take this as an opportunity to put six models through a range of tests that are designed to assess suitability for 5 specific business use cases:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ONxxq1BuiKJf3nUNTWOfnQ.png" /><figcaption>Business Use Cases.</figcaption></figure><p>As you can clearly tell the complexity and difficulty of the task is increasing from use case to use case. My overall objective was to identify whether there was a leap in performance between the older and the newer models and also to assess if any of the models were ready for production use for any of the use cases.</p><p>I’ve picked in total six models with vision capabilities. All of them have been released between Q1 2024 and Q3 2024, two are closed source, whereas the remaining four are open source. Here’s an overview of all the models that will be tested and their details:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NiLEqD3cktFcUqqQtCaXFQ.png" /><figcaption>Model Selection overview.</figcaption></figure><h3>Test Cases</h3><p>I’ve selected in total 8 images and designed certain prompts for each of them. You can see a summary of the images and the tasks below.:</p><h4>Image description</h4><ol><li><strong>Cat image:</strong> Describe what you see in this image in Detail.</li><li><strong>Dog image:</strong> Describe what you see in this image in Detail.</li></ol><h4>Object detection</h4><ol><li><strong>Crowd image: </strong>How many people are in this picture?</li><li><strong>Traffic light image: </strong>How many traffic lights are in this image? Describe their position in detail.</li></ol><h4>Text recognition</h4><ol><li><strong>Computer-written text image</strong>: Extract the text from this image verbatim.</li><li><strong>Handwritten note image:</strong> What is written on this note?</li></ol><h4>Chart recognition and reasoning</h4><ol><li><strong>Bar chart income and expenses image:</strong> Describe the chart in general. What company makes the highest profit in absolute terms? Think step-by-step.</li></ol><h4>Chart and text recognition and reasoning</h4><ol><li><strong>Scientific Research Paper (LLMs) image</strong>: Describe what this paper is about based on the text and the images. Describe in as much detail as you can and think step-by-step.</li></ol><h3>Test Setup</h3><p>I’m not a a big fan of manual work so I decided to fully automate the process of prompting the different models and collecting their results. This was also important to me as I plan to keep an eye on future developments with regards to LLMs with vision capability, which may mean putting new models through their paces as well.</p><p>I decided to build a workflow using <a href="https://www.knime.com/downloads?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME Analytics Platform</a>, which allows me to:</p><ol><li>Build a data table containing different images and their prompts</li><li>Build a data table containing the different models and their details that are relevant for prompting the APIs</li><li>Write a Python Script that contains the logic required to prompt the APIs of different model providers — this was required because as of now it appears that the very good Gen AI Integration of KNIME does not yet cover including images in prompts</li><li>Set up a nested loop that iterates over every test case and then, inside that first loop, over the list of models to prompt each model with each task one-by-one</li><li>Wrapping the Python Script that sends requests to the APIs in a Try-Catch block to ensure the process keeps running in case one of the free APIs fails because of exceeding rate limits or other reasons</li><li>Collecting the responses in a structured way in a results data table</li><li>Creating a Data App with Interactive View, which allows selection of the test case to then display the relevant image, the prompt as well as the responses of each of the models, so that I can compare them during my result analysis</li></ol><p>You can see high-level annotated overviews in the images below (numbers correspond to the bullet points above) and for good measure there’s a GIF of the Data App in action.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpx7-s0EZbAbgdAboiTyZA.png" /><figcaption>Inference Workflow overview.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_KlwaTbxFByuHZogzzZsA.png" /><figcaption>Results Analysis Workflow overview.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cTTY20lNwZeTADiO4JmCUw.gif" /><figcaption>Data App Example</figcaption></figure><h3>Summary of Results</h3><ul><li>In general, the older models tended to be more prone to hallucination and lower performance. That was especially visible already in the simpler tests like image recognition.</li><li>The two newer open source models (phi3.5-vision, Qwen2-VL) performed really well and were on par, if maybe not even better, than a closed source model that is rumored to be of similar size: GPT-4o-mini.</li><li>To no surprise, none of the smaller models managed to keep up with the very large Claude model on the highly complex tasks like chart recognition and then the combination of chart and text recognition and reasoning.</li><li>Even the largest model Claude Sonnet 3.5 still had a 10% error rate on the chart recognition and reasoning test and that’s why my conclusion is that this technology may have to still evolve a little bit further before it’s really ready for production use. That said, maybe with some more testing or prompt engineering and maybe if the images are prepared better for the task of image recognition by vision models, the performance could be even better. I will leave that for a future article or someone else to further explore for now though.</li></ul><p>Below you can find a tabular overview of my assessment of each models performance for each test. If you are interested in reviewing the data yourself in full I encourage you to download the following workflow from my profile on the KNIME Community Hub, which contains the Data App shown above:</p><blockquote>Download the workflow from the KNIME Community Hub: <a href="https://hub.knime.com/s/Oy-1dC7b-bbUVv3b">Vision Model Results</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DcFiW5TfFVYrWbPsQN4VFg.png" /></figure><p>For a very detailed review of the data I encourage you to check out the video I published on my YouTube channel:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FueDN0jsQiHE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DueDN0jsQiHE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FueDN0jsQiHE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/49f3d53f8ed323dbd8b49076eb8bf92e/href">https://medium.com/media/49f3d53f8ed323dbd8b49076eb8bf92e/href</a></iframe><p><strong>If you enjoyed this article the I’d appreciate your support by following me, liking my videos and subscribing to my YouTube channel as well as dropping me a connection request on </strong><a href="https://www.linkedin.com/in/martindieste/"><strong>LinkedIn</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lYWpn3KTFWbiUhSjLt196w.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6344d883a286" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/evaluating-large-language-models-with-vision-capabilities-for-potential-business-use-cases-6344d883a286">Evaluating Large Language Models with Vision Capabilities for potential Business Use Cases</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring the Benefits of OpenAI’s Structured Outputs in KNIME]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/exploring-the-benefits-of-openais-structured-outputs-in-knime-7849d3d0aad4?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7849d3d0aad4</guid>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[genai]]></category>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Wed, 14 Aug 2024 13:10:24 GMT</pubDate>
            <atom:updated>2024-08-19T05:44:58.579Z</atom:updated>
            <content:encoded><![CDATA[<h4>DATA STORIES | GENAI | KNIME ANALYTICS PLATFORM</h4><h4>Learn what Structured Outputs are, why they matter and see them in action in 5 use cases</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SreFfP8suSMCubTv" /><figcaption>Photo by <a href="https://unsplash.com/@colinextremis?utm_source=medium&amp;utm_medium=referral">Coline Beulin</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a>.</figcaption></figure><p>In this article, I will walk you through the recently announced feature of structured outputs by OpenAI and how it can significantly benefit various use cases in <a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME</a>.</p><p>We will explore what structured outputs are, their importance in leveraging large language models (LLMs), and practical applications within <a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME</a>.</p><h3>Understanding Structured Outputs</h3><h4>What Are Structured Outputs?</h4><p>Structured outputs allow developers to define a specific response format, known as JSON schemas, that the large language model (LLM) must follow when generating responses. For instance, if we require the LLM to always include a field labeled “key” in its response, it will consistently output the data within the specified format (using curly brackets for JSON formatting).</p><h4>Why Is This Important?</h4><p>In applications involving LLMs, take a chat application that accesses current weather data as an example, structured outputs are crucial. The LLM needs to reliably extract data from user queries (e.g., location and date) and format this information in a way that’s compatible with external APIs. Historically, achieving this level of reliability was challenging.</p><h4>Performance Improvements in Structured Outputs</h4><p>The idea of forcing a large language model to respond in a specific format is not new. Historically, the first attempts were made by simple prompt engineering but the performance was very poor. As time progressed and as models started to get fine-tuned for this use case, results improved and later on also features like JSON mode were introduced to make things like tool calling possible. The below image was taken from the OpenAI blog post about this topic. On the right hand side, you can see that the green bar in the bar chart shows 100% compliance if the new feature structured outputs is used (with strict set to true). This is a significant improvement from the early days, when models like GPT-4–0613 were only 40% or less reliable.</p><p>This new level of reliability will allow developers to use LLMs more comfortably and confidently in their applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ho71YV4lTv_5bg5y1jvjAg.png" /><figcaption>Performance development — LLMs responding in pre-defined format.</figcaption></figure><h3>Practical Use Cases in KNIME</h3><p>Since the release of the Structured Outputs feature, I’ve been trying to identify potential use cases and to implement them as minimal viable products in KNIME. And I’m happy to say that I was rather successful.</p><p>I also recorded a video and published it on my YouTube Channel — feel free to watch and subscribe, if you want to see the below use cases in action:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FmiHCPv2izIM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DmiHCPv2izIM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FmiHCPv2izIM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/760ae60640e134d39087ea0af76b59a8/href">https://medium.com/media/760ae60640e134d39087ea0af76b59a8/href</a></iframe><blockquote><a href="https://hub.knime.com/-/spaces/-/~GBQWdd9yTscPA8SA/current-state/">Download the workflow</a> showcasing the five use cases below from the KNIME Community Hub.</blockquote><h3>Use Case 1: Chat Application with Structured Outputs</h3><p>To start with, I implemented one of the examples provided in the OpenAI blog post. It’s a chat application that allows question answering. The key point here is that the answer is split into two parts. One is the final answer, and the second one is a list of reasoning steps that show exactly how the large language model produced at the final answer. It has been implemented as a data app with a composite view, and in the composite view you have input fields for things like an OpenAI API key, a model selection, a system message as well as a user query.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*GpH9K22TpZIaI_QW98Q9zg.png" /><figcaption>User Interface — Chat App that provides final answer and separate reasoning steps.</figcaption></figure><p>Once the request is sent to the API via the update button, a response is returned from the large language model in accordance with a JSON schema that requires two fields: the “answer” and the “reasoning_steps” containing the list of reasoning steps. I used the following schema inside the data app:</p><pre>response_format = {<br>    &quot;type&quot;: &quot;json_schema&quot;,<br>    &quot;json_schema&quot;: {<br>        &quot;name&quot;: &quot;reasoning_schema&quot;,<br>        &quot;strict&quot;: True,<br>        &quot;schema&quot;: {<br>            &quot;type&quot;: &quot;object&quot;,<br>            &quot;properties&quot;: {<br>                &quot;reasoning_steps&quot;: {<br>                    &quot;type&quot;: &quot;array&quot;,<br>                    &quot;items&quot;: {<br>                        &quot;type&quot;: &quot;string&quot;<br>                    },<br>                    &quot;description&quot;: &quot;The reasoning steps leading to the final conclusion.&quot;<br>                },<br>                &quot;answer&quot;: {<br>                    &quot;type&quot;: &quot;string&quot;,<br>                    &quot;description&quot;: &quot;The final answer, taking into account the reasoning steps.&quot;<br>                }<br>            },<br>            &quot;required&quot;: [&quot;reasoning_steps&quot;, &quot;answer&quot;],<br>            &quot;additionalProperties&quot;: False,<br>        }<br>    }<br>}</pre><p>The corresponding response from the LLM, provided it matches the defined response format, is parsed into the following to tables that are shown in the data app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/985/1*LTJC24lgnj8cI8cyAfuO5Q.png" /><figcaption>User Interface — Table containing Final Answer.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QpCFp-WJvAl_AO-P_wKzuw.png" /><figcaption>User Interface — Table containing reasoning steps.</figcaption></figure><p>I felt quite positive after implementing this very simple example, but I also recognized that this data app was quite rigid as it did not allow to easily modify the provided schema. That’s a weakness that I tried to remedy in my second use case.</p><h3>Use Case 2: Extracting Structured Data from Unstructured Sources</h3><p>I decided to try and build a component that is used for data processing within the workflow, rather than for interaction in a data app. I also wanted to take up the challenge of building in the flexibility to provide a custom schema that is not hard-coded into my Python code. That’s why I decided to remove the interactivity and UI offered by component composite views. Instead, the component of this second use case relies on Configuration nodes, whose settings are exposed in the component configuration dialog.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*EDl6xlwyInKwvNH-uYcpQA.png" /><figcaption>New Component — Configuration Dialogue.</figcaption></figure><p>The required inputs remain largely the same. However, in this case, there is one additional field, that is the valid JSON schema. The user can provide a schema, and the component will output a table that contains a column for each defined parameter under the “properties” object.</p><p>You may notice that the input query field containing the user query (e.g., unstructured data like text) is missing. This is because the user query with text is provided as an input table using the Table Creator node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/558/1*cNHV01cPrM2GSYcJWXp7Bw.png" /><figcaption>Synthetic data in Input Table.</figcaption></figure><p>I created the dummy data as shown in the table above and the goal was to extract the customer name, the contract value, the date and the item that was purchased. I also tried to trick the model by using different terms to refer to the contract value. For example, in the first row I referred to it as “contract price”, whereas in the second row as “contract value”. I did the same for the products that were purchased. In the first row, I referred to it as “purchased”, whereas in the second row as “product”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkK_DlWccTOLFrHVKrZ1lQ.png" /><figcaption>New Component Output.</figcaption></figure><p>After running the data through the new modified component, I was quite pleased with the outcome as it was very accurate and reliable. I was especially surprised that the dates provided were parsed in the same format, making it easy to work with it in potential downstream nodes.</p><p>As the artificial data I’ve created was very, very simplistic, I decided to use the same component again on data for the <a href="https://www.knime.com/just-knime-it">Just KNIME It Season 3 — Challenge 13</a>, where we had to extract contract data from 100 investment agreements in PDF format.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*vBgWx8oL0Ko8sPSVtcddIQ.png" /><figcaption>Input Data Excerpt — Just KNIME it Season 3 — Challenge 13.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4ewPX9m7nWBR5D1J3vY0g.png" /><figcaption>Output Data — Component used on two longer PDF documents from Just KNIME it Season 3 — Challenge 13.</figcaption></figure><p>The Structured Output feature worked again very well also on a larger corpus of documents. So I was ready to start exploring the third use case.</p><h3>Use Case 3: Workflow Routing Based on Structured Outputs</h3><p>Next, I wanted to explore the feature to constrain the values that a model can respond with, using a defined list provided in the schema. This is achieved by adding the “enum” attribute to the object defined in the JSON schema, and then providing a list of response options.</p><p>I decided to simply reuse my component from the previous example and to redefine the schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*JGbvNe4snYVmXrf4ivnpTg.png" /><figcaption>Schema with “enum” parameter which limits the response options for the attribute “documentType”.</figcaption></figure><p>I found different examples of invoices and purchase orders online from different datasets (17 in total), and I tried to make OpenAI classify them as “invoice” or “purchase orders” for me.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4uRVLenlBvErBF1oWouJyg.png" /><figcaption>Output of Document classification.</figcaption></figure><p>This worked very well and the model did not make a single error. I then used the new Expression node with the in-built <em>switch </em>function to add a new column named Routing that would show a 0 if it’s an invoice, 1 if it’s a purchase order, and 2 if it’s anything else in case the model hallucinates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HnLHgVRwp9H1wm7tnct-AA.png" /><figcaption>Routing workflow data based on LLM classification.</figcaption></figure><p>The above screenshot illustrates the rest of the workflow where I then iterated over each row inside a Chunk Loop using the routing column as a variable to define which branch a Case Switch Start node should activate. The top port leads to processing an invoice, the middle port leads to processing a purchase order, and the bottom port processes an exception in case the LLM doesn’t stick to the provided schema. The latter case did not happen a single time in this example and in all other attempts that I’ve run.</p><h3>Use Case 4: Email Categorization and Summarization</h3><p>After experimenting a fair bit with topics that I personally would not really be using, I decided to challenge myself and build something that I may actually benefit from.</p><p>I used the <a href="https://hub.knime.com/knime/extensions/org.knime.features.email/latest/">KNIME Email Processing extension</a> to connect to my YouTube channel’s Gmail account, generated some artificial emails using ChatGPT, and sent them to my Gmail account from my business account.</p><p>After fetching these emails, it occurred to me that just feeding emails that people sent to me into the OpenAI API may not be the best idea I have ever had. So from a data privacy perspective, I decided to find a solution to only send anonymized data.</p><p>Luckily, since the release of KNIME version 5.3, there is an extension available that is called <a href="https://hub.knime.com/knime/extensions/org.knime.python.features.presidio/latest/">KNIME Presidio extension</a>. And Microsoft Presidio just does that. It analyzes a corpus of input text for named entities, identifies them, and then anonymizes any of these identified named entities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C2OPYqw_xHA1JPkPN1lt8A.png" /><figcaption>Output of Presidio Analyzer.</figcaption></figure><p>Once the Presidio Analyzer identifies named entities, it can easily be connected to a Presidio Anonymizer to replace entities with placeholder values:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6xwITtvanW0zAw3X6WhWOg.png" /><figcaption>Example — original Email (left) vs. Anonymised Version (right).</figcaption></figure><p>With the data privacy concerns alleviated, I was ready to modify the schema of my data processing component and send the anonymized emails their way to OpenAI. My goal was to categorize the emails based on their content and to also extract a concise summary. I reflected these changes in the system message and in the JSON schema that I entered into the component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/815/1*7yAlAQu9jQ5TdVVbsBlBgA.png" /><figcaption>Component configuration — Email Classification and Summarization.</figcaption></figure><p>This once again worked without any errors or problems, so very quickly it was time for de-anonymization. Luckily, the Presidio extension once again makes this very easy by connecting the gray output port of the Presidio Anonymizer to the gray input port of the Presidio Deanonymizer. That is, providing the table with the anonymized data to the Deanonymizer:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VXnvAvpZvzi9gSkjBiPjFw.png" /><figcaption>Example Data after Deanonymization.</figcaption></figure><p>For future development, I’m thinking of combining this use case with use case 3, and to define certain downstream processing that is conditional on the email classification. For example, a lead could be sent to a branch that extracts customer name and contact details using this component with a different schema and then inserts it into my CRM database.</p><h3>Use Case 5: LLM Routing for Cost-Effective Query Handling</h3><p>Sticking to the pattern of increasing complexity, I decided to try if it’s possible to replicate what I’ve read a certain Python package is doing.</p><p>I’ve heard about RouteLLM, which takes the user input and assesses how difficult it is to answer the question. Then, based on that assessment, RouteLLM picks the best-suited model out of a range of options for answering the user request. Apparently, using this approach it was possible to achieve 90% of the quality of GPT-4o at only 20% of the costs. That’s what I call a very fair trade-off.</p><p>The KNIME team kindly created the <a href="https://hub.knime.com/-/spaces/-/~ddE1XymQU5P31W7z/current-state/">interface of a chat app</a> and made it available on the KNIME Community Hub. I decided to start working with that and to modify it to build in an LLM-routing logic.</p><p>Once again I was able to reuse my component from the previous examples and just to modify the system prompt and the JSON schema.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*APEUF2WMz2vlfznqXtT3Xw.png" /><figcaption>System Prompt and Schema for LLM routing.</figcaption></figure><p>I added this component inside of the chat app so that any input from a user would first be routed to GPT-4o-mini for assessment to determine which model is best suited. In the system prompt, I gave some guidance as to when to use which model. In total, I gave four model options: GPT-4o-mini as the most powerful, and then three locally hosted models, one coding model (codeqwen), one 8 bn (Llama3.1) parameter model, and then a smaller 4 bn (phi3) parameter model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3eaYmdn5QPcrJWN_RUPkkw.png" /><figcaption>Workflow Overview.</figcaption></figure><p>Here’s a brief explanation of the modifications that I made inside the chat app component. I numbered the changes I made in the screenshot above.</p><ol><li>A user request is sent for assessment to GPT-4o-mini using my component, the system prompt and schema illustrated above.</li><li>A mapping table containing model names and corresponding base URLs —i.e., standard OpenAI endpoint for GPT-4o-mini and <a href="https://www.knime.com/blog/how-to-leverage-open-source-llms-ollama">local Ollama endpoint</a> for the three locally hosted models.</li><li>The mapping table is filtered for the model chosen by GPT-4o-mini, and values are turned into flow variables.</li><li>A base_url flow variable is used to parameterize the base URL in the OpenAI Authenticator node.</li><li>A model flow variable is used to parameterize the model ID in the OpenAI Chat Model Connector node.</li><li>The user request is then fed into the Chat Model Prompter node — this sends a request to the chosen model to generate the actual response.</li><li>Combine the selected model and its AI-generated response before visualizing it to make it clear to the user, which model is providing the answer.</li></ol><p>With all these modifications working as expected, it was now time to experiment inside the chat app and to see if I could find four questions that would be routed to the four different models. The outcome can be seen in the next four images below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jPrnQYcbauTgBk3YbdgPAA.png" /><figcaption>Coding Question answered by locally hosted coding model.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J7w5G9-zlXGfi7X_v4VrSQ.png" /><figcaption>Simple Math question answered by 4b parameter model Phi3.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EiVmArGEVvshVpqtG_pXiw.png" /><figcaption>JSON Extraction handled by Llama3.1 8b model.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JsLyMkd8KJwUJ1tcDzDAnw.png" /><figcaption>Reasoning Problem solved by gpt-4o-mini.</figcaption></figure><p>I was very surprised by how well this actually worked. These questions were inspired by Matthew Berman, a YouTuber who is doing videos on large language models. He has a set of questions that he puts each model through to define and assess their performance.</p><p>My prompt engineering skills are obviously fairly limited. That said, I’m quite proud that I managed to make this work and got the routing implemented into the chat app.</p><h3>Final thoughts</h3><p>Let me conclude this article by saying that it was a lot of fun to experiment with this new feature of OpenAI and I see a lot of future potential for development considering the success I had with the five use cases above.</p><p>Let me know your thoughts and I’m also interested to hear about use cases that you might be able to build using my components.</p><h4>Resources</h4><p>You can find these demo examples on my KNIME Community Hub and I will list all other relevant links below:</p><ul><li>Demo Workflow: <a href="https://hub.knime.com/-/spaces/-/~GBQWdd9yTscPA8SA/current-state/">https://hub.knime.com/-/spaces/-/~GBQWdd9yTscPA8SA/current-state/</a></li><li>Just KNIME It S3-C13_v2: <a href="https://hub.knime.com/-/spaces/-/~UBtVCdlMWG7UGZNQ/current-state/">https://hub.knime.com/-/spaces/-/~UBtVCdlMWG7UGZNQ/current-state/</a></li><li>OpenAI Blog: <a href="https://openai.com/index/introducing-structured-outputs-in-the-api/">https://openai.com/index/introducing-structured-outputs-in-the-api/</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7849d3d0aad4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/exploring-the-benefits-of-openais-structured-outputs-in-knime-7849d3d0aad4">Exploring the Benefits of OpenAI’s Structured Outputs in KNIME</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Graph Theory and KNIME Analytics Platform to Predict the EURO 2024 Outcome]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/using-graph-theory-and-knime-analytics-platform-to-predict-the-euro-2024-outcome-8ab78a1650a4?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ab78a1650a4</guid>
            <category><![CDATA[graph-theory]]></category>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[euro2024]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[editors-pick]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Sun, 09 Jun 2024 17:37:19 GMT</pubDate>
            <atom:updated>2024-06-12T08:28:12.547Z</atom:updated>
            <content:encoded><![CDATA[<h4>DATA STORIES | SOCCER ANALYTICS | KNIME ANALYTICS PLATFORM</h4><h4>A network graph of different football clubs and national teams and the Authority Score to determine the winner</h4><p>It’s the time of the year again where a major football tournament is fast approaching. The UEFA European Football championships will kick of on June 14th with the first match between the tournament host Germany and Scotland.</p><p>It’s also that time of the year again where friends and colleagues start pestering you to join fantasy football leagues or tipping competitions in order to predict the outcomes of the different matches and to ultimately bet on who will be the winner of the tournament.</p><p>Over the years, I’ve encountered different types of players in these competitions.</p><figure><img alt="Player sterotypes" src="https://cdn-images-1.medium.com/max/801/1*wMb4FXOmPhOp4KBF5QhEeQ.png" /></figure><p>From left to right in no particular order:</p><ul><li><strong>The Intuitive Enthusiast</strong> — This person relies on their gut feeling and passion for the sport.</li><li><strong>The Stat Geek</strong> — This person uses math and statistics to make their picks.</li><li><strong>The Lucky Novice</strong> — This person has no idea what they’re doing but somehow ends up lucky.</li></ul><p>I’m part of team “Stat Geek” myself for sure and this articles goes out to all the Stat Geeks (and Lucky Novices). I am already looking forward to passionate discussions with the Intuitive Enthusiasts as to why they disagree with my predicted outcome :-).</p><h4>The Graph Theory intuition for predictions</h4><p>All joking aside — over the past years I’ve used opportunities like this to learn about approaches to predict outcomes and tried them out eventually with more successes than fails when it comes to my placement in different leagues.</p><p>This time it is no different — what is different though is the approach I am taking. I came across <a href="https://cambridge-intelligence.com/fifa-world-cup-2022-prediction/"><strong><em>this blog post</em></strong></a> on the usage of graph theory to make 2022 World Cup predictions.</p><p>The blog post shows how the connections between different football clubs and national teams (in terms of how many players of certain clubs are selected for different national teams) was used to create a network graph. For the relationships in that network graph the “eigenvector centrality” was determined for every national team to establish a ranking. For the 2018 World cup, applying this method, out of the top 5 teams with the highest eigenvector centrality, 3 ultimately made it into the semi-finals, and France as the highest ranked team won the tournament. For 2022, out of the predicted top 4 teams, three made it to the semi-finals and the highest ranked team, again France, ended up loosing to Argentina in a penalty shootout.</p><p>A pretty impressive accuracy for a method that doesn’t involve analyzing teams previous match results etc.</p><p>In this article I’m exploring if and how this can be done using a low-code approach in <a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME Analytics Platform</a>.</p><h3>Project Overview</h3><h4><strong>1. Technical Requirements</strong></h4><p>Let’s look into what we need first:</p><ol><li><a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME Analytics Platform </a>— I’m using version 5.2.3.</li><li>KNIME <a href="https://hub.knime.com/knime/extensions/org.knime.features.network/latest"><strong><em>Network Mining Extension</em></strong></a><strong><em> </em></strong>— this contains functionality to create and analyze Networks.</li><li>KNIME <a href="https://hub.knime.com/knime/extensions/org.knime.features.rest/latest"><strong><em>Rest Client Extension</em></strong></a> — we’ll grab data about the squads and matches from Wikipedia and this extensions has what we need to parse websites.</li><li>KNIME <a href="https://hub.knime.com/knime/extensions/org.knime.features.xml/latest"><strong><em>XML-Processing Extension</em></strong></a> — the website data comes in XML Format and this extension has what we need to process it to extract the data we need and to wrangle it into the right format.</li></ol><p>There might be some other “more common” extensions that need to be installed— should you decide to take a look at my workflow (linked at the end of the article), these will “pop up” and prompt you to install them when you first open the workflow. The above one’s are those that are definitely worthwhile mentioning in the context of this project.</p><h4>2. Approach: A network graph and the Authority Score to determine every match’s winner</h4><p>We first extract the players of all national teams that have qualified for the tournament, including the clubs they play for <a href="https://en.wikipedia.org/wiki/UEFA_Euro_2024_squads"><strong><em>from Wikipedia</em></strong></a><strong><em>.</em></strong></p><p>We wrangle this data into a format where we know how many players, which club sends players to which national team, and we use this data to create our network (each club and national team will represent a node, every connection from club =&gt; national team will represent an edge). The resulting Network is then analysed to determine the “Authority Score” of each team. This is a slight deviation from the approach used in the blog post above that inspired me, but the Authority Score is a metric that comes out-of-the-box with KNIME, whereas the math behind Eigenvector Centrality somewhat escaped my capabilities ;-).</p><p>In the context of this project, I’d explain Authority Score like this:</p><blockquote>“The Authority Score is like a strength rating for national football teams. It shows which teams are considered stronger based on the number of players the top clubs send to them. A higher Authority Score means a team has more players from well-known clubs, making them likely to perform better in matches.”</blockquote><p>We then sort the national teams based on their Authority Score — that’s where the other article stops and I decided to take it a step further.</p><p>We also extract the different matches of the group stage (they are all known and scheduled already), as well as the bracket for the knock-out rounds and the logic to determine which third-placed teams advance to the main round (in general, there are 24 teams that qualified; 16 advance to the main round: the first and second team of each group move on, and in addition to that, the best four teams that ranked third in their group). The source <a href="https://en.wikipedia.org/wiki/UEFA_Euro_2024"><strong><em>is Wikipedia</em></strong></a> again.</p><p>We then simulate the full tournament and use the ranking according to Authority Score to determine every match’s winner (e.g., the team that is better ranked wins).</p><p>The reason for this additional step is that, especially once we get to the knock-out rounds, it depends on the sequence of opponents how far a team makes it into the tournament — e.g., if the team that ranked 4th meets the team that ranked 2nd already in the quarter-finals because of how the draw worked out, the 4th-ranked team will not make it into the top 4.</p><h4><strong>3. What’s covered in this article</strong></h4><p>This is quite a large workflow so for brevity I will:</p><ol><li>focus on how the Network Mining Extension was used to generate &amp; analyze the network, and how I used it to visualize the knock-out bracket.</li><li>share the outcome and reveal who will be champion according to the analysis.</li><li>discuss some potential limitations of this approach.</li></ol><p>There’s also a video covering aspects like data gathering and processing in more detail so feel free to check it out below if this project “tickles your fancy” :-).</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FxcA4vEKl7XU%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DxcA4vEKl7XU&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FxcA4vEKl7XU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2eefe3fab84680dd75af00af3c0a7995/href">https://medium.com/media/2eefe3fab84680dd75af00af3c0a7995/href</a></iframe><h3>Workflow Overview: Step-by-Step</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bw3Q0WR-J21q2FrGPmaTkw.png" /><figcaption>Workflow Overview.</figcaption></figure><p>Above you can see the overall workflow, which contains various “Metanodes”, bundling a lot of the logic. Find below a high-level explanation on what is happening in sections 1 to 5:</p><h4>Section 1: Using KNIME for Data Extraction</h4><p><strong>1. Fetch Team and Squad Data</strong>:</p><ul><li><strong>Wikipedia Pages</strong>: Use the <strong>Webpage Retriever</strong> node in KNIME to pull data from the Wikipedia pages.</li><li><strong>Parsing Data</strong>: Use the <strong>XPath</strong> nodes to parse XML data and extract relevant information like team names, player lists, and their respective clubs.</li></ul><p><strong>2. Fetch Match Schedule Data</strong>:</p><ul><li><strong>Webpage Retriever</strong>: Again, use this node to fetch match schedule data.</li><li><strong>XPath Node</strong>: Extract match details, including groups, knockout stages, and tiebreaker logic.</li></ul><h4>Section 2: Creation and Analysis of the Network Graph</h4><p><strong>1. Building Nodes and Edges</strong>:</p><ul><li><strong>Data Pre-processing</strong>: Use the <strong>Column Filter</strong> and <strong>Row Filter</strong> nodes to clean and format the data.</li><li><strong>Creating Edges</strong>: With the <strong>Column Expressions </strong>node, create a new column to join club and country data, forming unique edges.</li><li><strong>Object Inserter</strong>: Define nodes (clubs and countries) and edges (player connections) to build the network graph.</li><li><strong>Network Viewer</strong>: Configure the <strong>Network Viewer</strong> node to visualize the graph, displaying node sizes and colors according to their authority scores.</li></ul><p><strong>2. Analysing the Network</strong>:</p><ul><li><strong>Network Analyzer</strong>: Calculate the authority score for each team. This score reflects a team’s strength based on the number of players from clubs.</li><li><strong>Sorting and Ranking</strong>: Use the <strong>Sorter</strong> and <strong>Row Filter</strong> nodes to rank teams based on their authority scores.</li></ul><h4>Section 3: Simulating the Tournament</h4><p>With the teams ranked by their authority scores, we simulate the tournament. For each match, the team with the higher rank is predicted to win. This method, while simplistic, provides a structured way to forecast the tournament’s outcome.</p><ol><li><strong>Group Stage Predictions</strong>: Use the <strong>Joiner</strong> node to align match schedules with team rankings. Determine third placed teams, sort them by their ranking. The top four advance. Work out which scenario applies for the four third placed teams based on which groups they come from, to determine the round of 16 match ups in the knock-out round.</li><li><strong>Knock-out Rounds</strong>: Progress through the Round of 16, quarter-finals, semi-finals, and finals by comparing team rankings.</li></ol><h4>Section 4: Consolidate matches and outcomes from all rounds</h4><p>Merge all matches including the opposing teams, their ranking and the winner according to the applied logic into one table. Write that table into Excel.</p><h4>Section 5: Results and Visualization</h4><p>Wrangle the Match Outcome dataset for the knock-out stage into a format that can be visualized in a Network View. Extract features to display the winning teams as green circles, the losing teams as red crossed and the winner of the final as yellow asterisk.</p><h3>How to use the Network Mining extension</h3><p>Let’s take a closer look at the Metanode “Create and Analyse Network” from Section 2 of the main workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5e31G9gK48vuwIjWVm5UCw.png" /><figcaption>Create and Analyse Network Metanode.</figcaption></figure><h4><strong>1. Table Reader</strong></h4><p>We start by reading the data extracted from Wikipedia using a Table Reader node. The Wikipedia data was saved after extraction as it may change so in order to ensure reproducibility of the results I opted to save it and read it back in again in this Metanode. The data contains one row for every player that was selected into a national team. As the player name does not matter in this analysis, the saved table was reduced to three columns: Country, Club and count (although count is 1 for each row).</p><h4><strong>2. GroupBy</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RDeGUMfk0JZeYLtvfeXTdw.png" /><figcaption>GroupBy Node and Configuration.</figcaption></figure><p>Next we use a GroupBy node to aggregate the data. We want to know how many players a club sends to a national team in total, so in the Configuration Dialogue we choose Country and Club columns as “Groups”, and in “Manual Aggregation” tab we add the column count using aggregation method count.</p><h4><strong>3. Column Expressions</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XWaUfCJCIGSV0YXXDsY7rQ.png" /><figcaption>Column Expressions and Configuration.</figcaption></figure><p>We send the aggregated data to a Column Expressions node. As mentioned earlier, each club and each national team will be represented as nodes in our network graph. The connections will be represented as edges. To make sure that we don’t loose the connections, we use the Column Expressions node to add a column “edgeID” which combines the Club and Country column separated by “&lt;-&gt;”. We need this column later on to create our Network Graph and also to insert features that we can visualize using the Network Viewer to the network data.</p><h4><strong>4. Network Creator &amp; Object Inserter</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*chk9FBBXCDUF50K_0RE72g.png" /><figcaption>Network Creator and Object Inserter.</figcaption></figure><p>The table containing the Node and Edge data is sent to an Object Inserter Node. The Network Creator node does not require any configuration, but it’s green-squared output port needs to connect to the Object Inserter.</p><p>The Object Inserter node will add the Nodes and Edges from our data table into the network. In the configuration Dialogue under “Node settings”, we select the appropriate column (Note: Country goes into “Second node id column” as we want to connect Club to Country). We can use the Club and Country names also as the labels for the created nodes so that it is easy to understand what node one is looking at. In the “Edge settings” section, we select the edge column and use the count column as the label. This way every connection will be labelled with the amount of players that are sent from the club to the country.</p><p>We also check the box for “Create directed Edges” to make sure it is a “one-way Street” — i.e. Clubs send players to Countries, but not the other way around. Under Weight settings we set the radio button “Column” and pick “count” from the drop down. This ensures that the number of players send from Club to Country are considered in determining the importance of each node. Et voilà — our Network Object is ready to be analysed.</p><h4><strong>5. Network Analyzer</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8dA_kKJu8YnMNpeQbQG9ig.png" /><figcaption>Network Analyser.</figcaption></figure><p>This is the node that enables us to get to the ranking of teams very quickly. In the configuration make sure to check the box for “Hubs &amp; Authority” as this makes sure the Authority Score is calculated. The output will be a value between 0 and 1, with the “best” team having the value 1. All Clubs will show a value of 0 and only the Country nodes will show a score — this is good as the clubs going forward are irrelevant for want we need to do in other steps.</p><h4><strong>6. Sorter</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dYx1UnXbJ2k2bO_xpUbPHw.png" /><figcaption>Sorter.</figcaption></figure><p>The data that is contained in the top output port from the Network Analyzer is send to a Sorter node. The nodes in the input are in no particular order so we want to change that: The Nodes should be ordered from highest to lowest Authority Score. The Sorter node does this by selecting Authority Score under Sort by and selecting Descending from the radio buttons.</p><p>In the referenced article mentioned above, that is where the simulation stopped and the prediction of top 4 / 5 teams was made. We will progress from here to simulate the tournament!</p><blockquote>In order not to spoil the outcome I’ve hidden the Node names contained in the first column for now — but I promise it is not too much longer until all will be revealed!</blockquote><h4><strong>7. Row Filter and Column Expressions</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ij_l4PFJRDqJHEFajnSp9Q.png" /><figcaption>Row Filter and Column Expressions.</figcaption></figure><p>I mentioned already that we don’t need any information on the Nodes that represent Clubs going forward. The Row Filter Node is configured to only keep rows 1–24 and to remove anything alse. Given that the table is ordered in descending order by Authority Score this makes sure we only keep the National Teams.</p><p>Then we use the Column Expressions node to do two things:</p><ol><li>Assigning a numeric rank based on the position in the table. We add a new column “rank” and use the rowIndex() formula.</li><li>Some cleaning of the Country names — later on in the tournament simulation I noticed that there are some hidden whitespace remaining from extracting the data from Wikipedia which prevented combination with the match schedules via Joiner Nodes. We “overwrite” the Object id column that contains the Country Names and use a regular Expression in the regexReplace() function to target any whitespace and to replace it with “” (nothing…).</li></ol><p>The output of the Column Expressions Node goes to the Metanode output port and is important input for the tournament simulation.</p><h4><strong>8. Size and Color Manager + Visualization Property Extractor</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ed-piMmPJbwAjaQhb12oIA.png" /><figcaption>Size and Color Manager + Visualization Property Extractor</figcaption></figure><p>The upper branch prepares the data from the Network Analyser for pretty visualisation.</p><ol><li>Size Manager Node extracts the size for Nodes based on the Authority Score and scales it up by factor 45.</li><li>Visualization Property Extractor Node is used to add this size as a new column to the data set named “scaling factor”.</li><li>The data is sent to a Color Manager Node. Based on the “scaling factor” column we can assign a color range from lowest (0 = red) to highest (45 = green).</li><li>Another Visualization Property Extractor Node is used to add this color as a new column named “color” to the dataset.</li></ol><h4><strong>9. Feature Inserter</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0FcqQrt8vnNA4Ps9zSvIQ.png" /><figcaption>Feature Inserter.</figcaption></figure><p>Now that we have extracted properties for visualization we need to insert them into the network graph object. That is the job of Feature Inserter nodes.</p><p>Features can be inserted for any Node or Edge that is part of the network graph. The color and size properties are node related — we want Nodes to differ in size and color depending on their Authority Score. So in the first two Feature Inserter nodes, we select the Object id column that contains the names of Clubs and Countries — our Nodes —, assign appropriate feature names, and select the columns that the Visualization Property Extractor nodes added to the dataset.</p><p>The last Feature Inserter node illustrates how to insert an Edge feature — the player count of each Club in terms of players send to a national team. This is somewhat redundant as we selected this already in the Object Inserter node. However, for the sake of having an Edge example, I chose to include it. The last Feature Inserter node sends the green-squared network object output port to the Metanode output.</p><p>Next, it is time to move up one level again in the Workflow to configure a Network Viewer and to reveal the strongest team according to Authority Score!</p><h3>Configuring the Network Viewer</h3><p>The last step before looking at the result of the Network Analysis is a somewhat pleasing view to configure the Network Viewer node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*58TWWUp7KfQZU-g5syasUQ.png" /><figcaption>Network Viewer Node.</figcaption></figure><p>It’s a busy configuration dialogue as we have to make selection related to all the features we have inserted previously. In the top screenshot, you see all the different register tabs of the node dialogue with arrows pointing to the tabs that need to be configured:</p><ol><li><strong>Layout Settings</strong>: The drop-down menu presents plenty of options on how to visualize the network. I found “cose” to be the best option.</li><li><strong>Node Settings:</strong> We add all our Node-visualization-related features: “label” was generated in the Object Inserter and contains the name of the Node, we use “color” for Node fill and Node outline color, and the “Size” feature to determine the Node size. I chose circle as the default shape for all nodes (we did not create a shape feature) and I played around with the font size for the Node label text.</li><li><strong>Edge Settings:</strong> We can use the count feature — I opted for the edgePlayerCount one that we added using Feature Inserter node.</li></ol><h3>Network Analysis Outcome</h3><p>Now it is time for the first drum roles. The screenshot below shows the outcome:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QUBweMTkWXAFU_9TK2ESvg.png" /><figcaption>Network Viewer.</figcaption></figure><h4>Identify the winner and the top 4 teams</h4><p>The largest and greenest Nodes are <strong>Germany </strong>and <strong>France</strong>, with a clear Edge for Germany indicating that Germany is considered the strongest team — no matter how we simulate the tournament in the next steps, this also means that Germany will be the winning team after the simulation. (Note: according to the logic that will be applied, the strongest team can’t lose to any other team).</p><p>However, it is not guaranteed that Germany will play against France in the semi-final (e.g., if due to the draw Germany and France meet earlier in the knock-out stage, France may be eliminated earlier). Other teams, pointed at with a yellow arrow above, that seem to be of somewhat similar strength, are Spain, Portugal, England, Netherlands and Italy. No surprises for me here. If you remember: The Metanode we discussed in a lot of detail also had a table with the full rankings:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2EoNHJuWEqCvrghzgwFiKg.png" /><figcaption>Rankings Table.</figcaption></figure><p>The top four teams are <strong>Germany</strong>, <strong>France</strong>, <strong>Spain </strong>and <strong>Portugal</strong>. Looking at the Authority Scores, Germany and France are not separated by a large margin. However, after that, the score starts dropping more significantly.</p><h4>Tournament simulation for Semi-finals</h4><p>Let’s see next what the outcome of the simulation is to validate if the draw may prevent any of these top four teams from advancing to the Semi-finals.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yNgvLPjcMphTlXYhpVNmeQ.png" /><figcaption>Simulation Outcome.</figcaption></figure><p>After simulating the entire tournament three out of the four top teams make it to the Semifinals — Germany, France and Portugal. Spain is unlucky and meets Germany in the Quarter Finals and is eliminated, making way for Italy, which is ranked 5th. The Screenshot above only includes a snapshot of the knock out rounds — the Concatenate node also contains the full results of every group match.</p><p>The “Visualization Tournament Bracket” metanode contains some more processing and feature inserting based on the match schedules to create the connections from one match to the next in the knock-out rounds. The output is then visualized with another Network Viewer node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*TV57j2_pVuKzRN80ma8U7Q.png" /><figcaption>Knock-out Round Development.</figcaption></figure><p>Unfortunately the “tree-like” structure is hard to see at first, however it is possible to follow each teams progress throughout the tournament by following the connections. In general, a green circle indicates that a team played a match and won to advance to the next round. Accordingly, the Teams name will also appear in the node it is connected to. A red cross indicates the Team is eliminated, and the yellow star indicates the winner of the final.</p><p>Let’s take Portugal as an example:</p><ol><li>The first Node with only one connection is green at the very bottom. The next Node is also labelled “Portugal” and is connected to a red Node “Croatia” indicating that Portugal beat Croatia in the round of 16.</li><li>The second Node indicates the outcome of the Quarter Finals match. Portugal beats the Netherlands and advances to the Semi-final (Third Node, red cross labelled Portugal)</li><li>The third Node is connected to a green Germany Node, indicating that Portugal lost the Semi-final.</li></ol><p>Not perfect, but somehow the other alternatives I explored, including the Generic ECharts combined with K-AI did not work out!</p><h3>Final thoughts</h3><p>This project has been a lot of fun and I was really surprised how much insights just the simple connections between Clubs and National teams can provide. Bear in mind that in this process not a single line of “Code” was hurt, as not a single line of code was written!</p><p>I’m admittedly pleased with the analysis outcome as I’m terribly biased — having experienced what is still known as the “German Summer Fairytale” of 2006, I’m beyond psyched for the EURO in Germany and am very aware how much it can impact a team if every single game is played in front of a home crowed.</p><p>That said, a prediction, and moreover a prediction approach is only worth as much as what reality delivers.</p><p>There’s certainly more to football tournaments than just the players that were selected and the club they usually play for and on top of that the simulation approach is used in this article is very much binary and very simplistic. That said, the results in terms of predictions using Eigenvector for 2018 and 2022 look promising, so let’s see and wait how the network analysis-based predictions hold up against reality in less than a weeks time when the first matches will be played.</p><h3>Links and references</h3><ul><li><a href="https://hub.knime.com/lowcodeaiftw/spaces/Public/Projects/EURO2024/Graph%20Theory/GraphTheory~Uyy5MKBJFrXJThty/current-state"><strong>Workflow on KNIME Hub</strong></a></li><li><a href="https://cambridge-intelligence.com/fifa-world-cup-2022-prediction/"><strong>Reference Article related to 2018 and 2022 predictions</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ab78a1650a4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/using-graph-theory-and-knime-analytics-platform-to-predict-the-euro-2024-outcome-8ab78a1650a4">Using Graph Theory and KNIME Analytics Platform to Predict the EURO 2024 Outcome</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create Your Own Python Environment with KNIME: A Step-by-Step Guide]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/how-to-create-your-own-python-environment-with-knime-a-step-by-step-guide-f91ccb9c23f1?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f91ccb9c23f1</guid>
            <category><![CDATA[conda-environment]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[conda]]></category>
            <category><![CDATA[getting-started]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Wed, 08 May 2024 06:34:58 GMT</pubDate>
            <atom:updated>2024-05-31T07:33:29.240Z</atom:updated>
            <content:encoded><![CDATA[<h4>GETTING STARTED | CONDA &amp; PYTHON | KNIME ANALYTICS PLATFORM</h4><h4>Learn how to install packages into your Python env, share that env, and play a round of Snake in KNIME</h4><p><a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME</a> is an excellent data science platform that offers plenty of functionality to conduct tasks from the realms of data wrangling to data analysis and data science — without writing a single line of code!</p><p>For advanced users it comes with a <a href="https://medium.com/low-code-for-advanced-data-science/how-to-start-using-the-python-script-node-in-production-environments-11ec15b06366">pre-bundled Python environment</a>. This environment includes packages that are useful for data visualisation, model training and even web scraping so in many case it covers all grounds without the need to worry about managing a custom Python environment or portability of workflows if shared with other users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3pvjZUSBFAikWLMGOXcXLg.png" /><figcaption>Packages included in KNIME bundled Python environment</figcaption></figure><p>But what if these packages are not enough? In this article we’ll walk through the steps to set up a custom Python environment using Conda or Miniconda by installing packages in addition to the meta packages KNIME requires <strong>on Windows</strong>.</p><p>You can also follow along this YouTube video which walks through the same process:</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F-961oWuyVHc%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D-961oWuyVHc&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F-961oWuyVHc%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9865c1b9ba1ec094d90af66cefdd2da0/href">https://medium.com/media/9865c1b9ba1ec094d90af66cefdd2da0/href</a></iframe><h3><strong>Prerequisites</strong></h3><p>Before we dive into the process of creating our own Python environment, let’s cover the prerequisites needed for KNIME. You will need to have installed two extensions:</p><ol><li><a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqbHdhd254dkQ5Q2JhaXZJSDlXQS05ekFfQ2tlQXxBQ3Jtc0ttakxoRzNqbEdsY0RTaHBKSEp1dHdPcWljbFZPUUFoaXZWWGFVZWZzWnpIaDN0VlU1TU8tZGk3WXR3bXJWT3pEVERhVTAxcm81MDJlVzV6Q212UDlVeTNnSmJGczNNNGk3UDVGSWxkUENuSGE5UUp6RQ&amp;q=https%3A%2F%2Fhub.knime.com%2Fknime%2Fextensions%2Forg.knime.features.python3.scripting%2Flatest&amp;v=-961oWuyVHc"><strong>KNIME Python Integration</strong></a>: This extension allows you to use the Python script node in KNIME.</li><li><a href="https://www.youtube.com/redirect?event=video_description&amp;redir_token=QUFFLUhqa3JuTGl6MzVWVW1CZUNDSTVLS0ZCVmp0LXdZd3xBQ3Jtc0ttd0d0YTVRdE0xYmtUc3NlTURFUjEyQkxsUVd4ZjVyZ2Z0dVdxaEljcEpiU3NMZTMxdEdFWGdMWmpYN3MwLUxoQWZ2X3QwVjg4a0RacXZZN0daQ3d6VU5RMFgtVDRGRGVrbkt4M1JXcGhLY3dLMkRvSQ&amp;q=https%3A%2F%2Fhub.knime.com%2Fknime%2Fextensions%2Forg.knime.features.conda%2Flatest&amp;v=-961oWuyVHc"><strong>KNIME Conda Integration</strong></a>: This extension enables the Conda environment propagation node, which is essential for selecting your own Conda environment.</li><li><strong>Conda or miniconda installed and configured in KNIME</strong>: This makes sure that the environment we create can later be used inside KNIME. I have covered this process in detail towards the end of my article on CrewAI which you can find <a href="https://medium.com/low-code-for-advanced-data-science/integrating-agent-frameworks-into-low-code-tools-making-crewai-work-in-knime-a7fecb042915"><strong><em>here</em></strong></a><strong><em>.</em></strong></li></ol><p><a href="https://medium.com/low-code-for-advanced-data-science/integrating-agent-frameworks-into-low-code-tools-making-crewai-work-in-knime-a7fecb042915">Integrating Agent Frameworks into Low Code Tools: Making CrewAI work in KNIME</a></p><h3><strong>How about a round of Snake?</strong></h3><p>To demonstrate how to create a custom Conda environment with additional packages, we’ll use a rather unconventional, yet (hopefully) entertaining, example: We will make the game “Snake” run in KNIME.</p><p>For this I found an implementation of the game in Python which uses the package <strong><em>“pygame”</em></strong>. Needless to say that this package is not included by default.</p><p>You can find it by following this <a href="https://www.geeksforgeeks.org/snake-game-in-python-using-pygame-module/">link</a> at the very bottom of the page.</p><p>Let’s validate this with a quick test:</p><ol><li>Grab a Python Script Node and drag it on your Workflow Canvas</li><li>Right-click the Input and Output ports and remove them</li><li>Right-click and configure the Python Script node</li><li>Delete the default code and copy &amp; paste the code from the source above</li><li>Click “Run all”</li></ol><p>Et voilà — we got ourselves a nice error proving it won’t run with a little additional effort.</p><h3><strong>Creating a Custom Conda Environment:</strong></h3><p>The <a href="https://docs.knime.com/latest/python_installation_guide/index.html#_configure_the_ap_wide_environment"><strong>KNIME Python Integration Guide</strong></a><strong> </strong>provides the documentation we need. Just below the list of packages included by default <a href="https://docs.knime.com/latest/python_installation_guide/index.html#metapackages"><strong><em>is a section</em></strong></a><strong><em> </em></strong>that covers how to create a Conda environment including the metapackages required by KNIME in addition to other packages you may need. Below is the line of code ready to copy that will create an environment named “knime_pygame” which includes the package pygame. In general you can edit the name by changing the text after the — — name and you can add any other packages at the very end after pygame.</p><pre>conda create --name knime_pygame -c knime -c conda-forge knime-python-scripting=5.2 python=3.11 pygame</pre><ol><li>Copy the code above</li><li>Go to your Windows search bar</li><li>Type “CMD” and Hit Enter</li><li>A command line / terminal window will appear</li><li>Paste the code from above and hit enter</li><li>After a while you will be asked to confirm to go ahead with the installation — type “y” and hit enter</li><li>The installation will be complete once the terminal looks like below screenshot (and you can type again). At this stage you can close the terminal window</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IxQETEr5ofwv9iHjX_5Uig.png" /><figcaption>Windows Terminal Window — status after installation of environment is complete.</figcaption></figure><h3>Using Your Custom Conda Environment in KNIME</h3><p>Now it’s time to return to your KNIME window and search for the Conda Environment Propagation node.</p><ol><li>Drag it onto your workflow canvas and right-click on it to configure.</li><li>Select the dropdown menu and search for knime_pygame, the environment you just created.</li><li>Confirm with OK</li><li>Right-click and execute the node</li><li>Once the traffic light shows green, connect the red variable port of the Conda Environment Propagation Node with the Python Script Node</li><li>Right-click the Python Script Node and Configure Flow Variables</li><li>Under “Python 3 command,” select the dropdown menu and choose the conda.environment variable.</li><li>Click OK to confirm</li></ol><h3>Let’s play some Snake!</h3><p>Let’s play some Snake!</p><ol><li>Right-click on your Python script node and select configure</li><li>In the bottom-right corner click “Run All”</li><li>A new window should appear where the Snake is running. You can navigate using arrow keys, eat fruit that spawn, and if you hit the wall, you die and your score will be displayed.</li></ol><p>You can also launch it by executing the Python Script Node — you may have to check your Windows task bar for the new window where Snake is running</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZlGPC2Y5odRj4KCvlPn2Q.png" /><figcaption>Snake running inside of KNIME!</figcaption></figure><h3>Final Remarks</h3><p>While playing Snake in KNIME might not have much practical value, this example illustrates the process of installing additional packages to your Python environment.</p><p>You can follow the same process to install other packages you may need into a custom environment and the best thing is: By using the Conda Environment Propagation node you can share your workflow confidently with other users (provided they are running Windows and have Conda set up correctly) as the environment will be automatically created when running the Workflow for the first time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f91ccb9c23f1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/how-to-create-your-own-python-environment-with-knime-a-step-by-step-guide-f91ccb9c23f1">How to Create Your Own Python Environment with KNIME: A Step-by-Step Guide</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating Agent Frameworks into Low Code Tools: Making CrewAI work in KNIME]]></title>
            <link>https://medium.com/low-code-for-advanced-data-science/integrating-agent-frameworks-into-low-code-tools-making-crewai-work-in-knime-a7fecb042915?source=rss-9d7129416df3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7fecb042915</guid>
            <category><![CDATA[editors-pick]]></category>
            <category><![CDATA[stories]]></category>
            <category><![CDATA[knime]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[agents]]></category>
            <dc:creator><![CDATA[Martin Dieste]]></dc:creator>
            <pubDate>Mon, 15 Jan 2024 16:18:54 GMT</pubDate>
            <atom:updated>2024-04-05T07:51:47.631Z</atom:updated>
            <content:encoded><![CDATA[<h4>DATA STORIES | ARTIFICIAL INTELLIGENCE | KNIME ANALYTICS PLATFORM</h4><h4>The How-To guide to get you started</h4><h3><strong>Crew AI: A Python-based AI Agent Framework</strong></h3><p>Crew AI is a framework that’s been gaining traction lately. It allows for the creation of LLM-based AI agents that direct workflows, moderate language, and act as cohesive units to tackle specific tasks. For those interested in delving deeper, I’ve provided a link to the <a href="https://github.com/joaomdmoura/crewAI">Crew AI GitHub page here.</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FvkQFgPEKLPY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DvkQFgPEKLPY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FvkQFgPEKLPY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/abe4c930f0a58e1e5443117d4368ea51/href">https://medium.com/media/abe4c930f0a58e1e5443117d4368ea51/href</a></iframe><h3><strong>Implementing Crew AI in No-Code Tools</strong></h3><p>AI Agent frameworks have the potential to add lots of value by modelling and automating mundane, manual tasks. That said this for now still requires to be able to understand and modify Python Code. To try and make tools like this more accessible I’ve integrated Crew AI into a KNIME Workflow with dedicated user interfaces for:</p><ul><li>Creating Agents</li><li>Creating Tasks</li><li>Configuring a local Language Model to be used (either locally hosted via LM Studio or alternatively by using OpenAI API)</li></ul><h4><strong>What you need:</strong></h4><p>To get started, you’ll need:</p><ul><li>Latest <a href="https://www.knime.com/knime-analytics-platform?utm_source=medium&amp;utm_medium=organic&amp;utm_term=Roberto&amp;utm_content=blog&amp;utm_campaign=com_journal">KNIME Analytics Platform</a> (I’m using version 5.2) with the <a href="https://hub.knime.com/knime/extensions/org.knime.features.python3.scripting/latest/">KNIME Python Integration</a> installed.</li><li>Your own Python environment with necessary packages (step-by-step instructions covered at the end of this Article</li><li>An OpenAI API Key or alternatively a locally hosted LLM / any other hosted LLM with an OpenAI Chat completion-like user interface</li></ul><h3><strong>Utilizing Crew AI: The Process</strong></h3><h4><strong>Information Requirements:</strong></h4><p><strong>Define Agents</strong></p><p>Open the Define Agent Component and provide:</p><ul><li>Agent Name</li><li>Agent Goal</li><li>Agent Backstory</li><li>Agent Model (only relevant if OpenAI API is used)</li></ul><p><strong>Define Tasks:</strong></p><p>Open the Define Task Component and:</p><ul><li>Ensure Input Port is connected to merged Agent output port</li><li>Provide Task Name</li><li>Provide Task Description</li><li><em>Optional</em>: include any parameters in {} — e.g. {Topic}. This will allow you to make Agent Swarms re-usable.</li><li><em>Optional:</em> Provide Parameter Value &amp; Parameter Name. This is required if a Parameter is included in the task description. Parameter Name does not need to have {} here, but make sure to reference it with {} e.g.- as {Topic} in the Task Description</li><li>Select Agent to perform the task</li></ul><h3><strong>Building a Blog Post Writer Agent Swarm and Running the Workflow</strong></h3><p>First, execute and view the “Provide Model Details” component and either provide an OpenAI API Key or the base URL of a locally hosted LLM. If you have the hardware to support it, using a software called LM Studio to run a model available on Huggingface.co — e.g. in my example shown in a YouTube video I used <a href="https://huggingface.co/TheBloke/dolphin-2.6-mistral-7B-GGUF">Dolphin 2.6 Mistral 7B provided by TheBloke</a>.</p><p>A very simple use case is to set up two agents for the task of creating a blog post:</p><p><strong>We have the following agents:</strong></p><ul><li>Blog Post Outline Creator</li><li>Blog Post writer</li></ul><p><strong>We define the following tasks:</strong></p><ul><li>Brainstorm Blog Post performed by the Blog Post Outline Creator</li><li>Write Blog Post performed by the Blog Post writer</li></ul><blockquote><strong>You can access the full example here: </strong><a href="https://hub.knime.com/lowcodeaiftw/spaces/Public/LLMs/CrewAI~lgdow45tWuhhb4fT/"><strong>KNIME Community Hub</strong></a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wR7LhqSV7CSy9al_4EV0PQ.png" /><figcaption>KNIME Workflow KNIME_CrewAI.</figcaption></figure><p>Once the agents have been set up all you need to do is to execute the Python Script node at the very end. I recommend to switch to the KNIME Classical User Interface before running the Python node so that you have access to the KNIME Console to monitor progress.</p><p>Depending on the model you are using and the size of the task, running the agent swarm may take a while. To accelerate I highly recommend, at least for the initial release, to include <strong><em>“YOU DO NOT NEED TO USE TOOLS”</em></strong> in all Agent Backstories and Task Descriptions. The current version does not support tool usage (area for future development), however the agents will still try to use tools the make up and without the additional prompt input I had certain instances where the agents did not realise tools had not been defined.</p><h3><strong>Setting Up Your Conda Environment</strong></h3><p>If you are not familiar with setting up Python environments, here’s a step-by-step guide to set up a conda environment “knime_crewai” using Miniconda:</p><ul><li><a href="https://docs.conda.io/projects/miniconda/en/latest/">Download and Install miniconda</a>: Suitable for various systems, including Windows 64</li><li><a href="https://hub.knime.com/lowcodeaiftw/spaces/Public/LLMs/CrewAI~lgdow45tWuhhb4fT/">Download environment.yml from my KNIME Community Hub</a></li><li>Open Anaconda Prompt (enter into Windows search bar)</li></ul><figure><img alt="Start Miniconda" src="https://cdn-images-1.medium.com/max/470/1*HTqNZ8F7q9HiQHreN8UhOg.png" /></figure><ul><li>Take note of base folder in the anaconda window (e.g. in this case “C:\Users\marti”. <strong><em>Navigate to this folder and copy the downloaded “environment.yml” file from step 2 into this folder</em></strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*Sx70d86juxjEXYurVQbo9Q.png" /></figure><ul><li>In the Anaconda Prompt window type: “conda env create -f environment.yml” and hit enter. This will trigger creation of an environment with all the required packages</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*Zk91Js88qHaePYYqGh-5xw.png" /></figure><ul><li>Once the environment set up is complete, enter in the same window the command: “conda activate knime_crewai”. The text in brackets on the left should switch to (knime_crewai) if environment activation was successful</li></ul><p><em>Activate the Environment:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*hSZuf0x6vqzk-5gRiOJ0dA.png" /></figure><p><em>Verify that environment has been created successfully:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*C7bbOjJ9i5su61pBTORzaA.png" /></figure><ul><li>Now open up KNIME and go to Preferences =&gt; KNIME =&gt; Python. From the three options select “conda”</li></ul><p><em>Navigate here and wait for Environment dropdown to be available:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*Ul3BLBYwQhqOuWVJ14w2IA.png" /></figure><ul><li>Wait KNIME to finish detecting conda environments on your system and then open the dropdown and select “knime_crewai”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*EcmJPSBl08pPOZ-P65VkDQ.png" /></figure><ul><li>Click “Apply and Close” and you are set to spin up your agents!</li></ul><p>And now… enjoy exploring what AI Agents can do for you 😊.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7fecb042915" width="1" height="1" alt=""><hr><p><a href="https://medium.com/low-code-for-advanced-data-science/integrating-agent-frameworks-into-low-code-tools-making-crewai-work-in-knime-a7fecb042915">Integrating Agent Frameworks into Low Code Tools: Making CrewAI work in KNIME</a> was originally published in <a href="https://medium.com/low-code-for-advanced-data-science">Low Code for Data Science</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>