Data Sources
Add an external website as a data source so agents can answer from that site’s content. Without it, an agent only knows what’s in its model and the content you give it directly. AI Hub crawls the linked website, stores the extracted text, and makes it available to any agent you attach the data source to. Chatbots use the data source through the agents they call. This grounding of answers in retrieved content is called Retrieval-Augmented Generation (RAG).
For example, point a data source at your public product documentation site so a support agent can answer questions from it.
You can add one or more websites to a data source, each as a crawl target. The crawl limits you set for the data source apply to all of its crawl targets. File-based data sources aren’t available.
Creating a Data Source
You must have the AI Hub Administrator role to create a data source.
Create a data source, set its crawl limits, and add a crawl target for each domain you want agents to draw on:
-
Click Agent Builder in the AI Hub left navigation, and then select the Data Sources tab.
-
Click New Data Source.
-
In the Details panel, enter a Name and, optionally, a Description.
To translate either field, select the desired language.
-
Set the crawl limits or keep their defaults. Each limit is required and must be greater than zero.
- Maximum Crawl Depth: The number of link levels the crawler follows, where the pages it starts from are level 1. A depth of 1 crawls only the starting pages, and a depth of 2 adds the pages they link to. The default is 3.
- Maximum Number of Links per Page: The number of links the crawler reads from each page. The crawler ignores the rest of the page’s links. The default is 1000.
- Maximum Duration: The time limit for a crawl, in seconds. It’s a total for the whole data source, not for each crawl target. The default is 86400 (24 hours).
- Maximum Unique URL Count: The total number of unique URLs a sync can visit across the whole data source, including any previously indexed pages it checks again. The default is 100000.
Reaching the Maximum Duration or the Maximum Unique URL Count can remove pages from the data source. See Syncing a Data Source before you lower either limit.

-
(Optional) Select a Frequency in the Schedule panel.
By default, syncs only run when you manually trigger them. See Scheduling Syncs for other options.
-
In the Crawl Targets panel, click New Crawl Target.
-
Fill in the New Crawl Target dialog. Only the Domain field is required.
By default, the crawler starts at the domain’s homepage and follows links to every page on the domain it can reach, within the crawl limits.
- Domain: Enter the website’s address, such as
https://learn.liferay.com. The form addshttps://if you omit it. A domain can’t include a path, so enter specific pages as Seed URLs. - Seed URLs: Optionally, enter one URL per line to determine where the crawl begins, instead of the homepage. The crawler can still follow links from these pages to any page on the domain. The form adds
https://to any URL without a prefix. - Include Paths: Optionally, enter one regular expression per line for exceptions to Exclude Paths.
- Exclude Paths: Optionally, enter one regular expression per line to identify pages that should be skipped.
Each pattern is matched against the start of a page’s path, which is the part of the URL after the domain. For example,
/w/ai-hubmatcheshttps://learn.liferay.com/w/ai-hub/data-sources. In a pattern,.*matches any characters.An invalid domain, seed URL, or pattern shows an inline error, and you can’t save the target until you correct it. To empty the fields, click Clear.
The following screenshot shows a target that starts at
https://learn.liferay.com/w/dxp, skips every page under/w/dxp/low-code/, and keeps the pages under/w/dxp/low-code/objects/.
- Domain: Enter the website’s address, such as
-
Click Save to add the target, or click Save and Add Another to add it and keep the dialog open for the next one.
The target is added to the Crawl Targets table, but it isn’t saved until you save the data source in the next step.
If you add a second target with the same domain as an existing one, the form rejects it. To crawl several sections of one website, add their seed URLs and path patterns to that website’s single crawl target.
-
Click Save in the data source form.
Saving doesn’t crawl the websites. To crawl them, sync the data source, as Syncing a Data Source describes.
Managing Crawl Targets
To change a data source’s crawl targets, click Actions (
) → View for the data source on the Data Sources tab and go to the Crawl Targets panel.
The Crawl Targets table lists each target’s Domain, Seed URLs, Include Paths, and Exclude Paths, with ten targets on each page by default.

