Skip to content

peplau/Sitecore-GenAI

Repository files navigation

Sitecore GenAI Assistant

A Powershell-only module for XM Cloud, XP, and XM, that leverages Generative AI to create content (text and imagery), keeping the quality control under human hands.

Assets can be generated and stored in Content Hub in two ways:

  1. Asynchronously (faster): Powershell runs the text generation, while Sitecore Connect executes the image generation processing in parallel
  2. Synchronously (slower): Powershell executes both the text and image generation processing

Sitecore GenAI Assistant

  1. Prerequisites
  2. Installation
  3. Configuring the Module
  4. Usage Instructions
    1. USE CASE 1 - Editor creating content with AI
    2. USE CASE 2 - Editor improving content with AI
    3. USE CASE 3 - Moderator reviewing content in a workflow with AI

Prerequisites

Mandatory

Optional

  • Sitecore Connect for Asynchronous image generation. The module works without it, but the Synchronous generation of images makes the experience slower.
  • For a better experience with image selection with Content Hub, your XP, XM or XM Cloud must have enabled the DAM connector as described here

Installation

Sitecore GenAI Assistant is a Powershell-only Module with no binaries or executables. To start using it, all you have to do is to install the module into your Sitecore instance with a few simple steps.

The module is distributed in two flavors:

Option 1 - Using the Sitecore Package (.zip)

For a quick installation via Sitecore Package, follow the steps below:

  1. Download the latest .zip package from the Releases page;
  2. Install the package with the Sitecore Installation Wizard (In case of conflicts use the Merge/Merge option).

Option 2 - With Sitecore CLI Content Serialization (.itempackage)

To use SCS packages (.itempackage) as build artifacts in your continuous integration pipeline, install them in your delivery pipeline:

  1. Download the latest .itempackage package from the Releases page;
  2. Install the package in your delivery pipeline following this instructions.

Post-installation Steps

No matter the option selected, after installing the package, you need to sync the library with the Content Editor to make the module available for use:

  1. Open Sitecore PowerShell ISE;

  2. Go to Settings Ribbon, Rebuild All button, Sync Library with Content Editor Ribbon;

    AI Profiler Chunk in Content Editor

Configuring the Module

Mandatory Steps

  1. Open /sitecore/system/Modules/GenAI/Settings/GenAI Settings item in Content Editor;

  2. Populate the fields API Key with your OpenAI API Key and select the Model you want to use;

    OpenAI Settings

  3. Setup a new OAuth Client at your Content Hub following this instructions

  4. Populate the fields under the Content Hub Settings group:

    Content Hub Settings

    1. BaseURL - The main Base URL of your Content Hub instance - Eg: https://yourinstance.sitecoresandbox.cloud/
    2. Username & Password - A valid account with permission to create and approve assets. It is recommended to create a new account for this integration instead of using a real person account.
  5. Populate the fields under the Sitecore Connect Settings group:

    Sitecore Connect Settings

    1. Use Sitecore Connect - If this field is checked, Sitecore Connect will be used for faster-generating images asynchronously. Otherwise, Sitecore Connect is not used and images are generated synchronously, which is slower.

Optional Steps

1) Using Sitecore Connect for Asynchronous Image Generation

If the field Use Sitecore Connect is checked, you also have to follow the steps below:

  1. Download here and install the Sitecore Connect package into your Sitecore Connect instance (Read this article for details on how to install the package in Sitecore Connect), then follow the steps below:

    1. Configure the CH Symposium 2024 connection with the Content Hub OAuth information
    2. Configure the OpenAI Symposium connection with your OpenAI API Key
    3. Start the formulas Generate Image with AI and Build GraphQL Query to Save Image Field
  2. Populate the fields under the Sitecore Connect Settings group:

    1. Generate Image Endpoint - Your Sitecore Connect endpoint to the Generate Image Webhook (Eg: https://webhooks.workato.com/webhooks/rest/{yourID}/generateimage)
    2. GraphQL Base URL - The Base URL of your GraphQL Endpoint (normally the CM - Eg: https://yourcms.sitecorecloud.io/)
    3. GraphQL Client ID and GraphQL Client Secret as described here

2) Using AI to help with Content Review

The module comes with a sample workflow called Sample GenAI Content Workflow. When using this workflow, the content profiling is triggered at the Ask AI for Changes action, after the command "Reject with AI" is executed (normally by the content moderator).

Sample GenAI Content Workflow

Tip

You can easily integrate the Ask AI for Changes action in your custom workflows. To do so, copy the action to your workflow, or follow the steps below:

  1. Create a new action item under your workflow command using the template /sitecore/templates/Modules/PowerShell Console/PowerShell Script Workflow Action
  2. Point the Script field to /sitecore/system/Modules/PowerShell/Script Library/GenAI/Content Generation/Content Editor/Context Menu/GenAI/Update Content with AI

Usage Instructions

After the module is installed and configured, you will see the following scripts under the context menu in Content Editor:

GenAI folder in Content Editor

USE CASE 1 - Editor creating content with AI

The video below shows a demo of content being created with help of AI by a content editor

The following steps are shown in the video:

  1. Using Content Editor, the content author right-clicks the item where the new item is going to be created, then Scripts > GenAI > Generate Content with AI;

  2. The content author selects the template to be used in the new item creation (Eg: Page);

  3. At the Content tab, the content author fills in the fields:

    1. Force Item Name (optional) - If the field is left empty, the item name will also be generated with AI;
    2. What do you want the content to speak about?
    3. Keywords (comma-separated)
    4. Select the length - Content length to be generated (Headline, Medium or Long)
    5. Choose a tone for your text
  4. At the Template tab, the author selects the fields to populate with generated content (Text and Image fields are allowed)

After the content is generated, the video shows all text fields populated, but not the image field, which is still being populated asynchronously by Sitecore Connect. After some time, the page is refreshed and the generated image will show up.


USE CASE 2 - Editor improving content with AI

The video below shows a demo of content being improved with help of AI by a content editor

The following steps are shown in the video:

  1. Using Content Editor, the content author right-clicks the item to be improved, then Scripts > GenAI > Update Content with AI;

  2. At the Content tab, the content author fills in the fields:

    1. What do you want to change in this content?
    2. Select the length - Content length to be generated (Headline, Medium or Long)
    3. Choose a tone for your text
  3. At the Template tab, the author selects the fields to populate with generated content (Text and Image fields are allowed)


USE CASE 3 - Moderator reviewing content in a workflow with AI

The video below shows a demo of content being submitted for review by the content editor, and further being reviewed by a content moderator with the help of AI

The following steps are shown in the video:

  1. The content author submits the generated content for revision under the Sample GenAI Content Workflow

  2. Moderator opens the Workbox and reviews the content under Awaiting Approval

  3. He didn't like the generated content, so he clicks on Reject with AI

  4. At the Content tab, the moderator fills in the fields:

    1. What do you want to change in this content?
    2. Select the length - Content length to be generated (Headline, Medium or Long)
    3. Choose a tone for your text
  5. At the Template tab, the moderator selects the fields to populate. He selects the Content field only.

  6. The content is generated and immediately available for the moderator to check again. This time he likes the results, so he clicks on Approve and Publish.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published