- MUST READ: Submission requirements
- Entry form template
XM Boys
- Best Module for XM Cloud (AI Cloud Service)
XM Boys aims to leverage generative AI to provide a cloud service akin to Pages, Explorer, and Components, as part of Composable DXP. This AI platform, named Jarvis, will retrieve information from a selected template, allowing users to edit content similarly to Explorer. Moreover, a helper button, the AI Assistant, will open a prompt where users can provide context for the text field they wish to generate for their module. Users can also offer module or company context to ensure accurate results from the AI tool.
Finally, clicking the "Generate Content" button will create an item in Sitecore at the desired location. This initiative seeks to streamline content authoring and marketing efforts, providing an AI assistant for generative content, thereby saving time for users.
- Install Docker Desktop and follow the pre-requisites for XM Cloud: Walkthrough: Setting up your full-stack XM Cloud local development environment
- Install Node JS
20.10.0
- Install Node JS
20.10.0
In order to use our module, it is necessary to install 3 different solutions:
- XM Cloud starter kit
- Our Jarvis API
- Our Jarvis UI
This repository is based on the XM Cloud starter kit.
- In an ADMIN terminal:
.\init.ps1 -InitEnv -LicenseXmlPath "C:\path\to\license.xml" -AdminPassword "DesiredAdminPassword"
- Restart your terminal and run:
.\up.ps1
- Push Items
dotnet sitecore ser push
The API is created in the /src/jarvis-api
folder. Since it is an ExpressJS app, first you need to install the dependencies:
npm install
Also, this app uses a .env.local
file to get some environment variables, so duplicate the .env
file and rename it to .env.local
. To set those variables, see the configuration section.
Build the solution:
npm run build
After that, you need to run the solution by executing this command:
npm run serve
This will initialize the API app at http://localhost:3001
The UI is a separate NextJS app. To do this, go to the /src/jarvis
directory and install the dependencies:
npm install
For this project, the .env
file only contains the URL for the API app. As it is http://localhost:3001
, duplicate the .env file and rename it to .env.local
.
Finally, Build & run the solution:
npm run build
npm run start
This will initialize the UI at http://localhost:3000
Variable | Description |
---|---|
PORT | Port where the services will be running (default: 3001) |
GRAPH_QL_ENDPOINT | Endpoint for the GraphQL API (e.g., "https://xmcloudcm.localhost/sitecore/api/authoring/graphql/v1") |
GRAPH_QL_API_KEY | API key for accessing the Authoring GraphQL API |
AZURE_OPEN_AI_ENDPOINT | Endpoint for the Azure OpenAI service (e.g., "https://{your-instance}.openai.azure.com") |
AZURE_OPEN_AI_DEPLOYMENT_NAME | Name of the Azure OpenAI deployment |
AZURE_OPEN_AI_API_KEY | API key for accessing the Azure OpenAI service |
AZURE_OPEN_AI_API_VERSION | API version for the Azure OpenAI service (e.g., "2024-02-15-preview") |
- Create an Azure OpenAI Service
- Open Azure AI Studio
- Create a Deployment
- Choose
gpt-35-turbo
- Model version
0301
- Choose
For more information, refer to How To Set Up and Configure a GPT Deployment Using the Azure OpenAI Service
-
Create your SXA Component by following the steps for Cloning Rendering:
- More Info
- Go to Template Definition
- Inherit the
_Searchable on Jarvis
template fromFeature/Jarvis
feature.
-
Go to the Jarvis UI at http://localhost:3000
-
Fill in the "Please Provide a Context" field with Company Information or Component-Relevant information that needs to be used to generate the content.
- Example: "My company sells shoes. We are running a campaign to sell new shoes for 2024, targeting teenagers."
-
Name: This input will be used to give a name to the Sitecore item.
-
Select a Template: Choose the template to work with.
- Choose Parent Location where this component will be saved.
- Based on your selection, the form will be dynamically rendered according to the component's fields.
-
Fill out all the fields and use the AI Assistant for Generative AI.
- Provide contextual information about the field in the prompt.
-
Create Component Datasource.
-
Connect a component in Sitecore and connect the datasource.
-
Enjoy the rest of your day!
It is important to configure Azure Open AI properly, as well as ensuring proper network connectivity between Jarvis API, Jarvis UI, and the XM Cloud Instance (Docker containers).