You can search the table and edit or delete crawl targets. When deleting a single target, the target is removed without asking for confirmation. However, when deleting multiple targets together, you must confirm before they’re removed.
AI Hub saves your crawl target changes only when you save the data source, and they apply from the next sync. When you delete a target, the next sync removes the pages that target indexed.
Syncing a Data Source
A sync runs one crawl over every crawl target in the data source and stores the extracted text. The crawler identifies itself with the user agent LiferayBot and follows links only within the crawl targets’ domains. The crawler doesn’t read a site’s sitemap, so pages that no crawled page links to are missed.
At the end of each crawl, the sync rechecks every previously indexed page that the crawl didn’t reach or couldn’t load. It requests each of these pages again and removes any that return an error. Any unsuccessful response counts as an error, such as a missing page or an unavailable server. The sync also removes pages that the crawl targets now exclude or that the site blocks from crawlers. A later sync indexes a removed page again if the crawl reaches it and the page loads.
If a crawl stops because it reaches the Maximum Duration or the Maximum Unique URL Count, the sync removes any previously indexed page the crawl didn’t reach, even if the page still exists. If a crawl comes close to the Maximum Unique URL Count, the sync rechecks only as many pages as fit under the remaining count and removes the rest. When a limit stops a crawl, the Crawl Status panel still shows that the crawl succeeded with a Limit Reached label. To index the removed pages again, raise the limit and sync again.
Syncing on Demand
To start a crawl yourself, click Sync Now in the data source’s Schedule panel and confirm. AI Hub saves the data source and starts the crawl.
You can also sync without opening the data source. On the Data Sources tab, click Actions (
) → Sync Now for the data source and confirm. To follow the crawl, open the data source and check its Crawl Status panel, as Monitoring a Crawl describes.
Sync Now in the Schedule panel is unavailable while a crawl is dispatched, queued, or running. It’s also unavailable when you don’t have permission to update the data source.
Scheduling Syncs
To help keep your data current, you can schedule syncs to run automatically:
-
On the Data Sources tab, click Actions (
) → View for the data source and go to the Schedule panel. -
Select a Frequency and fill in the fields it shows:
- Manual: No other fields.
- Daily: Set a Time.
- Weekly: Set a Time and select at least one day under Repeat On.
- Monthly: Set a Time and a Day of Month from 1 to 31. In a month without the selected day, no sync runs.
- Custom: Enter a Cron Expression. The form accepts an expression with six or seven fields, where the first field is seconds. For example,
0 0 2 * * ?syncs every day at 2:00 AM.
The Time field defaults to 00:00.
-
For any frequency except Manual, select a Time Zone.
If the list includes your browser’s time zone, the field defaults to it. Otherwise, it defaults to a listed time zone with the same offset from UTC.

-
Click Save.
Monitoring a Crawl
To see a data source’s Crawl Status panel, go to the Data Sources tab and click Actions (
) → View for the data source. The panel reports on the latest crawl and refreshes while the page is open. It shows this information:
- The crawl’s status (Not Started, Dispatched, Queued, Running, Succeeded, Failed, or Abandoned)
- The Visited Pages, Indexed Pages, Failed Pages, and Content Size metrics
- The crawl’s Started and Finished dates and times
Not Started means the data source hasn’t been synced yet. Dispatched, Queued, and Running mean a crawl is in progress. Abandoned means the crawl stopped without reporting a result.
A Failed or Abandoned crawl shows an error message. If a limit stopped the crawl, the status still shows Succeeded, with a Limit Reached label and a warning. In that case, the sync removes any previously indexed pages the crawl didn’t reach, even if those pages still exist. Syncing a Data Source explains how to index those pages again.
To review the pages the data source has indexed, click View All on the Indexed Pages metric in the Crawl Status panel. The Indexed Pages page lists each page’s URL, Title, and Last Crawl Date.
If a Load More button appears, click it to load the next 50 pages. To export the whole list, click Export as CSV.
Attaching a Data Source to an Agent
When you build an agent, the agent form’s Data Sources section has an Assigned Sources field where you select one or more data sources to extend its context. At runtime, the agent queries the attached data sources with semantic search, matching on meaning rather than exact keywords, to find the most relevant content. Chatbots draw on data sources through the agents they call.
For a walkthrough of building an agent, see Building a Custom Agent.