For the complete documentation index, see llms.txt. This page is also available as Markdown.

GenAI

Generative artificial intelligence (GenAI) can create certain types of images, text, videos, and other media in response to prompts ..

GenAI components

So does it work?

At its core, a GenAI system is built around a large language model (LLM) — a neural network trained on vast amounts of text. Through that training, it learns patterns in language: grammar, facts, reasoning styles, and how ideas connect. When you interact with it, the model isn't "looking things up" — it's generating responses based on those learned patterns.

Before the model generates anything, everything relevant gets assembled into a prompt context. This is the full picture the model sees: a system prompt (instructions defining how it should behave), your message, any documents retrieved from a knowledge source, and any results from tool calls made earlier in the conversation. The richer and more relevant this context, the better the output.

Knowledge sources extend what the model knows beyond its training data. Using a technique called RAG (Retrieval-Augmented Generation), the system searches a database or document store for content relevant to your query and injects it into the context. This is how GenAI systems can answer questions about your own documents or up-to-date information.

Tools give the model the ability to act — not just respond. During a conversation, the model can decide to call an external API, run a piece of code, or search the web. The result comes back into the context, and the model uses it to form its final answer. This loop is what makes agentic AI possible.

Finally, the inference engine takes the assembled context and generates a response token by token — each word (or part of a word) is predicted based on everything that came before it. This continues until the response is complete. The output might be plain text, structured data, or a trigger for another action.


Let's take a look at the GenAI steps availble as an EE plugin ..

  1. Start Pentaho Data Integration:

HTML Parser

The HTML Parser is a utility plugin for Pentaho Data Integration (PDI) that extracts desired text from HTML or XML files. Useful for cleaning data for natural language processing tasks like sentiment analysis and SEO keyword analysis.

  • Accepts input from both data streams and files

  • Supports parsing using Xpath expressions or CSS selectors

  • Can process single files or multiple inputs from a stream

  • Compatible with local and virtual file systems

The plugin utilizes jsoup, a Java library, that simplifies working with real-world HTML and XML. It offers an easy-to-use API for URL fetching, data parsing, extraction, and manipulation using DOM API methods, CSS, and Xpath selectors.

The step is located in the Input folder.


Select XPath or CSS Selectors as the parsing method:

XPath

XPath (XML Path Language) is a query language for selecting nodes from an XML or HTML document. While Jsoup doesn't natively support XPath, we can use a combination of Jsoup and Java's built-in XPath capabilities to achieve this.

Here's an overview of some common XPath syntax:

/ - Selects from the root node

// - Selects nodes anywhere in the document

. - Selects the current node

.. - Selects the parent of the current node

@ - Selects attributes

[] -Used for predicates (conditions)

Some examples:

  • //div - Selects all div elements in the document

  • //div[@class='content'] - Selects all div elements with class 'content'

  • //h1/text() - Selects the text content of all h1 elements

  • //div[@class='content']/p - Selects all p elements that are direct children of div elements with class 'content'


HTML Data Source


Select HTML source:

Filepath

HTML Parser - Xpath
  1. Open the following transformation.

Filepath

The data source is referenced in a path.

Linux

~/Projects/genai/html/HTML Parser - Xpath.ktr

  1. Double-click on the hp: html and configure with the following settings:

Set path to file

Leaving Xpath field blank will result in all tags being removed and all the content returned.

3. RUN and preview the results.

Results - no Xpath

These XPath queries will help you navigate and extract specific content from the homepage.html

Select the main title:

Select all navigation links:

Select all article titles (h3 elements within articles):

Select all paragraph content within articles:

Select all author names:

Select the latest news items:

Select the footer text:

Select all section titles (h2 elements that are direct children of section elements):

Select the second article:

Select all elements with a class attribute:

Last updated

Was this helpful?