Integrating AI Hub with Liferay DXP
Private Beta Feature
AI Hub connects a Liferay DXP instance to centralized AI agents. Configuring AI Hub requires administrative setup on the centralized AI Hub server and local configuration on your Liferay DXP instance. At a high level the flow proceeds like this:
- You start a Liferay DXP testing environment that’s exposed to the internet (e.g., using
ngrok). - Liferay adds and configures a space in the AI Hub environment for a specific customer, generates OAuth2 credentials, and enables CORS for their specific environment.
- You finish configuring Liferay DXP and begin using AI Hub.
This guide covers steps 1 and 3. Step 2 is handled by your Liferay AI Hub administrator.
Starting Liferay DXP for AI Hub
Start up a compatible Liferay DXP server that’s exposed to the internet. This guide demonstrates using ngrok:
-
Download and install ngrok.
Paid ngrok Plan RequiredYou must use a paid ngrok plan to expose your local server. The free tier intercepts traffic with a confirmation page, breaking the API calls between the services.
-
Run this command in your terminal to expose your local port:
ngrok http 8080 -
Copy the generated URL (e.g.,
https://my-customer-env.ngrok.app). -
Start the Liferay DXP Docker image. Pass the ngrok URL as the
LIFERAY_WEB_SERVER_HOSTenvironment variable to configure the web server host:docker run -it -p 8080:8080 -e LIFERAY_WEB_SERVER_HOST="https://my-customer-env.ngrok.app" liferayaihub/liferay-portal:u148-apr-06-06-49-pm -
Once Liferay DXP is running and you’ve logged in successfully, provide the Liferay AI Hub administrator the public URL to your running Liferay DXP instance.
Once the AI Hub administrator provides your user credentials and account information, you can continue setting up your local Liferay DXP instance.
Configuring the AI Hub Integration
-
Log in to your local Liferay DXP instance.
-
Open the Global Menu (
) and navigate to Control Panel → Instance Settings. -
Open the Feature Flags entry and enable the required flags if they aren’t already enabled for you.
These Release flags enable Liferay CMS:
- LPD-11235
- LPD-34594
- LPD-17564
This Developer flag has been preset in the environment. It enables AI Hub:
- LPD-62272
-
Go back to the Instance Settings main page and click AI Hub under the Platform section.
-
Enter the OAuth 2 Client ID and Client Secret provided by the administrator.
-
Enter the Service URL for AI Hub: https://ai.lxc.liferay.com/.
-
Click Save.
Once your local Liferay DXP instance is configured to work with your AI Hub SaaS account, you can begin using the built-in AI tasks and creating your own.