Knowledge Studio enrichment tasks let you automatically extract business context from your schemas, standard operating procedures (SOPs), code repositories, and query logs. When you create an enrichment task, you configure target resources, knowledge signals, evaluation benchmarks, and a schedule to generate metadata proposals that ground your AI applications.
Before you begin
Follow these prerequisites before you create an enrichment task.
Understand the concepts
Before you run an enrichment task, we recommend that you familiarize yourself with the core components of the enrichment architecture:
For an overview of how Knowledge Studio agents automate metadata generation, see About enrichment tasks.
For an overview of how metadata context grounds AI agents and simplifies data exploration, see About data context.
For an overview of the Knowledge Catalog hierarchy, including entry groups, entries, aspects, and entry links, see About metadata in Knowledge Catalog.
Prepare required components
Before you create an enrichment task, ensure that your environment is properly configured for AI enrichment. For setup instructions, see Configure prerequisites for enrichment tasks.
Have the following components ready:
Service account: A dedicated user service account with the required roles. Throughout this documentation, the term execution service account refers to this customer-managed service account to differentiate it from the Google-managed Knowledge Catalog service agents. The enrichment task runs as this service account and uses it to read the sources and write to the context set.
Context set: A destination context set to save the enriched metadata to. Context sets are regional, multi-regional, or global, and each context set can be enriched by only one enrichment task per region. The context set also serves as the default source of assets to enrich; everything in the context set is enriched by default unless you filter the default resources during setup. You can also create an empty context set during the task setup if one doesn't exist. For more information, see the Create a context set section in Manage context sets.
Resources to enrich (Optional): Additional data assets that you want to enrich that are not already in your destination context set. Adding these additional resources during task creation enriches them and automatically adds them to the destination context set when the run's proposals are approved. Target resources can include BigQuery datasets and tables or Lakehouse catalogs, namespaces, and tables (up to 500 total resources across default and added resources). For information about resource name syntax, see Full resource names.
Knowledge signals (Optional): If you plan to provide the AI agent with documents, glossaries, or SQL scripts to learn from, ensure that you prepare your Cloud Storage buckets, folders, or files, format your
.jsonlevaluation datasets, or configure third-party auth providers for third-party source URLs. For third-party connector setup instructions, see Configure external connectors for enrichment tasks.Trace logs (Optional): If you plan to enable agent self-learning, configure a Gemini Enterprise application (with trace instrumentation and prompt-and-response logging turned on in Cloud Logging) or a BigQuery agent analytics table from which the enrichment agent can learn historical interactions. For more information, see Manage observability settings and the Configure agent traces for self-learning section in Configure prerequisites for enrichment tasks.
Data profiling and data insights (Recommended): To improve the quality of generated metadata proposals, enable data profiling and AI data insights on your frequently used target tables before running the task.
Required roles
Setting up and running enrichment tasks involves three identities, each requiring specific IAM roles:
- The end user (your user account): Creates, configures, and triggers the enrichment task in Knowledge Studio.
- The execution service account (customer-managed): Runs the enrichment task, reads your source assets and optional interaction traces, runs BigQuery sampling, query-history analysis, and validation query jobs, and proposes metadata updates to your context set.
- The Knowledge Catalog Service Agent (Google-managed): Impersonates your execution service account during a run and manages third-party auth provider access on your behalf.
The end user
To get the permissions that you need to create, modify, and run enrichment tasks, ask your administrator to grant you the following IAM roles:
-
Create, modify, and run enrichment tasks:
Dataplex DataScan Editor (
roles/dataplex.dataScanEditor) or Dataplex Editor (roles/dataplex.editor) on the project -
Attach the execution service account to the enrichment task:
Service Account User (
roles/iam.serviceAccountUser) on the execution service account -
(Optional) Create a new context set during task setup:
Dataplex Content Creator (
roles/dataplex.contentCreator) on the project -
(Optional) Select an execution service account from the Service account list in the Google Cloud console:
View Service Accounts (
roles/iam.serviceAccountViewer) on the project -
(Optional) Attach third-party auth provider connections to the task:
Agent Identity Admin (
roles/agentidentity.admin) on the project (or the auth provider, along with Agent Identity Viewer (roles/agentidentity.viewer) on the project to list auth providers in the Google Cloud console)
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to create, modify, and run enrichment tasks. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to create, modify, and run enrichment tasks:
-
Create, view, list, update, delete, and run enrichment tasks:
-
dataplex.agentTasks.create -
dataplex.agentTasks.get -
dataplex.agentTasks.getData -
dataplex.agentTasks.list -
dataplex.agentTasks.update -
dataplex.agentTasks.delete -
dataplex.agentTasks.run
-
-
Attach the execution service account:
iam.serviceAccounts.actAs -
(Optional) Create and list context sets in the project:
-
dataplex.entryGroups.createContextSet -
dataplex.entryGroups.list
-
-
(Optional) List service accounts in the Google Cloud console:
iam.serviceAccounts.list -
(Optional) View and configure IAM policies on third-party auth providers, and list auth providers in the project:
-
agentidentity.authProviders.get -
agentidentity.authProviders.setIamPolicy -
agentidentity.authProviders.list
-
You might also be able to get these permissions with custom roles or other predefined roles.
The execution service account
The execution service account is the customer-managed identity under which the enrichment task runs and performs all operations.
Granting query history access (recommended) lets the enrichment agent analyze
historical SQL queries (INFORMATION_SCHEMA.JOBS_BY_PROJECT) to identify common
join keys and filters. If the BigQuery Resource Viewer
(roles/bigquery.resourceViewer) role isn't granted, the agent skips
query-history analysis without failing the run.
To ensure that the execution service account has the necessary permissions to run the enrichment task, read target data, and propose metadata updates, ask your administrator to grant the following IAM roles to the execution service account:
-
Consume APIs during task execution:
Service Usage Consumer (
roles/serviceusage.serviceUsageConsumer) on the project that contains the enrichment task -
View target BigQuery datasets and tables, sample table data, and run validation checks:
BigQuery Data Viewer (
roles/bigquery.dataViewer) on the target BigQuery datasets and tables -
Run BigQuery query jobs for data sampling, query-history analysis, and validation checks:
BigQuery Job User (
roles/bigquery.jobUser) on the task project -
(Recommended) Read BigQuery query history at the project level:
BigQuery Resource Viewer (
roles/bigquery.resourceViewer) on the projects where queries run -
View target Lakehouse assets (when enriching Lakehouse assets):
BigLake Viewer (
roles/biglake.viewer) on the target Lakehouse catalogs, namespaces, and tables -
Propose and write metadata into context sets:
- Dataplex Content Editor (
roles/dataplex.contentEditor) on the target context set - Dataplex Catalog Editor (
roles/dataplex.catalogEditor) on the project - Dataplex Catalog Viewer (
roles/dataplex.catalogViewer) on the project
- Dataplex Content Editor (
-
(Optional) Read unstructured documents, evaluation datasets, or curation sets in Cloud Storage (when using Cloud Storage buckets):
Storage Object Viewer (
roles/storage.objectViewer) on the input Cloud Storage buckets -
(Optional) Automatically approve and publish proposed changes (if you enable auto-publish):
Dataplex Workflow Approver (
roles/dataplex.workflowApprover) on the project -
(Optional) Learn from existing Logging trace logs (self-learning):
Private Logs Viewer (
roles/logging.privateLogViewer) on the project that owns the Gemini Enterprise app -
(Optional) Learn from a BigQuery agent analytics table (self-learning):
- BigQuery Data Viewer (
roles/bigquery.dataViewer) on the agent analytics table (or its dataset) - BigQuery Job User (
roles/bigquery.jobUser) on the project that contains the agent analytics table
- BigQuery Data Viewer (
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to run the enrichment task, read target data, and propose metadata updates. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to run the enrichment task, read target data, and propose metadata updates:
-
Consume quota and services:
serviceusage.services.use -
View BigQuery dataset and table metadata and read table data:
-
bigquery.datasets.get -
bigquery.tables.get -
bigquery.tables.getData
-
-
Run BigQuery query jobs:
bigquery.jobs.create -
(Recommended) List BigQuery jobs for query-history analysis:
bigquery.jobs.listAll -
View Lakehouse catalogs, namespaces, and tables:
-
biglake.catalogs.get -
biglake.namespaces.get -
biglake.tables.get -
biglake.tables.list
-
-
View and propose changes to context sets and entries:
-
dataplex.entryGroups.getContextSet -
dataplex.entryGroups.requestContextChanges -
dataplex.entries.createContext -
dataplex.entries.updateContext -
dataplex.entries.deleteContext -
dataplex.entries.getContext -
dataplex.entries.listContext -
dataplex.entryLinks.create -
dataplex.entries.link -
dataplex.entryGroups.useReferenceEntryLink
-
-
Create, update, view, and list catalog entries and entry groups:
-
dataplex.entries.create -
dataplex.entries.update -
dataplex.entries.get -
dataplex.entries.list -
dataplex.entryGroups.create -
dataplex.entryGroups.update -
dataplex.entryGroups.requestChanges
-
-
(Optional) Read objects in Cloud Storage buckets:
-
storage.objects.get -
storage.objects.list
-
-
(Optional) Automatically approve change requests:
dataplex.changeRequests.use -
(Optional) Read Logging views and log entries:
-
logging.views.access -
logging.logEntries.list
-
Your administrator might also be able to give the execution service account these permissions with custom roles or other predefined roles.
The Dataplex Service Agent
The Knowledge Catalog Service Agent is a Google-managed service account that Knowledge Catalog uses to perform backend operations on your behalf, such as impersonating your execution service account during an enrichment run and granting the enrichment agent's runtime identity access to third-party auth providers.
The Knowledge Catalog Service Agent uses the following email format:
service-PROJECT_NUMBER@gcp-sa-dataplex.iam.gserviceaccount.com
Replace PROJECT_NUMBER with your Google Cloud
project number.
To ensure that the Knowledge Catalog Service Agent has the necessary permissions to impersonate the execution service account and grant the enrichment agent access to third-party auth providers, ask your administrator to grant the following IAM roles to the Knowledge Catalog Service Agent:
-
Impersonate the execution service account to run the task:
Service Account Token Creator (
roles/iam.serviceAccountTokenCreator) on the execution service account -
(Optional) Grant the enrichment agent access to third-party auth providers during a run (when connecting external sources):
Agent Identity Admin (
roles/agentidentity.admin) on the auth provider or project
For more information about granting roles, see Manage access to projects, folders, and organizations.
These predefined roles contain the permissions required to impersonate the execution service account and grant the enrichment agent access to third-party auth providers. To see the exact permissions that are required, expand the Required permissions section:
Required permissions
The following permissions are required to impersonate the execution service account and grant the enrichment agent access to third-party auth providers:
-
Generate tokens and sign payloads for service account impersonation:
-
iam.serviceAccounts.getAccessToken -
iam.serviceAccounts.getOpenIdToken -
iam.serviceAccounts.signJwt -
iam.serviceAccounts.signBlob
-
-
(Optional) Read and set IAM policies on third-party auth providers:
-
agentidentity.authProviders.getIamPolicy -
agentidentity.authProviders.setIamPolicy
-
Your administrator might also be able to give the Knowledge Catalog Service Agent these permissions with custom roles or other predefined roles.
Open the Knowledge Studio workspace
To open the task creation wizard, perform the following steps:
In the Google Cloud console, go to the Knowledge Studio page.
In the navigation pane, select Enrichments.
Click + Create enrichment task.
Name the enrichment task
In the Define pane, perform the following steps:
- In the Display name field, provide a descriptive name for the task (for
example,
Finance Dataset enrichment). - In the Task ID field, provide a unique ID or use the auto-generated ID.
In the Goal field, describe the objective of the enrichment task to guide the extraction process. Provide natural language guidance detailing the business mission and AI capability goals for this context set.
For example:
Curate and maintain the authoritative context set for the `subscription_revenue` domain. Focus on resolving metric discrepancies between `gross_sales`, `net_billed_revenue`, and `discount_applied`. Ensure all customer join keys (e.g. `customer_id`, `subscription_fk`) have explicit column documentation, and establish parameterized query templates for Monthly Recurring Revenue (MRR) and Churn Rate calculations.Click Continue.
Configure the enrichment task parameters
The scope specifies what gets enriched and what the agent reads.
In the Scope pane, perform the following steps:
In the Project field, select the project that contains the context set.
In the Context set field, select the context set that the task enriches and to which the task saves its results. If you don't have a context set, click Create new context set.
Context sets are regional, multi-regional, or global, and each context set can be enriched by only one enrichment task per region. If you select a context set that is already attached to an existing enrichment task in that region, the wizard displays an error message with a link to the existing task and requires you to select a different context set. After you create an enrichment task, you can't change its context set.
If the context set you selected is located in a multi-region (such as
usoreu) or inglobal, select a single region in the Enrichment task region field where the enrichment task runs (for example,us-central1). If the context set is located in a single region, the task automatically uses the context set's region.In the Resources to enrich section, review the default resources and optionally add more BigQuery or Lakehouse resources:
- Default resources: Everything in the selected context set is enriched by default. Expand Default resources to review or filter the prefilled tables from your context set.
- Add more BigQuery or Lakehouse resources: Add BigQuery datasets or tables or Lakehouse catalogs, namespaces, or tables that you want to enrich in addition to the context set. Adding these resources also adds them to the context set when the run's proposals are approved. An enrichment task supports up to 500 total resources across default and added resources.
Any resources you add must match the location of your context set. A multi-region context set (such as
us) matches single regions within that location (such asus-central1), and aglobalcontext set accepts resources from any region. Mismatched regions cause task creation to fail.If you select an empty context set and don't add any additional resources in this section, Knowledge Studio displays a warning. If you run the task with this configuration, it generates a semantic knowledge base based on your instructions, but it does not enrich any table entries.
To add resources by full resource name, enter the resource name in the text field (use commas to separate multiple resource names):
BigQuery table:
//bigquery.googleapis.com/projects/PROJECT_ID/datasets/DATASET_ID/tables/TABLE_IDLakehouse asset:
//dataplex.googleapis.com/projects/PROJECT_ID/locations/LOCATION/lakes/LAKE_ID/zones/ZONE_ID/assets/ASSET_ID
Alternatively, to select resources visually, perform the following steps:
- Click Browse to open the Select sources dialog.
- To select from recently used resources, click the Recent tab and select the resources that you want to add.
- To browse or search all resources, click the All tab and do the
following:
- In the Search field, enter a search term for your BigQuery or Lakehouse resource.
- In the resource tree, expand the project and dataset hierarchy to locate your resource.
- Select the checkbox beside one or more resources. You can preview the schema and details of the selected resource in the details pane.
- Click Confirm.
Optional: In the Knowledge signals section, connect the AI agent to extra sources to read for context. These resources are read-only and are not enriched.
- Cloud Storage buckets, folders, or files: Enter a bucket name,
a folder path ending with a slash (such as
bucket-name/folder/), or an individual path, or click Browse to select buckets, folders, or files (up to 1,000 Cloud Storage sources). Press Enter, comma, or Space after each entry. Glossaries: Enter the glossary name, or click Browse to search for a glossary. Press Enter, comma, or Space after each glossary name.
Ensure that any connected glossaries are located in a compatible region or
globalscope.External sources: To connect third-party platforms such as Google Workspace, Microsoft SharePoint, GitHub, or Atlassian (Confluence spaces and Jira projects), you can configure them individually or provide a YAML configuration file.
To configure sources using a YAML file:
- In the Source configuration file (optional) field, click Browse and select your YAML file.
To configure a source manually:
- Under Connected sources, click Set up next to the platform you want to configure.
- In the Source URLs field, enter the URLs for your documents, repositories, spaces, or Jira projects, and then press Enter or comma after each URL.
If the platform requires authentication (such as GitHub, Atlassian, or Microsoft), attach your credentials by doing the following:
- Click + Add connection.
- In the New connection pane, enter the full resource name of
your auth provider in the Auth provider field. Use the
following format:
projects/PROJECT_ID/locations/LOCATION/authProviders/PROVIDER_NAME - Under URI patterns, click + Add URI pattern to specify
which URLs this credential has permission to access. You can use
asterisks (
*) as wildcards (for example,https://github.com/test-org/*). - Click Done.
Google Workspace resources connect directly using your task's execution service account IAM permissions, so they don't require an auth provider connection.
- Cloud Storage buckets, folders, or files: Enter a bucket name,
a folder path ending with a slash (such as
Click Continue.
Configure evaluation and self-learning
The settings in the Improve pane are optional. For information on formatting evaluation and curation datasets, see Configure prerequisites for enrichment tasks. For information on selecting a model in Gemini Enterprise, see the "Create an agent using the flow builder" section in Design agents in Agent Studio.
In the Improve pane, perform the following steps:
Optional: In the Evaluation section, configure the following fields:
Evaluation set: To measure the impact of proposed context changes, enter a Cloud Storage URI or click Browse to select your
.jsonlfile.Curation set: To provide a set of seed questions for iterative optimization, enter a Cloud Storage URI or click Browse to select your
.jsonlfile.
Optional: In the Publishing section, specify the publishing cadence:
When you enable auto-publish, the agent stages proposals as change requests and automatically approves the run if it meets all publishing criteria, leaving an audit record. Deletion proposals are always held for manual review. When you disable auto-publish, a human reviewer must approve the change requests before they are published to the context set.
To require human review before metadata is merged into your production context set, clear the Enable auto-publish checkbox.
To automatically publish runs that meet your quality criteria, select the Enable auto-publish checkbox. Use the Auto-publish above slider to set the minimum overall confidence score required for a run to publish automatically (default is 85%). Every proposal must also pass validity checks (such as valid SQL syntax). If an evaluation dataset is configured, you can also use the Maximum quality drop slider to restrict publishing when evaluation accuracy drops by more than the specified threshold (default is 5%). If a run doesn't meet all of these conditions, all proposals remain staged as change requests for manual review.
Optional: To find gaps in real agent conversations and keep your context current, in the Self-learning section, select the Enable self-learning toggle.
Optional: If you enabled self-learning, under the Learn from section, add any of the following sources:
Gemini Enterprise apps: In the Project ID list, select the project. In the Gemini Enterprise app list, select the app generating conversation traces, and then click Done. You can add multiple Gemini Enterprise apps. To optimize enrichment and self-learning capabilities, we recommend that you specify a Gemini 3.8 Flash or later model in the Gemini Enterprise application.
BigQuery agent analytics: In the Table field, enter the name of the table containing agent chat events or click Browse to select it visually, and then click Done. You can add multiple tables.
Click Continue.
Configure the run settings
In the Run pane, perform the following steps:
In the Run as section, click the Service account list and select the execution service account that the task uses to read the sources and write to the context set.
When you select a service account, Knowledge Studio automatically runs Policy Troubleshooter to check the execution service account, the Knowledge Catalog service agent, and your target resources:
- If any required roles are missing and you have permission to modify IAM policies on those resources, click Grant all to grant the missing roles automatically.
- (Recommended) Select Grant access to BigQuery query history to
grant the BigQuery Resource Viewer (
roles/bigquery.resourceViewer) role (bigquery.jobs.listAll), and optionally specify additional project IDs in the Query history project IDs field where BigQuery queries run.
Under Trigger, select the trigger condition:
- On demand: Runs only when you click Run.
- Scheduled: Runs automatically on a repeating schedule (such as daily, weekly, or monthly). All scheduled run times use Coordinated Universal Time (UTC).
Optional: Under Notifications, click + Add recipient to specify up to five email addresses to receive a report after every run.
Verify the parameters in the Summary pane, and then click Create.
Your new enrichment task is saved. Depending on your trigger settings, the task either awaits its first scheduled execution or is ready to run immediately. Enrichment runs typically take 20 to 60 minutes to complete, or up to several hours for large datasets with curation and evaluation sets enabled. Execution logs can take 20 to 30 minutes to begin appearing while the agent initializes and extracts signals. When the task finishes an execution run, the agent queues the generated AI metadata proposals in one or more change request batches for your review.