# developer Data Ae - Full Documentation # Activate, Test and Configure Your Agent With your flows in place, it's time to bring your agent to life: activate, configure the necessary permission sets to secure access, and verify your agent's performance. ## 1. Activate and test 1. After you [add Actions](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-add-actions.md), click on the top right on **Activate** and **Save**. 2. Use the agent on the right side with this prompt: “Can you help me analyze the bank statement of a user?” 3. If prompted, enter the email ID of the test contact you created earlier. Refer to [Finalize Flow Retrieving File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-finalize-flow-retrieving-file-id.md). ## 2. Configure the Agent ### Add Permissions 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **Permission Sets**. 3. Click the **New** button. 4. Enter the permission set **Label**: Loan Qualification Agent. 5. Click **Save** (no other changes are needed). ### Configure Agent Access 1. Scroll down to the **Apps** section. 2. Find the **Agent Access** section. 3. Click **Edit**. 4. **Move Agent**: - Find **Loan Qualification Agent** in available agents list. - Move it to the right side (**Enabled Agents**). Alternatively, select the agent from the list and save your selection. 5. Click **Save**. ![Permission Sets](https://developer.salesforce.com/docs/media/loan-agent-permission-sets.png '{"class": "image-framed"}') ### Assign Users 1. Click **Manage Assignments**. 2. Click **Add Assignment**. 3. **Select User**: Filter the list to only see Admin Users, then select a user who has a visible Last Login date. Example: `demo-for@pronto-d25-demo.com`. 4. Click **Next**. 5. Click **Assign**. ## 3. Test the Agent on Sales Cloud Employee agents are scaled securely across your organization. Test it on your Sales Cloud. 1. From the **App Launcher**, go to **Sales**. 2. **Refresh** the page. 3. Click the **Agentforce** button (on the top of the page). 4. Your loan agent should now appear as available. 5. Enter a test query with the same test contact you created earlier. Refer to [Finalize Flow Retrieving File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-finalize-flow-retrieving-file-id.md). ![Loan Agent on Sales Cloud](https://developer.salesforce.com/docs/media/loan-agent-sales-cloud.png '{"class": "image-framed"}') # Add Actions Actions are how agents get things done. These are the tools the agent uses to do its job. [Learn more about agent actions](https://help.salesforce.com/s/articleView?id=ai.copilot_actions.htm&type=5). ## Add Action to Get Document ID from Email 1. Open your newly created topic, go to **Topic Details**, and open the **Topics’s Actions** tab. ![Create New Action](https://developer.salesforce.com/docs/media/loan-agent-create-new-action.png '{"class": "image-framed"}') 2. Click **New** → **Create New Action**. Enter action details. - **Action Type:** Flow. - Under **Reference Action**, select your flow: **Document ID from Email**. 3. Click **Next**. 4. Start to configure the agent action. - **Agent Instructions**: This action is used to identify the bank statement files associated with the contact as referred by the email address. Email address has to be given by the user. - **Loading Text:** Finding contact. 5. Under **Inputs** - Mark `contact_email` as **Required input**, and enter **Instructions**: "Ask user to enter the email address". - Leave the other listed inputs as they are, or blank or as `NA`. 6. Under **Outputs**: Check the **"Show in conversation"** checkbox for all outputs. 7. Click **Finish** ![Input-Output Configuration](https://developer.salesforce.com/docs/media/loan-agent-input-output-configuration.png '{"class": "image-framed"}') ## Add a Bank Statement Analysis Action 1. Open your newly created topic, go to **Topic Details** and open the **Topics’s Actions** tab. 2. Click **New** and then **Create New Action**. Enter action details. - **Action Type**: Flow - Under **Reference Action**, select your flow: Bank Statement Extraction 3. Click **Next**. 4. Start to configure the agent action. - **Agent Instructions:** Copy the instructions below. Replace the **Placeholder** values with those you obtained in the prerequisite steps. See [Prerequisite 1 - Create an External Client App](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-external-client-app.md) and [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-retrieve-sf-domain-url.md). - **Loading Text:** Invoking Document AI. ``` This is the action to invoke the document AI capability to extract the detailed information from the bank statements so that we can determine loan eligibility. Execute the Extract Bank Statement action with these parameters: Org_Domain: "https://Placeholder.my.salesforce.com" Client_Id: “Placeholder” Client_Secret: "Placeholder” Document_Type: “application/pdf” LLM_Model: "llmgateway__OpenAIGPT4Omni_08_06" ContentDocumentId: {get from previous action} IDPConfigId: “bank_stmt_analyzer” If Status = "Success", pass ExtractedDataJson to the analysis prompt 4. If Status = "Failed", show the ErrorMessage to the user ``` **note:** You don’t need to change anything under Inputs or Outputs. If needed, enter “NA” for mandatory fields. 5. Click **Finish**. ### Next Step [Activate, Test and Configure Your Agent](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-activate-agent.md) # Automate Resume Processing with Document AI Streamline resume analysis in Sales Cloud. By implementing the "Enrich from File" feature, your users save significant time and effort on manually reviewing and inputting resume details. This automation leverages advanced Document AI capabilities to instantly extract data from the resume, display it on a screen for review, and update the Contact record. ## In This Guide This guide provides a comprehensive step-by-step implementation of how to use Document AI and other Salesforce applications to process resumes. In this workflow, you create an "Enrich from File" feature allowing your users to enrich Contact records from attached resumes. - Adding a custom button to the Contact page in Sales Cloud. - Allowing users to automatically extract information from resume files attached to the Contact records. - Using Document AI to intelligently identify and extract key data fields such as: - Name (First and Last) - Email address - Phone number - Mailing address (Street, City, State, Country, Zip Code) - Professional summary/qualifications. - Presenting the extracted data to users for review and editing. - Updating the Contact record with the verified information. ## What Permissions Are Needed? | User Permissions Needed | | | ---------------------------------------- | -------------------- | | To create a loan prequalification agent: | System Administrator | ## Next Steps - [Before You Start](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-before-you-start.md): Set up Data 360 and retrieve the required information. - [Step 1 - Create a Document AI Configuration to Process Resumes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-document-ai-schema-config.md): Define extraction schema and test with a sample resume. - [Step 2 - Create a Prompt Template in Prompt Builder](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-prompt-template.md): Format Document AI JSON output for the flow. - [Step 3 - Create Apex Classes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-apex-classes.md): Add the invocable Apex classes for Document AI. - [Step 4 - Create the Screen Flow](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-screen-flow.md): Create a new screen flow in Flow Builder. - [Step 5 - Create Flow Elements](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-flow-elements.md): Add flow elements to get the Contact, run extraction, and update the record. - [Step 6 - Add the Flow as a Quick Action Button on Contact Page](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-add-quick-action-button.md): Add the Enrich from File button to the Contact page and test. # Before You Start ## 1. Set Up Your Salesforce Org Before you begin, verify that Data 360 is available in your org and that Einstein Generative AI is enabled. Document AI runs on Data 360 and uses models enabled through Einstein Generative AI. ### Verify Data 360 Data 360 is automatically provisioned as soon as a Data 360 license is added to your Salesforce org. However, if auto provisioning isn't available or if you’re working in a Developer Edition or sandbox org, [enable it manually](https://help.salesforce.com/s/articleView?id=data.c360_a_setup_provision.htm&type=5). ### Enable Einstein Generative AI To enable Einstein, follow the instructions under Step 2 in [Set Up Einstein Generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&type=5). ## 2. Gather Credentials Before you start the resume processing automation workflow, complete these prerequisites to gather the necessary credentials. - [Prerequisite 1 - Create and Configure an External Client App](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-external-client-app.md) - Client_Id (Customer Key): `3MVGBlahBlahBlahBlah` - Client_Secret (Customer Secret): `E3CFBlahBlah` - [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-retrieve-sf-domain-url.md) - Org_Domain: `https://your-domain.my.salesforce.com` # Before You Start ## Set Up Your Salesforce Org To use Document AI capabilities in your Salesforce org, first enable Einstein and Data 360. - To enable Einstein, follow the instructions under Step 2 in [Set Up Einstein Generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&type=5). - To enable Data 360, follow the instructions in [Turn On Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_setup_provision.htm&type=5). ## Gather Credentials Before you start the loan prequalification agent workflow, complete these prerequisites to gather the necessary credentials. - [Prerequisite 1 - Create an External Client App](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-external-client-app.md) - Client_Id (Customer Key): `3MVGBlahBlahBlahBlah` - Client_Secret (Customer Secret): `E3CFBlahBlah` - [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-retrieve-sf-domain-url.md) - Org_Domain: `https://your-domain.my.salesforce.com` # Before You Start Before you can ground Agentforce in visual data, activate several Salesforce platforms. These platforms provide product catalog management, AI capabilities, and agent functionality. These essential building blocks help create personalized, data-driven agent conversations. Complete these steps to prepare your org for the implementation. ## Enable Data 360 Data 360 powers the indexing and retrieval infrastructure that transforms your visual content into searchable, structured data for your agent. Verify and enable it for your Salesforce org. 1. Go to **Data Cloud Setup**. 2. If you see a **Get Started** button, click it and wait for the process to finish. This can take up to ten minutes. ## Turn On Einstein Einstein powers the AI capabilities that enable Agentforce to understand, reason, and respond intelligently to customer questions. By turning on Einstein, you activate the foundational AI services that support semantic search, natural language understanding, and intelligent recommendations to ground your agent in complex visual data. 1. Go to **Setup**. 2. In the quick find box, find and select **Einstein Setup**. 3. Click **Turn On Einstein**. ## Turn On Agentforce Agentforce is Salesforce's enterprise agentic AI platform that helps you build, deploy, and manage autonomous AI agents at scale. When you turn on Agentforce, you enable your org to create agents. 1. Go to **Setup**. 2. In the quick find box, find and select **Agentforce Agents**. 3. Turn on **Agentforce**. **note:** Refresh the page if you don't see your Agentforce agents. ## Next Steps - [Step 1: Strategize Your Visual Data Upload](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-strategize-visual-data.md): Plan the types, structure, and location of the visual data you will ingest. # Build a Loan Prequalification Agent with Document AI Build a loan prequalification Employee Agent with Data 360 Document AI. This agentic setup automatically extracts complex bank statement data to provide an easily understandable output, boosting employee productivity. Watch a demo on how to use Document AI to ingest a PDF into an employee agent. ::video{src="https://developer.salesforce.com/docs/ai/loan-agent/guide/Q5rq7EJBmnXv8CLqoP9tyw" title="Build a Loan Prequalification Employee Agent with Document AI" type="vidyard"} ## Simple Prompt-Driven AI Agent For bank employees, processing a constant stream of heavy customer documentation is often a grueling, manual hurdle. Repetitively going through complex records for every individual customer consumes valuable time and increases the risk of error. By leveraging Document AI, you can transform these manual workflows into automated tasks. Using natural language processing to handle repetitive extraction and analysis, your team can move past the paperwork and focus on high-value banking, letting the technology handle the heavy lifting for every customer. The loan prequalification agent is set up to: - Use Data 360 Document AI for data extraction - Analyze bank statements attached to contact records in Salesforce - Use AI prompts for financial analysis without complex code - Provide loan recommendations through a chat interface ## How Does It Work? ``` ┌─────────────────────────────────────┐ │ STEP 1: Employee Provides Email │ │ - Types customer email in chat │ └─────────────────┬───────────────────┘ │ ↓ ┌─────────────────────────────────────┐ │ STEP 2: Find Contact & File │ │ - Flow finds Contact by email │ │ - Gets ContentDocumentId │ └─────────────────┬───────────────────┘ │ ↓ ┌─────────────────────────────────────┐ │ STEP 3: Extract Data (Apex) │ │ - Authenticate via OAuth │ │ - Call Data 360 Document AI │ │ - Generate schema │ │ - Extract structured data │ │ - Return clean JSON │ └─────────────────┬───────────────────┘ │ ↓ ┌─────────────────────────────────────┐ │ STEP 4: Analyze (AI Prompt) │ │ - Calculate income from JSON │ │ - Detect EMIs and debts │ │ - Calculate DTI ratio │ │ - Assess risk factors │ │ - Generate loan recommendation │ └─────────────────┬───────────────────┘ │ ↓ ┌─────────────────────────────────────┐ │ STEP 5: Display Results │ │ - Show analysis in chat │ │ - Allow employee to override │ └─────────────────────────────────────┘ ``` ## What Permissions Are Needed? | User Permissions Needed | | | ---------------------------------------- | -------------------- | | To create a loan prequalification agent: | System Administrator | ## Next Steps - [Before You Start](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-before-you-start.md): Complete prerequisites to gather and save the information required for the next steps. - [Step 1 - Create a Document AI Schema Config](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-document-ai-schema-config.md): Set up the Data 360 Document AI processor configuration for bank statement data extraction. - [Step 2 - Create Flow to Retrieve File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-to-retrieve-file-id.md): Create a screen flow to identify the bank statement file from the customer's email address. - [Step 3 - Create Apex Class (Document AI API Wrapper)](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-apex-class.md): Create custom Apex class to enable Document AI's flow functionality. - [Step 4 - Create Bank Statement Extraction Flow (Apex Wrapper)](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-bank-statement-extraction.md): Create a screen flow to extract data from the customer's bank statement. - [Step 5 - Create the Loan Prequalification Employee Agent](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-loan-prequalification-agent.md): Build your agent. # Complete Document AI Schema Configuration (For Reference Only) After you create a Document AI processor configuration for bank statement extraction, Data 360 Document AI returns data in this format. Use this as starting point for additional use cases. See more [Document AI example schemas](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai_schema_ref.htm&type=5). ```JSON { "account_holder_name": "string", "account_holder_address": "string (multi-line with \\n)", "branch_address": "string", "city": "string", "state": "string", "phone_no": "string", "currency": "string (e.g., INR, USD)", "email": "string", "other_account_open_date": "string (DD/MM/YYYY)", "Monthly salary": "string (e.g., '85,000.00')", "home_loan_taken": true, "auto_loan_taken": false, "transactions": [ { "date": "string (DD/MM/YY)", "transaction_description": "string", "reference_number": "string or null", "value_date": "string (DD/MM/YY)", "withdrawal": null, "deposit": null, "balance": 0 } ] } ``` ## Field Descriptions See detailed descriptions and examples for each primary fields in the document schema configuration. | Field Name | Type | Description | Example | | ----------------------- | ------- | -------------------- | ------------------------------ | | account_holder_name | string | Customer name | "Sumit Sharma" | | account_holder_address | String | Multi-line address | "TECH SOLUTIONS\n2ND FLOOR..." | | branch_address | String | Bank branch location | "KASTURI UDYOG, SHOP NO 45..." | | city | String | City name | "Mumbai" | | state | String | State/Province | "MAHARASHTRA" | | phone_no | String | Contact number | "022-61606161" | | currency | String | Currency code | "INR", "USD" | | email | String | Email address | "example@gmail.com" | | other_account_open_date | String | Account opening date | "22/04/2016" | | Monthly salary | String | Pre-extracted salary | "85,000.00" | | home_loan_taken | boolean | Has home loan? | true/false | | auto_loan_taken | boolean | Has auto loan? | true/false | | transactions | Array | List of transactions | See below | ## Transaction Object Schema The `transaction` array contains the objects detailing the financial activity in the bank statement, defined by the following fields. | Field | Type | Description | | ----------------------- | ----------- | --------------------------- | | date | String | Transaction date (DD/MM/YY) | | transaction_description | String | Description/narration | | reference_number | String/Null | Transaction reference | | value_date | String | Value date (DD/MM/YY) | | withdrawal | Number/Null | Debit amount | | deposit | Number/Null | Credit amount | | balance | Number | Running balance | ## Next Step - [Step 2 - Create Flow to Retrieve File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-to-retrieve-file-id.md): Create a screen flow to identify the bank statement file from the customer's email address. # Create Flow Element to Get Contact ID from Email Address A Flow Builder element represents an action that a flow can execute. Create an element to retrieve the Contact ID from the user’s email address, allowing the agent to surface relevant information. ## 1. Create the Element 1. On the flow you created in [Step 2 - Create Flow to Retrieve File ID](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-to-retrieve-file-id.md), click the **+** button, search and select the **Get Records** element. 2. Configure the **Get Records** element: - **Label**: `Get Contact ID from Email Address` - **Get Records for This Object**: - Select **Salesforce Object** as **Data Source**. - For the **Object** field, search and select **Contact**. 3. Under **Filter Contact Records**, enter the condition values: - **Field**: Email - **Operator**: Equals - **Value**: +New Resource: - **Resource Type**: Variable - **API Name**: `contact_email` - **Data Type**: Text - Under **Availability Outside the Flow**, check the **Available for input** and **Available for output** checkboxes. - Click **Done**. 4. Under **Sort Contact Records**: - **Sort Order**: Descending - **Sort By**: `SystemModstamp` 5. Under **How to Store Record Data**: - Select **Choose fields and assign variables (advanced)**. - Under **Where to Store Field Values**, select **In separate variables**. 6. Under **Select Variables to Store Contact Fields**: - **Field**: ID - **Variable**: New Resource - **Resource Type**: Variable - **API Name**: `contact_ID` - **Data Type**: Text - Under **Availability Outside the Flow**, check the **Available for input** and **Available for output** checkboxes. - Click **Done**. ![Element 1](https://developer.salesforce.com/docs/media/loan-agent-step-2-1.png '{"class": "image-framed"}') ## 2. Save Flow Configuration 1. Click **Save** on the top right and enter values in the flow saving modal fields. 2. The flow saving modal opens. For **Flow Label** enter `Document ID from Email`. 3. Click **Show Advanced** to open advanced settings. 4. Under **How to Run the Flow**, select **System Context Without Sharing–Access All Data**. 5. Click **Save**. ## 3. Add a Fault Path 1. On the **Get Contact ID from Email** tile, click the 3-dot menu and select **Add Fault Path**. 2. After the **Fault** path, click the **+** to add an **Assignment** element. 3. Enter as **Label**: error_message (Text). 4. Under **Set Variable Values**: - **Variable**: Select **New Resource** and enter the details. - **Resource Type**: Variable - **API Name**: `error_message` - **Data Type**: Text - Click **Done**. - **Operator**: Select Equals. - **Value**: Select **Global Variables** > **Running Flow Interview** > **FaultMessage** (`$Flow.FaultMessage`). ![Flow Builder](https://developer.salesforce.com/docs/media/loan-agent-step-2-2.png '{"class": "image-framed"}') ### Next Step - [Create Flow Element to Get Document ID from Contact ID](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-element-to-get-document-id.md) # Create Flow Element to Get Document ID from Contact ID Create a second element to retrieve the Document ID from the user’s Contact ID, allowing the agent to surface relevant information. ## 1. Create the Element 1. In the **Flow Builder**, under **Get Contact ID from Email Address**, click the **+** button, and search for the **Get Records** element. 2. The **Get Records** modal opens. Enter as **Label**: Get Document ID from Contact ID. 3. Under **Get Records for This Object**: - Select Salesforce Object as **Data Source**. - For **Object** field, search and enter **Content Document Link**. 4. Under **Filter Content Document Link Records**: - **Field**: Linked Entity ID - **Operator**: Equals - **Value**: contact_ID (created on the previous step [Create Flow Element to Get Contact ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-element-to-get-contact-id.md)) 5. Under **Sort Content Document Link Records**: - **Sort Order**: Descending - **Sort By**: `SystemModstamp` 6. Under **How to Store Record Data**: - Select **Choose fields and assign variables (advanced)**. - Under **Where to Store Field Values**, select **In separate variables**. 7. Under **Select Variables to Store Content Document Link Fields**: - **Field**: Enter `ContentDocumentId` - **Variable**: Select New Resource and enter the details. - **Resource Type**: Variable - **API Name**: content_document_ID - **Data Type**: Text - Under **Availability Outside the Flow**, check the checkboxes next to **Available for input** and **Available for output**. - Click **Done**. ## 2. Save Flow Configuration 1. Click **Save** on the top right and enter values in the flow saving modal fields. 2. For **Flow Label**, enter **Document ID from Contact ID**. 3. Click **Show Advanced** to open advanced settings. 4. Under **How to Run the Flow**, select **System Context Without Sharing–Access All Data**. 5. Click **Save**. ## 3. Add Fault Path 1. On the **Get Contact ID from Contact ID** tile, click the 3-dot menu and select **Add Fault Path**. 2. After the **Fault** path, add an **Assignment** element. 3. Enter as **Label**: error_message (Text). 4. Under **Set Variable Values**: - **Variable**: Select **New Resource** - **Resource Type**: Variable - **API Name**: error_message - **Data Type**: Text - Click **Done**. - **Operator**: Equals - **Value**: Select **Global Variables** > **Running Flow Interview** > **FaultMessage** (`$Flow.FaultMessage`). ## 4. Save the Flow 1. Click **Save**. 2. Click **Activate**. ![Element 2](https://developer.salesforce.com/docs/media/loan-agent-element-2.png '{"class": "image-framed"}') ### Next Step [Finalize Flow Retrieving File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-finalize-flow-retrieving-file-id.md) # Example - Cumulus Financial Service Agent This demo shows the value of integrating Data 360, Agentforce, and Slack. By using structured and unstructured data and real-time insights, Agentforce, powered by Data 360, helps Cumulus Financial streamline processes and meet diverse customer needs. **Business Goal:** Cumulus Financial wants to improve operational efficiency and customer experience with AI. **Use Case:** A Cumulus customer wants to check the status of their loan applications and asks about credit cards, mortgages, and financial advisory services. Watch this video to see how Cumulus puts it all together. ::video{src="https://developer.salesforce.com/docs/ai/agentic-enterprise-get-started/guide/iZ45aZntZWY723wraaSwjV" title="Financial Services: Agentforce in Action" type="vidyard"} Here's an overview of the tasks you can complete to build a similar workflow. Bookmark this page for easy reference. ## Step 1: Set Up Data 360 The most helpful AI solutions are grounded in trusted, accurate, and relevant data. Data 360 helps you consolidate disparate data sources into unified customer or account profiles that supercharge AI and Agentforce. With capabilities like zero-copy data federation and ingestion and indexing of unstructured data, Data 360 provides the foundation for a strong Agentforce implementation. ### Key Tasks 1. [Set up a Data Cloud Architect user](https://help.salesforce.com/s/articleView?id=data.c360_a_setup_walkthrough.htm&language=en_US&type=5). 2. [Create new users and assign any needed Data 360 permission sets](https://help.salesforce.com/s/articleView?id=data.c360_a_setup_walkthrough.htm&type=5). ## Step 2: Set Up Unstructured Data In the Cumulus Financial demo, Agentforce pulls information from multiple single-topic documents, like one-page PDFs on fixed-rate and adjustable-rate mortgages. To make this data available, a data admin first ingests and chunks it. Data 360 includes connectors for ingesting unstructured data from third-party applications and sources. Some connectors (such as Amazon S3, Azure, and Google Cloud Storage) require file notification pipelines. After setting up an unstructured data connection, create a vector search index or a hybrid search index by using Data 360 defaults or the advanced builder. The search index [chunks your content](https://help.salesforce.com/s/articleView?language=en_US&id=data.c360_a_search_index_grounding.htm&type=5) and helps make sure the outputs match your user intent and context. ### Key Tasks 1. [Select a connector for your unstructured data](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_connect.htm&type=5). 2. Create a [vector](https://help.salesforce.com/s/articleView?id=data.c360_a_search_index_vector_index.htm&language=en_US&type=5) or [hybrid](https://help.salesforce.com/s/articleView?id=data.c360_a_hybridsearch_index.htm&type=5) search index. ## Step 3: Set Up a Zero Copy Integration Cumulus Financial stores loan applications in structured data tables in Snowflake. Data 360's zero copy data federation is a capability that gives you direct, secure and near real-time access to partner data using. You can run queries on that day without copying it into Data 360. This ensures Agentforce can access your structured data directly from Snowflake. Read more about [zero copy data federation](https://help.salesforce.com/s/articleView?id=data.c360_a_byol_data_federation.htm&type=5) in Data 360. ### Key Task [Set up the Snowflake connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-snowflake-connector.html). ## Step 4: Set up Agentforce and Your Financial Agent Agentforce is the agent-driven layer of the Salesforce Platform. It helps you deploy AI agents that work alongside employees to extend your workforce and serve customers 24/7. In the Cumulus demo, the [financial services agent](https://help.salesforce.com/s/articleView?id=ind.fsc_agent_financial_advisor_assistance.htm&type=5) crafts responses based on queries from both structured and unstructured data sources. By synthesizing information across disparate documents, and presenting it in a clear, actionable way, Agentforce ensures that your customers receive detailed and meaningful responses that are informative and easy to understand. ### Key Tasks 1. [Turn on Einstein Generative AI](https://help.salesforce.com/s/articleView?id=ai.generative_ai_enable.htm&language=en_US&type=5). 2. [Enable Agentforce](https://help.salesforce.com/s/articleView?id=ai.agent_setup_enable.htm&type=5). 3. Review the [best practices](https://help.salesforce.com/s/articleView?id=ai.agent_user.htm&language=en_US&type=5) for and assign agent user permissions for your data space and objects. 4. [Set up financial advisor assistance](https://help.salesforce.com/s/articleView?id=ind.fsc_agent_financial_advisor_assistance_setup.htm&language=en_US&type=5). 5. [Create an agent from the Agentforce financial advisor assistance template](https://help.salesforce.com/s/articleView?id=ind.fsc_agent_financial_advisor_assistance_create_from_template.htm&language=en_US&type=5). ## Step 5: Set Up Prompt Templates Using prompt templates that you build in Prompt Builder, your financial services agent can use Einstein Search capabilities to navigate your unstructured data effectively. ### Key Tasks 1. [Enable Prompt Builder](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_enable.htm&language=en_US&type=5). 2. [Create a prompt template](https://help.salesforce.com/s/articleView?id=ai.prompt_builder_build_template.htm&type=5). ## Step 6: Set Up a Lead Generation Flow Finally, if your financial agent’s interaction creates a lead opportunity, as we saw in the demo, you can route that information to the appropriate team in your organization. A flow can take an Agentforce session summary as an input, gather additional details about the customer account from Data Cloud and create a new Lead Object in Sales Cloud. The flow can then post the lead details to a Slack group, so the team can follow. ### Key Tasks 1. [Connect Salesforce and Slack](https://help.salesforce.com/s/articleView?id=slack.slack_connections.htm&type=5). 2. [Set Up Sales Cloud for Slack](https://help.salesforce.com/s/articleView?id=slack.slack_apps_sales_cloud_parent.htm&language=en_US&type=5). 3. [Build a flow](https://help.salesforce.com/s/articleView?id=platform.flow_build.htm&language=en_US&type=5). 4. [Send a Slack message to a channel](https://help.salesforce.com/s/articleView?id=ai.copilot_actions_ref_slack_send_slack_message_channel.htm&language=en_US&type=5). ## Outcome Data 360, Agentforce, and Slack integrate structured and unstructured data and makes critical information visible to your team and customers in near real-time, streamlining communication and keeping teams in sync. This enables faster, data-driven decisions, optimized workflows, and enhanced customer interactions, increasing operational efficiency and driving impactful business outcomes. ## See Also - [Salesforce Help: Example: Agentic RAG with Advanced Data 360 Setup](https://help.salesforce.com/s/articleView?id=ai.generative_ai_rag_example.htm&type=5) - [Trailhead: Become an Agentblazer Champion](https://trailhead.salesforce.com/content/learn/trails/become-an-agentblazer-champion-2026) - [Trailhead: Unstructured Data in Data 360](https://trailhead.salesforce.com/content/learn/projects/unstructured-data-in-data-cloud) - [Trailhead: Data 360 with Zero Copy](https://trailhead.salesforce.com/content/learn/modules/data-cloud-with-zero-copy) # Finalize Flow Retrieving File ID from Email Address Make sure your flow works as expected, and debug if necessary. Learn more about [testing or troubleshooting with the Flow Builder debugger](https://help.salesforce.com/s/articleView?id=platform.flow_test_debug.htm&type=5). ## 1. Create Test Contact in Salesforce 1. On **Salesforce**, go to the **Contacts** tab. 2. Click **New Contact**. 3. Enter minimal details (only an email address is required). 4. Attach a **bank statement**. 5. Click **Save**. ## 2. Debug the Flow 1. Return to **Flow Builder**. 2. Click the **Debug** button. 3. **Input Parameters**: - Only populate: `contact_email` parameter. - Enter the same email address used when you created the contact on step 1. 4. Click **Run**. ## 3. Confirm Flow Execution Confirm the flow runs successfully by checking the debug interface. 1. Confirm that the flow execution completes without errors, and that it retrieves the Document ID correctly. 2. Confirm that given an email address, the flow: - finds the contact record - retrieves the contact ID - looks up the content document - returns the document ID ## Next Step Continue to create additional actions for the agent to use with this document ID: [Create additional actions for the agent to use with this document ID](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-apex-class.md). # Get Started with Agentic Enterprise Solutions **important:** Your feedback is important to us. The use cases that we select for the agentic enterprise solution center are designed to provide solutions and workflows to help your organization become an agentic enterprise. Can't find what you're looking for? If you’re missing your specific use case, share your feedback using the **Feedback** button at the bottom of this page, and we’ll address your request. ## What Is the Agentic Enterprise? The agentic enterprise is how organizations operate when humans and AI agents work together, sharing tasks, context, and decisions across the same connected systems. The agentic enterprise transforms Sales, Service, Commerce, Marketing, IT, and more by uniting apps, data, and agents on one trusted platform. In the agentic enterprise, every department is an engine for growing customer success, from Sales following up on every lead instantly to Service delivering 24/7 expertise. Salesforce is the unified platform for the agentic enterprise. It brings together apps, data, agents and metadata to drive customer and employee success. With trust and governance built in, Salesforce ensures your AI and business scale securely, reliably and with confidence. The outcome is an enterprise that can operate at greater speed and consistency than traditional human-only workflows. Agents handle scale and routine complexity continuously, while humans focus on judgment, exceptions, and relationships. ## What is the Agentic Enterprise Solution Center? The agentic enterprise solution center is a centralized hub where you can explore end-to-end guides, follow workflows, and access resources. It demonstrates how to build and run agentic enterprise solutions powered by your organization's data. Embrace the deeply unified platform and reimagine Salesforce apps and features as a cohesive product built on the foundations of Agentforce, Data 360, and relevant platform functionality. This center offers various content options for use cases and solutions organizations like yours use. It includes comprehensive guides, links to Trailhead modules, videos, blogs, and other resources to help you build your own agentic enterprise. To get started, select any use case from the [Agentic Enterprise Solutions](https://developer.salesforce.com/docs/ai/agentic-enterprise-get-started/guide/aes-agentic-enterprise-solutions.md). # Ground Agentforce on Your Own Website Ground Agentforce on your own website to provide users with reliable, scoped responses. With Data 360's Web Content connectors, you can ingest content from your organization's marketing, ecommerce, documentation, or other website. Offer your users an agentic experience in Salesforce or on any other site. Learn the entire process for grounding Agentforce on your website, from content ingestion strategy to building a prompt with Data 360 and Agentforce. This workflow can vary, depending on which website you use as a content source. Throughout this guide, examples show steps applied in practice. ## Why Ground Agentforce on Your Website? Deploying an AI agent that’s grounded on your own website provides users with accurate, relevant responses. - Grounding Agentforce on your own website provides users with up-to-date scoped responses, based on your organization's trusted information sources. - Keeping users on your site discourages them from searching elsewhere for answers about your products or services. - Improve user trust by generating inline citations that link directly to sources on your website. - With this approach, you employ your existing content investments and maximize their value, helping you reduce overall operational and maintenance costs. ## Required Editions Available in: All Editions supported by Data 360, excluding [Government Cloud](https://help.salesforce.com/s/articleView?id=ind.government_cloud_overview.htm&type=5). See [Data 360 edition availability](https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm&type=5). ## User Permissions Needed **note:** Make sure that you have the Data Cloud Provisioning license. | Task | User Permissions | | ----------------------------------------- | ---------------------------------------- | | To create a Web Content connection | System Admin or Data 360 Architect | | To create a UDLO and UDMO | Data 360 Architect | | To create a search index | Data 360 Architect | | To create a retriever (Agentforce Studio) | Data 360 Architect and Data Space access | ## Next Steps - [Step 1: Strategize Website Ingestion](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-strategize.md): Plan your website ingestion, select a Web Content connector, and define filtering for the content you want to ground on. - [Step 2: Set Up a Web Content Connector and Verify Content Ingestion](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-set-up-web-content-connector.md): Create the connector, apply your filtering decisions, and confirm that the content ingests into Data 360. - [Step 3: Create Search Index and Retriever](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-search-index-and-retriever.md): Create the search index and retriever that your agent will use over the ingested website content. - [Step 4: Build and Test a Prompt in Prompt Builder](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-prompt.md): Build and test the Flex prompt that connects the user’s question to retrieved website content. - [Step 5: Implement the Prompt Template in Your Agent](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-implement-prompt-template-in-agent.md): Create an action from the prompt template, create a subagent, and assign them to your agent. # Power Agentforce with Complex Visual Data Drive informed Agentforce conversations by grounding them in your company's complex visual data. By integrating Data 360 Intelligent Context and Agentforce, you can make product diagrams, installation guides, and annotated images available to your agent at run time. This guide covers the entire implementation process, from prerequisite requirements to building your agent, while providing practical examples to illustrate the steps along the way. ::video{src="https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/Gh3pvb6brKH3ZkQLhyLESb" title="Power Agentforce with Complex Visual Data" type="vidyard"} In this demo, the fictitious company DIY Storefront uses Data 360's rich unified profile, unstructured content powered by intelligent context, and Agentforce to activate a fully grounded Agentforce agent that answers technical product questions based on complex visual data. ## Architecture Overview ``` ┌─────────────────────────────────────────────────────────┐ │ CONTENT SOURCES │ │ PDFs with diagrams │ Installation guides │ Product docs │ └──────────────────────────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ AGENTFORCE DATA LIBRARY (ADL) │ │ Upload → Ready status → UDMO created │ └──────────────────────────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ INTELLIGENT CONTEXT (Data 360) │ │ LLM Parsing → Chunking → Vectorization → Search Index │ └──────────────────────────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ INDIVIDUAL RETRIEVER (Einstein Studio) │ │ Semantic search at run time → Returns chunks │ └──────────────────────────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ PROMPT BUILDER │ │ User question + Retrieved chunks → Grounded LLM answer │ └──────────────────────────────┬──────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────┐ │ AGENTFORCE AGENT │ │ Action routing → Prompt action → Agent response │ └─────────────────────────────────────────────────────────┘ ``` ## Why Ground Agentforce on Visual Data? Structured data alone can't answer complex, real-world questions. Visual and unstructured content fills that gap. - **Enable Self-Service**: Reduce escalations and support costs with installation guides and troubleshooting diagrams. - **Extend Knowledge**: Upload new content without rebuilding your data model, no code required. - **Maintain Trust**: Centralize knowledge in Agentforce Data Library as a single trusted source and eliminate the risk of hallucinated answers. - **Trusted Context Across Your Agentic Enterprise**: By using Intelligent Context, you can make all your enterprise data ready for action without moving it, power workflows, decisions, and analytics with one complete data source, and bring context and insight to your data so Agentforce can put it to work. ## Required Editions Available in: All Editions supported by Data 360, excluding [Government Cloud](https://help.salesforce.com/s/articleView?id=ind.government_cloud_overview.htm&type=5). See [Data 360 edition availability](https://help.salesforce.com/s/articleView?id=data.c360_a_dc_editions.htm&type=5). Learn more about the [billing considerations for Intelligent Context](https://help.salesforce.com/s/articleView?id=data.c360_a_billing_considerations_for_intelligent_context.htm&type=5). ## User Permissions Needed | Task | User Permissions | | ----------------------------- | ---------------------------------------- | | To upload unstructured files | Data 360 Architect | | To set up Intelligent Context | Data 360 Architect | | To configure a retriever | Data 360 Architect and Data Space access | ## Next Steps - [Before You Start](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-before-you-start.md): Review the prerequisites and prepare your org. - [Step 1: Strategize Your Visual Data Upload](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-strategize-visual-data.md): Plan the types, structure, and location of the visual data you want to ingest. - [Step 2: Configure Data 360 and Intelligent Context](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-configure-data-360.md): Learn how to set up the context and data pipeline. - [Step 3: Build Agentforce Agent](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-build-agent-visual-data.md): Finalize the setup to activate your grounded agent. # Prerequisite 1 - Create an External Client App Create an external client app to enable OAuth authentication and API access for Data 360 Document AI, and facilitate the integration with Salesforce. Learn more about [External Client Apps and Connected Apps](https://help.salesforce.com/s/articleView?id=xcloud.external_integrations.htm&type=5). ## 1. Create a New External Client App 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **External Client App Manager**. 3. Click **New External Client App**, and add the required information and add the required information in the New External Client App Manager as described in the following instructions. ### Basic Information 1. Under **Basic Information**, enter a descriptive **App Name**. 2. Enter your **Contact Email** address. ### API (Enable OAuth Settings) 1. Under **API (Enable OAuth Settings)**, select **Enable OAuth**. 2. In the **Callback URL** field, enter the following callback URL: `https://oauth.pstmn.io/v1/callback`. 3. Under **Available OAuth Scopes**, select all available scopes and move them to **Selected OAuth Scopes**. ![OAuth Scopes](https://developer.salesforce.com/docs/media/loan-agent-prereq-3alt.png '{"class": "image-framed"}') ### Enable Flows and Set Security 1. Under **Flow Enablement**, select **Enable client credentials flow**. When the confirmation appears, click **OK**. 2. Under **Security**, ensure these default settings are selected: - Require secret for Web Server Flow. - Require secret for Refresh Token Flow. - Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows. 3. To create the external client app, click **Create**. ![Security Settings](https://developer.salesforce.com/docs/media/loan-agent-prereq-3-2.png '{"class": "image-framed"}') ## 2. Configure OAuth and Admin Policies for Your App Your new app opens, or you can access it by going to **Setup** and then selecting **External Client App Manager** in the **Quick Find** search bar. Under the **Policies** tab, click **Edit** and apply the following configurations. ### OAuth Policies Under **OAuth Policies**, from the **Permitted Users** dropdown, select **Admin approved users are pre-authorized**, and click **OK** when the confirmation popup appears. ### App Policies The **App Policies** section opens. Under **Select Profiles**, add **System Administrator** to the **Selected Profiles** list. ### Admin Policies 1. Scroll down to **OAuth Flows and External Client App Enhancements**, and select **Enable Client Credentials Flow**. 2. In the **Run As (Username)** field, enter the System Administrator's email address, as explained below. 3. Click **Save** to apply all changes. :::Tip **How to Enter the Admin Email Address:** 1. Open **Setup** in a new tab. 2. In the **Quick Find** search bar, find and select **Users**. 3. Identify the admin user and copy their email address. 4. Paste this email in the **Run As** field on the previous **Manage External Client Apps** tab. ::: ## 3. Retrieve the Consumer Key and Secret for Your App 1. Open your newly created app (under **External Client App Manager** on the **Quick Find** menu). 2. Under **OAuth Settings**, click on the **Consumer Key and Secret** button. 3. You may be prompted to provide a verification code via your registered email. Check your email for the code and enter it when prompted. 4. Save the **Consumer Key and Consumer Secret** securely for later steps in the implementation. ## Next Step [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-retrieve-sf-domain-url.md) # Prerequisite 1 - Create and Configure an External Client App Create an external client app to enable OAuth authentication and API access for Data 360 Document AI, and facilitate the integration with Salesforce. Learn more about [External Client Apps and Connected Apps](https://help.salesforce.com/s/articleView?id=xcloud.external_integrations.htm&type=5). ## 1. Create a New External Client App 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **External Client App Manager**. 3. Click **New External Client App**, and add the required information in the New External Client App Manager as described in the following instructions. ### Basic Information 1. Under **Basic Information**, enter a descriptive **App Name**. 2. Enter your **Contact Email** address. ### API (Enable OAuth Settings) 1. Under **API (Enable OAuth Settings)**, select **Enable OAuth**. 2. In the **Callback URL** field, enter the following callback URL: `https://oauth.pstmn.io/v1/callback`. 3. From **Available OAuth Scopes**, select all available scopes and move them to **Selected OAuth Scopes**. ![OAuth Scopes](https://developer.salesforce.com/docs/media/loan-agent-prereq-3alt.png '{"class": "image-framed"}') ### Enable Flows and Set Security 1. Under **Flow Enablement**, select **Enable client credentials flow**. When the confirmation appears, click **OK**. 2. Under **Security**, ensure these default settings are selected: - Require secret for Web Server Flow - Require secret for Refresh Token Flow - Require Proof Key for Code Exchange (PKCE) extension for Supported Authorization Flows 3. To create the external client app, click **Create**. ![Security Settings](https://developer.salesforce.com/docs/media/loan-agent-prereq-3-2.png '{"class": "image-framed"}') ## 2. Configure OAuth and Admin Policies for Your App Your new app opens, or you can access it by going to **Setup** and then selecting **External Client App Manager** in the **Quick Find** search bar. Under the **Policies** tab, click **Edit** and apply the following configurations. ### OAuth Policies Under **OAuth Policies**, from the **Permitted Users** dropdown, select **Admin approved users are pre-authorized**, and click **OK** when the confirmation popup appears. ### App Policies The **App Policies** section opens. Under **Select Profiles**, add **System Administrator** to the **Selected Profiles** list. ### Admin Policies 1. Scroll down to **OAuth Flows and External Client App Enhancements**, and select **Enable Client Credentials Flow**. 2. In the **Run As (Username)** field, enter the System Administrator's email address, as explained below. 3. Click **Save** to apply all changes. :::Tip **How to Enter the Admin Email Address:** 1. Open **Setup** in a new tab. 2. In the **Quick Find** search bar, find and select **Users**. 3. Identify the admin user and copy their email address. 4. Paste this email in the **Run As** field on the previous **Manage External Client Apps** tab. ::: ## 3. Retrieve the Consumer Key and Secret for Your App 1. Open your newly created app (under **External Client App Manager** on the **Quick Find** menu). 2. On the **Settings** tab, open **OAuth Settings**, and click on the **Consumer Key and Secret** button. 3. You may be prompted to provide a verification code via your registered email. Check your email for the code and enter it when prompted. 4. Save the **Consumer Key and Consumer Secret** securely for later steps in the implementation. ## Next Step - [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-retrieve-sf-domain-url.md): Get your org domain URL for Document AI API calls. # Prerequisite 2 - Retrieve Your Salesforce Domain URL Get your Salesforce domain URL for API authentication and integration. 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **My Domain**. 3. Go to **My Domain Details** on the top of the page. 4. Your **Current My Domain URL** is listed. Add `https://` to the beginning of the domain URL. **Complete URL Example** - Displayed: `yourcompany.my.salesforce.com` - Complete URL: `https://yourcompany.my.salesforce.com` 5. Save this complete domain URL for subsequent configuration steps. ## Next Step Now that you've completed the prerequisites, continue to [Step 1: Create a Document AI Configuration to Process Resumes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-document-ai-schema-config.md), where you create a Data 360 Document AI configuration to process resumes. # Prerequisite 2 - Retrieve Your Salesforce Domain URL Get your Salesforce domain URL for API authentication and integration. 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **My Domain**. 3. Go to **My Domain Details** on the top of the page. 4. Your **Current My Domain URL** is listed. Add `https://` to the beginning of the domain URL. **tip:** **What a Complete URL Looks Like** - Displayed: `yourcompany.my.salesforce.com` - Complete URL: `https://yourcompany.my.salesforce.com` 5. Save this complete domain URL for subsequent configuration steps. ## Next Step Now that you've completed the prerequisites, continue to [Step 1 - Create a Document AI Configuration](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-document-ai-schema-config.md), where you set up the Data 360 Document AI processor configuration for bank statement data extraction. # Step 1 - Create a Document AI Configuration to Process Resumes Now that you've completed the prerequisites and gathered the required information (Client Secret, Consumer Key, and Salesforce Domain URL), you're ready to create your first Data 360 Document AI configuration to process and extract data from resumes. Learn more about [Document AI](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai.htm&type=5). ## 1. Create a New Configuration 1. From **App Launcher**, find and select the **Data 360** app (it may appear as **Data Cloud**). 2. Go to the **Unstructured Data** tab (in some orgs, this may be labeled as **Process Content**). 3. On the left-hand navigation menu, click **Document AI**. 4. Click **New** to create a new configuration. 5. Choose how you want to create your document schema configuration by selecting **Without a source object**. ## 2. Configure Data Extraction 1. Prepare your resume document for upload. In the document schema builder, click **Upload Files** and select your resume. 2. On the top left, select any LLM model. Gemini 2.0 Flash is recommended for PDF analysis. 3. Configure extraction fields: - On the right, under **Outputs**, click **Create Manually** and then click **Next**. - Click **Add Field** and add the following fields one-by-one. For each field, set the **data type** to **string**, and leave the **prompt** field blank. | Field Name | Description | | ------------------------- | ------------------------------------- | | First Name | Candidate's first name | | Last Name | Candidate's last name | | Email Address | Candidate's email address | | Phone Number | Candidate's phone number | | Street Address | Candidate's street address | | City | Candidate's city | | State or Province | Candidate's state or province | | Country | Candidate's country | | Pin Code or Zip Code | Candidate's postal code | | Summary of Qualifications | Summary of candidate's qualifications | ## 3. Test and Save Your Configuration Verify the results of the resume data extraction. 1. Click **Test**. 2. Document AI processes your uploaded sample file and extracts the defined fields. Review the output to verify that all fields are extracted correctly. 3. Save your configuration: - Click **Save**. - Enter a **Document Schema Name** and **API Name**: `resume_config`. Copy and save the API name for next steps. - Click **Save**. ## Next Step - [Step 2 - Create a Prompt Template in Prompt Builder](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-prompt-template.md): Create a Flex prompt template to format Document AI JSON output for your flow. # Step 1 - Create a Document AI Schema Config Set up the Data 360 Document AI processor configuration for a bank statement data extraction. This configuration uses an LLM model to analyze an uploaded bank statement, define the structured fields for extraction, and ensure the output is delivered as a clean, structured JSON schema. Learn more about [Document AI](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai.htm&type=5). ## 1. Create a New Configuration 1. On the **App Launcher**, find and select the **Data 360** app (it may appear as **Data Cloud**). 2. Go to the **Unstructured Data** tab (in some orgs, this may be labeled **Process Content**). 3. On the left-hand navigation menu, click **Document AI**. 4. Click **New** to create a new configuration. 5. Choose how you want to create your document schema configuration by selecting **Without a source object**. ## 2. Configure Data Extraction 1. Prepare your bank documents for upload. In the document schema builder, click **Upload Files** and select your bank statement. 2. On the top left, select any LLM model. Gemini 2.0 Flash is recommended for PDF analysis. 3. Configure extraction fields: - On the right, under **Outputs**, click **Create Manually** and then click **Next**. Alternatively, you can use [auto-extraction](https://help.salesforce.com/s/articleView?id=data.c360_a_document_ai_new_config.htm&type=5) and change the fields to reflect what is shown below. - Click **Add Field** and add the following fields one-by-one. | Name | API Name | Field Type | Prompt Instruction | | :-------------- | :---------------- | :--------- | :---------------------------------------------------------------------------- | | Monthly salary | `Monthly_salary` | string | Based on the transactions, identify the average salary of the account holder. | | home loan taken | `home_loan_taken` | boolean | 1 if there are EMI transactions for home loan. | | auto loan taken | `auto_loan_taken` | boolean | 1 if there are EMI transactions for auto loan. | ![Extraction Fields](https://developer.salesforce.com/docs/media/loan-agent-step-1-2.png '{"class": "image-framed"}') ## 3. Test and Save Verify the results of the bank statement data extraction. 1. Click **Test**. 2. Document AI processes the uploaded file and extracts the defined fields. Review the output to verify that all fields are extracted correctly. 3. Save the configuration: - Click **Save**. - Enter a **Document Schema Name** and **API Name**: `bank_stmt_analyzer`. Copy and save the API name for next steps. - Click **Save**. You successfully created your Document AI processor configuration for bank statement data extraction. For an example JSON schema, see the [complete document schema configuration](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-document-ai-schema-configuration.md). ## Next Step [Step 2 - Create Flow to Retrieve File ID from Email Address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-to-retrieve-file-id.md): Create a screen flow to identify the bank statement file from the customer's email address. # Step 1: Strategize Website Ingestion Plan your website ingestion. An informed strategy at this point helps you avoid issues after Data 360 ingests your content and you build your agent. ## 1. Select Website for Ingestion Select your marketing, ecommerce, documentation, or any other website you want to ingest into Data 360 to support Agentforce. You can ingest the entirety of your website's content, or you can choose to scope the ingestion to specific pages or areas. ### Website Limitations - You can ingest only public content. Data 360 doesn’t ingest content that's behind a login. - Data 360 doesn’t ingest content that's generated dynamically by using JavaScript. To check whether your site content is generated dynamically using JavaScript: 1. On your website, open a page you want to ingest. 2. Right-click anywhere on the page. On the menu, click **Inspect** to see developer tools. 3. Click the settings icon, and scroll down to the **Debugger** section. 4. Check **Disable JavaScript**, and refresh the page. If after the refresh the page appears empty, Data 360 can’t ingest the content of this page. ## 2. Prepare Your Content for Ingestion Depending on the content you want to make available for Agentforce, you can ingest your entire website or parts of it. Define your ingestion scope, and list a few sample pages. You can use this page list later to validate that the correct content ingests successfully. ### Example Cirrus is a sustainable energy solution provider that wants to build a service agent to answer questions about its products, using content from its public site: `https://cirrus-static-site.vercel.app`. As Cirrus wants the agent to answer only product-related questions, the team scopes the ingestion to specific product-related pages and lists sample pages from the company’s website to include in the ingestion. - `https://cirrus-static-site.vercel.app/products/solar_panels/standard-solar-panel-250w.html` - `https://cirrus-static-site.vercel.app/products/starter_sets/homestarter-kit.html` - `https://cirrus-static-site.vercel.app/products/small_turbines/tinyturbine-250w.html` ## 3. Select a Data 360 Connector ### Check for a Sitemap Data 360 offers a growing list of connectors and strategic partners to help you ingest content from external sources into Salesforce. See [comprehensive list of connectors and integrations](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-thirdparty-connectors.html). Out of this list, two connectors ingest website content. - [Web Content (Sitemap) connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-web-content-sitemap-connector.html) - [Web Content (Crawler) connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-web-content-crawler-connector.html) For public website ingestion, we recommend the Web Content (Sitemap) connector. Sitemaps draw a defined list of URLs from the website, and can include metadata such as the page’s last updated date. This defined list and metadata make the ingestion process predictable and easy to manage. A crawler, however, doesn't use a closed list of URLs and instead discovers pages by following links based on crawl depth and rules. While the crawling ingestion method is more flexible, it can be less predictable. If your site has a relevant XML sitemap that includes the pages you want to ingest, select the Web Content (Sitemap) connector. Use the Web Content (Crawler) connector when a sitemap isn't available, or if your site has a sitemap that doesn't include the content you want to ingest. To check for a sitemap: 1. Go to `https:///robots.txt`. The robots.txt page of a website typically lists the site's sitemap. 2. If you can’t find the robots.txt page, try adding `sitemap.xml` to your domain. Alternatively, add another sitemap index URL exposed by the site, like `https:///sitemap.xml`. 3. Can’t find the sitemap? Go to [Strategize Connection with Web Content (Crawler) Connector](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-strategize-crawler.md) to proceed with the Web Content (Crawler) connector. #### Example Cirrus finds its sitemap on this URL: `https://cirrus-static-site.vercel.app/robots.txt`. ### Find the Right Sitemap Your site can have multiple sitemaps for different languages, product areas, or content types. Select the relevant sitemap based on the content that you want to ingest. See, for example, this sitemap for English content only: `https://help.your-domain.com/oie/en-us/Sitemap.xml`. ### Identify URLs in Your Sitemap After you find the right sitemap, verify that it includes the pages you want to ingest. Search the sitemap for your sample URLs, or for distinctive parts of those URLs, and confirm that they appear. ## 4. Strategize Filtering with a Regular Expression After you select the relevant ingestion method and sitemap, decide how to scope the site ingestion so that it includes only the relevant pages for ingestion. A simple way to scope content ingestion is by filtering URLs with a regular expression. Prepare a regular expression that matches the pages you want to ingest. For example, if you enter `./content/.`, all pages under the starting URL that include `/content/` in their URL path are ingested. If you don’t specify any included pages, all pages under the sitemap URL are included. #### Example Cirrus doesn't want to ingest its entire site. They're only interested in pages related to products. Based on the sample pages they list, a suitable regular expression pattern is: `._/products/._`. This pattern matches URLs that contain the expression `/products/`, which aligns with the company's content ingestion scope. ## Before You Continue After strategizing your website ingestion, make sure that you have the following: - Your selected web content connector - The content scope for the agent - The URL of your sitemap - The filtering logic to limit ingestion to the relevant pages ### Example Cirrus gathers its findings. - Selected website content connector: Web Content (Sitemap) - Content scope: Product-related - Sitemap URL: `https://cirrus-static-site.vercel.app/sitemap.xml` - Filter pattern: `._/products/._` ## See Also - [Use Unstructured Data in Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_connect_overview.htm&type=5) - [Billing Considerations for Unstructured Data](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_billing_considerations.htm&type=5) ## Next Step - [Step 2: Set Up a Web Content Connector and Verify Content Ingestion](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-set-up-web-content-connector.md): Create the connector, apply your filtering decisions, and verify content ingestion. # Step 1: Strategize Your Visual Data Upload Before ingesting visual data into Data 360, plan your content strategy. A well-defined strategy gives your agent access to the right information without unnecessary content that can dilute search results or increase costs. In this step, identify which content types to ingest, how to organize your files, and what scope to define for your agent's knowledge base. ## Supported Content Types Examples Data 360 can ingest visual content to ground your agent. - PDFs containing diagrams, annotated instructions, and step-by-step visuals - Product images used in Commerce or CMS contexts - Configuration or architecture diagrams ## Content Considerations As you plan your content ingestion, keep these key considerations in mind to optimize your agent's performance and accuracy. - Content scope: Don't upload all of your content to Data 360. Instead, define first what the agent should know. A focused knowledge base produces more accurate, relevant responses. - Content organization: Organize files by topic or use case. For example, keep separate libraries for separate product categories, like Bathroom, Deck, and Kitchen. - Name files clearly: Names carry through to chunk metadata. - Make sure that diagrams are embedded in PDFs, and aren't dynamically rendered. ## Next Step - [Step 2: Configure Data 360 and Intelligent Context](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-configure-data-360.md): Learn how to set up the context and data pipeline. # Step 2 - Create a Prompt Template in Prompt Builder Now that you have a Document AI configuration to process resumes, set up a prompt template to handle Document AI's output. ## Create a New Prompt Template 1. Go to **Setup**. 2. In the **Quick Find** search bar, find and select **Prompt Builder**. 3. On the Prompt Builder setup page, click **New Prompt Template**. 4. For **Prompt Template Type**, select **Flex**. 5. Enter a name for your prompt template (for example, **Handle JSON From Document AI**). 6. Under **Inputs (Optional)**, add one input: - Name: `inputString` - **Source Type**: Free Text 7. Click **Next**. 8. In the prompt screen, paste this prompt. ``` Instruction: You are a JSON data formatter. Input: You will receive raw JSON as a string that may include schema, metadata, or other non-essential fields. Raw JSON Input: Input:inputString Task: - Parse the JSON. - Ignore technical fields like schema, metadata, or keys starting with _ that don't add meaning for a user. - Convert the remaining key-value pairs into a clean, human-readable format. > Label: Value; for each pair. - Separate pairs with ; and add a line break between logical sections if there are nested objects or arrays. - Label should be continuous without spaces, add _ if necessary Example Output > Candidate_residential_state:TX;Candidate_residential_zip_or_pin_code: 78701;Street_address:1456 Oak Avenue;Candidate_residential_city:Austin;Other_Phone_number:(512) 555-0347;Mobile_phone_number:(512) 555-0892 ``` **note:** Make sure that the value `inputString` in the prompt template (`Input:inputString`) is spelled exactly as you spell it in the prompt instruction. 9. From the **Models** dropdown on the left, select **GPT 4.1**. This model handles JSON and structured output reliably. 10. Click **Save** and then click **Activate**. 11. Confirm that your newly created prompt template appears on the Prompt Builder home page. 12. Copy the prompt template ID, as explained below. **tip:** **How to Find the Prompt Template ID** The prompt template ID is typically part of the URL of the template in the Prompt Builder. For example, in this URL the prompt template ID is `0hfKZ000000PPrNYAW`: `https://trailsignup-5fca1e948037d6.lightning.force.com/lightning/setup/EinsteinPromptStudio/0hfKZ000000PPrNYAW/edit?c__versionId=3vNKZ000000U0ma2AC` ## Next Step - [Step 3 - Create Apex Classes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-apex-classes.md): Add the invocable Apex classes that call Document AI from your flow. # Step 2 - Create Flow to Retrieve File ID from Email Address Create a screen flow to identify the bank statement file from the customer’s email address–with no code. Learn more about [automating tasks with flows](https://help.salesforce.com/s/articleView?id=platform.flow.htm&type=5). ## Create a New Flow 1. On the **App Launcher**, select **Flows**. 2. Click the **New** button to create a new flow. 3. The **New Automation** screen opens. Under **Categories**, find the **Autolaunched Automations** tile. 4. Under **Types**, select **Autolaunched Flow (No Trigger)**. 5. The Flow Builder opens. Continue to add elements to set the actions the flow will execute. - [Add element to retrieve contact ID from the user's email address](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-element-to-get-contact-id.md). - [Add element to retrieve the Document ID from Contact ID](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-element-to-get-document-id.md). # Step 2: Configure Data 360 and Intelligent Context Now that you've planned your content strategy, set up the infrastructure to process and retrieve your visual data. Upload your files to Agentforce Data Library, configure Intelligent Context to parse and index the content, and create a retriever that your agent uses at run time. These three components work together to transform your raw visual content into searchable, grounded knowledge that powers your agent's responses. ## 1. Set Up Agentforce Data Library Create a Data Library and upload your unstructured data files. Data libraries transform large sets of information from documents, web content, or text fields into searchable, structured data. They enhance your Agentforce agent's accuracy by connecting it to your trusted data sources. Learn more about [data libraries](https://help.salesforce.com/s/articleView?id=ai.data_library_learn_about.htm&type=5). To experiment with Agentforce Data Library, you can use this sample [PDF instructions for deck building](https://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/installation.pdf). 1. Go to **Setup**. 2. In the quick find box, find and select **Agentforce Data Library**. 3. Click **New Library**. 4. Enter a descriptive name and API name. 5. Save your changes. 6. For **Data Type**, select **Files**. 7. Select the relevant data space. 8. Upload your unstructured data files and click **Done**. ## 2. Set Up Intelligent Context Intelligent Context is an AI-powered workspace where you interact with prompts to process unstructured data and create search index configurations tailored to your business context. Set up intelligent context with a new search configuration, and test it. Learn more about [Intelligent Context in Data 360](https://help.salesforce.com/s/articleView?id=sf.c360_a_intelligent_context.htm&type=5). To experiment with Intelligent Context, you can use this sample [PDF instructions for deck building](https://resources.docs.salesforce.com/rel1/doc/en-us/static/pdf/installation.pdf). 1. From the **App Launcher**, find and select **Data Cloud**. 2. Go to the **Process Content** tab and open **Intelligent Context**. 3. Click **New Configuration**. 4. Enter the relevant data space. 5. Enter a descriptive name and API name. 6. Save your changes. 7. Upload up to 5 files on which you want to test your search configuration. 8. Click **Done** and wait a minute for the file to be ready for preview. 9. Click **Set up my configuration using smart defaults** and wait for chunks generation. 10. Click **Modify** to go to **Edit Configuration**. 11. Configure: - **Set Parsing Options**: Select **LLM-based Parsing**. This setting extracts all text, images, and other visual elements using an LLM. Learn more about [LLM-based parsing](https://help.salesforce.com/s/articleView?id=data.c360_a_llm_parsing_preprocessing.htm&type=5). - **Set Preprocessing Options**: Select the default **No preprocessing**, and turn off **Image Processing**. 12. Apply your changes and wait for chunks generation. 13. Click **Publish**. 14. Select the relevant unstructured data model object (UDMO) that Agentforce data library creates for you: find the data library name with **ADL** prefix, for example, `ADL_deck`. 15. Click **Next**. 16. Click **Publish**. 17. Test your search index configuration by asking questions in the agent chat window or compare the generated chunks with your source document. Each generated chunk contains a confidence score, a source file reference, and a citation. Iterate it until you get good results. Learn more about [testing and iterating an Intelligent Context configuration](https://help.salesforce.com/s/articleView?id=data.c360_a_intelligent_context_create_configuration.htm&type=5). Test your search index configuration by asking questions in the Agentforce pane on the right. Iterate it until you get good results. ## 3. Set Up an Individual Retriever Create an individual retriever to fetch relevant data from your search index at run time. When you configure a retriever, you select its search index, define filters to narrow the search scope, and specify which fields to return to your agent. Filters focus the search on the most relevant data, while the returned fields provide the context your prompt needs to generate accurate responses. Each time you edit and save a retriever, the system creates a new version. You can activate one version at a time. - Learn more about [retrieving data](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_retriever.htm&type=5). - Learn more about [creating an individual retriever](https://help.salesforce.com/s/articleView?id=data.c360_a_ai_retriever_create.htm&type=5). 1. Go to **Setup**. 2. On the quick find box, find and select **Agentforce Agents**. 3. Launch the new Agentforce builder. 4. From the **Build** menu on the left, select **Data** and then select **Retrievers**. 5. Click **New Retriever**. 6. For retriever type, select **Individual Retriever** and click **Next**. 7. Select **Data Cloud** as the data source for the new retriever. 8. Define Retrieval Details: - Under **Select the data space where the data resides**, select **default**. - Under **Select a data model object**, select the data model that Agentforce Data Library creates for you. Find the data library name with **ADL** prefix, for example `ADL_deck`. - Under **Data model object's search index configuration**, select the search index you created in step 2 – Set Up Intelligent Context. - Click **Next**. 9. Define filters to narrow the search focus to more relevant data. For the purposes of this example, select **All Documents** and click **Next**. 10. Under **Fields to Return**, configure which information to return by specifying one or more fields that ground the prompt. Select only fields that augment the prompt for your use case and help make prompt responses more accurate and relevant. - Enter a unique, descriptive **Field Label**. - For **Field Name**, select **Related Attributes**, then select the chunk that Agentforce Data Library creates for you, for example, `ADL_deck chunk`. Then under **Attributes**, select **Chunk**. - Click **Add Field** to add more fields that give the best responses for your use case. You can try different combinations of fields to maximize the quality of your responses. Field examples: Chunk Sequence Number, Data Source, or Record ID. See more examples in [DIY Storefront use case](https://github.com/salesforce-misc/Data360AgentforceSolutionKitRetail). - Click **Next**. 11. Save your changes and then click **Activate** to activate your individual retriever. ## Next Step [Step 3: Build Agentforce Agent](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guide/aes-build-agent-visual-data.md): Finalize the setup to activate your grounded agent. # Step 2: Set Up a Web Content Connector and Verify Content Ingestion ## 1. Set Up a Web Content Connector Now that you've strategized your site ingestion and selected a web content connector, set it up. Follow the specific instructions in the connector documentation, noting that additional settings are available to further refine your content ingestion. After you set up your connector, confirm that the expected content is in Data 360. **important:** Follow the set-up instructions in your selected connector documentation. As you set up the connector, don't enable the default search index. Instead, this guide provides instructions for a customized search index in [Create Search Index and Retriever](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-search-index-and-retriever.md). - Set up the [Web Content (Sitemap) connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-web-content-sitemap-connector.html). **OR** - Set up the [Web Content (Crawler) connector](https://developer.salesforce.com/docs/data/data-cloud-int/guide/c360-a-web-content-crawler-connector.html). ## 2. Verify Content Ingestion After you set up your connector and Data 360 starts the ingestion process, check the syncing status on the Data Streams tab (see [Monitor the Status of Unstructured Connectors Data Ingestion](https://help.salesforce.com/s/articleView?id=data.c360_a_monitor_the_status_of_unstructured_connectors_data_ingestion.htm&type=5)). Then continue with the relevant validations for the sitemap or crawler connector. ### Confirm Ingestion of Expected Number of Pages (Sitemap) Verify that Data 360 ingested the number of pages you expected based on your sitemap and filters. #### Estimate Number of Pages for Ingestion Based on your sitemap and filtering strategy, estimate the number of pages you expect Data 360 to ingest by reviewing your sitemap and counting the entries matching your filters. You can compare this number against Data 360. #### Compare Page Count in Data 360 On the Data Streams tab, make sure your data stream’s Last Run Status is Success and query the Data Lake Object (DLO) to confirm the number of ingested HTML pages. 1. On Data Cloud app, go to the **Query Editor** tab. 2. To create a new workspace, give it a name and save your changes. 3. On the left, select **Data Lake Objects** and select your Data Lake Object (DLO). 4. Click **Create Query** on the right. 5. Paste the following query example, replacing `DLO API Name` with your Data Lake Object API name. To find your Data Lake Object (DLO) API name, look for it in double quotes in the Query Editor or on your DLO tab. ```sql SELECT COUNT(*) FROM "DLO API Name" WHERE "ContentType__c" = 'text/html' ``` #### Example Cirrus has filtered its ingestion to product-related content (`.*/products/.*`). The team reviews the sitemap and counts the entries matching this pattern. They find 20 URLs on the sitemap that contain this expression, which gives them a concrete number to compare against Data 360. After they run the query, the result is 20, which matches the number of product pages found on the sitemap. **note:** The exact count may vary over time as the source site changes, but the process stays the same: define the expected scope first, then compare it to what was actually ingested. #### Troubleshooting Mismatch Errors The result of the query should be reasonably close to the expected number of pages you identified. If there's a meaningful gap, investigate before you continue. Possible reasons for a mismatch include: - The regular expression filtered out more than you intended. - Some URLs in the sitemap point to non-HTML assets. - The source content changed between your review and the sync. - Some pages were skipped or failed during ingestion. ### Validate Sample Pages (Crawler) To validate a crawler-based ingestion, use the sample pages you identified earlier. 1. On the Data Cloud app, go to the **Query Editor** tab. 2. To create a new workspace, give it a name and save your changes. 3. On the left, select **Data Lake Objects** and select your Data Lake Object (DLO). 4. Click **Create Query** on the right. 5. Paste the following query example, replacing `DLO API Name` with your Data Lake Object API name. To find your Data Lake Object (DLO) API name, look for it in double quotes in the Query Editor or on your DLO tab. ```sql SELECT URL__c, Title__c, FilePath__c, ContentType__c FROM "DLO API Name" WHERE URL__c LIKE '%URL YOU WANT TO TEST%' ``` This query helps confirm that Data 360 ingests the relevant content. - The expected page exists. - The stored URL is correct. - The content type is correct. - The connector ingested the kind of content that you intended for agent grounding. If the content validation is unsuccessful, fix the ingestion setup before continuing. It's easier to correct filtering or connector configuration now than after you build the search index and connect it to an agent. ## Before You Continue Before moving on to create a search index, make sure that the answer to these questions is **yes**. - Did the sync complete successfully? - Are your sample pages ingested? - Does the content in Data 360 match the intended scope? If the answer to any of these questions is no, fix the ingestion setup before continuing. It's easier to correct filtering or connector configuration now than after you build the search index and connect it to an agent. ## Next Step - [Step 3: Create Search Index and Retriever](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-search-index-and-retriever.md): Create the search index and retriever that your agent will use over the ingested website content. # Step 3 - Create Apex Class (Document AI API Wrapper) Create a custom Apex class to enable the Document AI flow functionality. This Apex class: - Allows the Salesforce flow to invoke the Data 360 Document AI functionality - Passes in necessary credentials and document identities - Receives a clean JSON output of the extracted bank statement data 1. Go to the **Setup Menu**. 2. From the dropdown menu, select **Developer Console**. 3. In the Developer Console, click **File** \> **New** \> **Apex Class**. 4. Enter the class name: `de_BankStatementExtractor` and click **OK**. 5. When the code editor opens, paste this code into the editor and save the file. **note:** This is an out-of-the-box class that includes a method invoked by the flow you create on the next step. If you choose to use a different Apex class, make sure it includes such an invocable method. This class also contains a hardcoded override for the LLM model. If you use a different model, update the `llmModel` string. ```java public class de_BankStatementExtractor { @InvocableMethod(label='Run Bank statement analysis using DataCloud Document AI') public static List runImageProcessing(List requests) { List results = new List(); for (Request req : requests) { Result result = new Result(); try { // 1. Get access token String token = getAccessToken(req.Org_Domain, req.Client_Id, req.Client_Secret); System.debug('Access Token >> ' + token); // Intialize variables String orgDomain = req.Org_Domain; String llmModel = req.LLM_Model; String idpConfigId = req.IDPConfigId; // 2. Get latest version ID as fileId ContentVersion cv = [ SELECT Id FROM ContentVersion WHERE ContentDocumentId = :req.ContentDocumentId ORDER BY VersionNumber DESC LIMIT 1 ]; String fileId = cv.Id; System.debug('Using fileId >> ' + fileId); // 3. Call schema generation or extract directly String schemaJson; String finalResponse; if (String.isBlank(idpConfigId)) { schemaJson = getSchemaJson(token, fileId, orgDomain, llmModel); System.debug('Decoded Schema JSON >> ' + schemaJson); finalResponse = extractData(token, fileId, schemaJson, orgDomain, llmModel, null); } else { finalResponse = extractData(token, fileId, null, orgDomain, llmModel, idpConfigId); } result.Status = 'Success'; result.ExtractedDataJson = finalResponse; } catch (Exception e) { result.Status = 'Failed'; result.ErrorMessage = e.getMessage(); System.debug('Error >> ' + e.getMessage()); } results.add(result); } return results; } public class Request { @InvocableVariable(label='Org Domain' required=true) public String Org_Domain; @InvocableVariable(label='Client Id' required=true) public String Client_Id; @InvocableVariable(label='Client Secret' required=true) public String Client_Secret; @InvocableVariable(label='Document Type' required=true) public String Document_Type; @InvocableVariable(label='LLM Model') public String LLM_Model; @InvocableVariable(label='Content Document Id' required=true) public Id ContentDocumentId; @InvocableVariable(label='IDPConfigId') public String IDPConfigId; } public class Result { @InvocableVariable(label='Status') public String Status; @InvocableVariable(label='Extracted Data (JSON)') public String ExtractedDataJson; @InvocableVariable(label='Error Message (if any)') public String ErrorMessage; } // === 1. Get access token === private static String getAccessToken(String orgDomain, String clientId, String clientSecret) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/oauth2/token'); req.setMethod('POST'); req.setHeader('Content-Type','application/x-www-form-urlencoded'); req.setBody('grant_type=client_credentials&client_id=' + clientId + '&client_secret=' + clientSecret); HttpResponse res = new Http().send(req); if (res.getStatusCode() == 200) { Map resp = (Map)JSON.deserializeUntyped(res.getBody()); return (String)resp.get('access_token'); } throw new CalloutException('Access Token Error: '+res.getBody()); } // === 2. Generate schema === private static String getSchemaJson(String accessToken, String fileId, String orgDomain, String llmModel) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/data/v63.0/ssot/document-processing/actions/generate-schema'); req.setMethod('POST'); req.setHeader('Authorization','Bearer '+accessToken); req.setHeader('Content-Type','application/json'); req.setHeader('Accept','application/json'); req.setHeader('Sforce-Call-Options','client=SchemaTest'); req.setTimeout(120000); // Force hardcoded model for testing llmModel = 'llmgateway__OpenAIGPT4Omni_08_06'; Map payload = new Map{ 'mlModel' => llmModel, 'files' => new List{ new Map{ 'fileId' => fileId } } }; String body = JSON.serialize(payload); System.debug('Sending Schema Payload: ' + body); req.setBody(body); HttpResponse res = new Http().send(req); System.debug('Schema Status Code: ' + res.getStatusCode()); System.debug('Schema Response: ' + res.getBody()); if (res.getStatusCode() >= 200 && res.getStatusCode() < 300) { Map bodyMap = (Map) JSON.deserializeUntyped(res.getBody()); String schemaRaw = (String) bodyMap.get('schema'); if (schemaRaw == null) { throw new CalloutException('Schema Error: No "schema" field in response'); } // Decode HTML escapes String schemaDecoded = schemaRaw.replaceAll('"', '"').replaceAll('&', '&'); return schemaDecoded; } else { throw new CalloutException('Schema Error(' + res.getStatusCode() + '): ' + res.getBody()); } } // === 3. Extract data === private static String extractData(String accessToken, String fileId, String schemaJson, String orgDomain, String llmModel, String idpConfigId) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/data/v63.0/ssot/document-processing/actions/extract-data'); req.setMethod('POST'); req.setHeader('Authorization','Bearer '+accessToken); req.setHeader('Content-Type','application/json'); req.setHeader('Accept','application/json'); req.setTimeout(120000); Map payload; if (!String.isBlank(schemaJson)) { payload = new Map{ 'mlModel'=>llmModel, 'files'=>new List{ new Map{ 'fileId'=>fileId } }, 'schemaConfig'=>schemaJson }; } else { payload = new Map{ 'idpConfigurationIdOrName'=>idpConfigId, 'files'=>new List{ new Map{ 'fileId'=>fileId } } }; } System.debug('Extract Payload >> '+JSON.serializePretty(payload)); req.setBody(JSON.serialize(payload)); HttpResponse res = new Http().send(req); System.debug('Extract Status >> '+res.getStatusCode()); System.debug('Extract Response >> '+res.getBody()); if (res.getStatusCode()>=200 && res.getStatusCode()<300) { Map bodyMap = (Map)JSON.deserializeUntyped(res.getBody()); if (bodyMap.containsKey('data')) { return JSON.serialize(bodyMap.get('data')); } return 'No data field in response'; } throw new CalloutException('Extract Error('+res.getStatusCode()+'): '+res.getBody()); } } ``` ## Next Step - [Step 4 - Create Bank Statement Extraction Flow (Apex Wrapper)](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-flow-bank-statement-extraction.md): Create a screen flow to extract data from the customer's bank statement. # Step 3 - Create Apex Classes Create two custom Apex classes to enable the Document AI flow functionality. ## 1. Create an Apex Class: Data 360 Document AI Flow Action 1. Go to the **Setup Menu**. 2. From the dropdown menu, select **Developer Console**. 3. In the Developer Console, click **File** > **New** > **Apex Class**. 4. Enter the class name: `de_DataCloudIDPFlowAction` and click **OK**. 5. The code editor opens. Paste this code into the editor and save the file. **note:** This is an out-of-the-box class that includes a method invoked by the flow you create on the next step. If you choose to use a different Apex class, make sure it includes such an invocable method. ```java public class de_DataCloudIDPFlowAction { @InvocableMethod(label='Run DataCloud IDP Image/File Recognition with Schema Configuration') public static List runImageProcessing(List requests) { List results = new List(); for (Request req : requests) { Result result = new Result(); try { // 1. Get access token String token = getAccessToken(req.Org_Domain, req.Client_Id, req.Client_Secret); System.debug('Access Token >> ' + token); // Vars String orgDomain = req.Org_Domain; String llmModel = req.LLM_Model; String idpConfigId = req.IDPConfigId; // 2. Get latest version ID as fileId ContentVersion cv = [ SELECT Id FROM ContentVersion WHERE ContentDocumentId = :req.ContentDocumentId ORDER BY VersionNumber DESC LIMIT 1 ]; String fileId = cv.Id; System.debug('Using fileId >> ' + fileId); // 3. Call schema generation or extract directly String schemaJson; String finalResponse; if (String.isBlank(idpConfigId)) { schemaJson = getSchemaJson(token, fileId, orgDomain, llmModel); System.debug('Decoded Schema JSON >> ' + schemaJson); finalResponse = extractData(token, fileId, schemaJson, orgDomain, llmModel, null); } else { finalResponse = extractData(token, fileId, null, orgDomain, llmModel, idpConfigId); } result.Status = 'Success'; result.ExtractedDataJson = finalResponse; } catch (Exception e) { result.Status = 'Failed'; result.ErrorMessage = e.getMessage(); System.debug('Error >> ' + e.getMessage()); } results.add(result); } return results; } public class Request { @InvocableVariable(label='Org Domain' required=true) public String Org_Domain; @InvocableVariable(label='Client Id' required=true) public String Client_Id; @InvocableVariable(label='Client Secret' required=true) public String Client_Secret; @InvocableVariable(label='Document Type' required=true) public String Document_Type; @InvocableVariable(label='LLM Model') public String LLM_Model; @InvocableVariable(label='Content Document Id' required=true) public Id ContentDocumentId; @InvocableVariable(label='IDPConfigId') public String IDPConfigId; } public class Result { @InvocableVariable(label='Status') public String Status; @InvocableVariable(label='Extracted Data (JSON)') public String ExtractedDataJson; @InvocableVariable(label='Error Message (if any)') public String ErrorMessage; } // === 1. Get access token === private static String getAccessToken(String orgDomain, String clientId, String clientSecret) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/oauth2/token'); req.setMethod('POST'); req.setHeader('Content-Type','application/x-www-form-urlencoded'); req.setBody('grant_type=client_credentials&client_id=' + clientId + '&client_secret=' + clientSecret); HttpResponse res = new Http().send(req); if (res.getStatusCode() == 200) { Map resp = (Map)JSON.deserializeUntyped(res.getBody()); return (String)resp.get('access_token'); } throw new CalloutException('Access Token Error: '+res.getBody()); } // === 2. Generate schema === private static String getSchemaJson(String accessToken, String fileId, String orgDomain, String llmModel) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/data/v63.0/ssot/document-processing/actions/generate-schema'); req.setMethod('POST'); req.setHeader('Authorization','Bearer '+accessToken); req.setHeader('Content-Type','application/json'); req.setHeader('Accept','application/json'); req.setHeader('Sforce-Call-Options','client=SchemaTest'); req.setTimeout(120000); // Force hardcoded model for testing llmModel = 'llmgateway__OpenAIGPT4Omni_08_06'; Map payload = new Map{ 'mlModel' => llmModel, 'files' => new List{ new Map{ 'fileId' => fileId } } }; String body = JSON.serialize(payload); System.debug('Sending Schema Payload: ' + body); req.setBody(body); HttpResponse res = new Http().send(req); System.debug('Schema Status Code: ' + res.getStatusCode()); System.debug('Schema Response: ' + res.getBody()); if (res.getStatusCode() >= 200 && res.getStatusCode() < 300) { Map bodyMap = (Map) JSON.deserializeUntyped(res.getBody()); String schemaRaw = (String) bodyMap.get('schema'); if (schemaRaw == null) { throw new CalloutException('Schema Error: No "schema" field in response'); } // Decode HTML escapes String schemaDecoded = schemaRaw.replaceAll('"', '"').replaceAll('&', '&'); return schemaDecoded; } else { throw new CalloutException('Schema Error(' + res.getStatusCode() + '): ' + res.getBody()); } } // === 3. Extract data === private static String extractData(String accessToken, String fileId, String schemaJson, String orgDomain, String llmModel, String idpConfigId) { HttpRequest req = new HttpRequest(); req.setEndpoint(orgDomain + '/services/data/v63.0/ssot/document-processing/actions/extract-data'); req.setMethod('POST'); req.setHeader('Authorization','Bearer '+accessToken); req.setHeader('Content-Type','application/json'); req.setHeader('Accept','application/json'); req.setTimeout(120000); Map payload; if (!String.isBlank(schemaJson)) { payload = new Map{ 'mlModel'=>llmModel, 'files'=>new List{ new Map{ 'fileId'=>fileId } }, 'schemaConfig'=>schemaJson }; } else { payload = new Map{ 'idpConfigurationIdOrName'=>idpConfigId, 'files'=>new List{ new Map{ 'fileId'=>fileId } } }; } System.debug('Extract Payload >> '+JSON.serializePretty(payload)); req.setBody(JSON.serialize(payload)); HttpResponse res = new Http().send(req); System.debug('Extract Status >> '+res.getStatusCode()); System.debug('Extract Response >> '+res.getBody()); if (res.getStatusCode()>=200 && res.getStatusCode()<300) { Map bodyMap = (Map)JSON.deserializeUntyped(res.getBody()); if (bodyMap.containsKey('data')) { return JSON.serialize(bodyMap.get('data')); } return 'No data field in response'; } throw new CalloutException('Extract Error('+res.getStatusCode()+'): '+res.getBody()); } } ``` ## 2. Create an Apex Class: Extract Resume Details with Document AI 1. In the Developer Console, click **File** > **New** > **Apex Class**. 2. Enter the class name: `de_Extract_Document_AI_Details` and click **OK**. 3. When the code editor opens, paste this code and save the file. ```java public with sharing class de_Extract_Document_AI_Details { // Wrapper for Flow Output public class ExtractedDetails { @InvocableVariable(label='First Name') public String First_name; @InvocableVariable(label='Last Name') public String Last_name; @InvocableVariable(label='Email Address of Candidate') public String Email_address_of_candidate; @InvocableVariable(label='Phone Number of Candidate') public String Phone_number_of_candidate; @InvocableVariable(label='Street Address of Candidate') public String Street_address_of_candidate; @InvocableVariable(label='City of Candidate') public String City_of_candidate; @InvocableVariable(label='State or Province of Candidate') public String State_or_province_of_Candidate; @InvocableVariable(label='Country of Candidate') public String Country_of_candidate; @InvocableVariable(label='Pincode or Zipcode of Candidate') public String Pincode_or_zipcode_of_candidate; @InvocableVariable(label='Summary of Qualifications') public String Summary_of_qualifications; } // Flow Input Wrapper public class DocumentInput { @InvocableVariable(label='Document AI JSON or Raw Data' required=true description='Raw JSON string or Document AI response to process') public String inputKeyValueString; @InvocableVariable(label='Prompt Template API Name' required=true description='API name or ID of the Prompt Template (e.g., Handle_JSON_From_Document_AI or 0hfKZ000000PPrNYAW)') public String promptTemplateApiName; } @InvocableMethod( label='Extract Document AI Details' description='Parses a Document AI response or key-value pair string into candidate details' ) public static List extractDetails(List requests) { List results = new List(); for (DocumentInput req : requests) { ExtractedDetails output = new ExtractedDetails(); try { // Validate that prompt template API name is provided if (String.isBlank(req.promptTemplateApiName)) { throw new AuraHandledException('Prompt Template API Name is required. Please provide the API name or ID of your prompt template.'); } // === 1. Call Einstein Prompt Template to normalize the input === ConnectApi.EinsteinPromptTemplateGenerationsInput promptGenerationsInput = new ConnectApi.EinsteinPromptTemplateGenerationsInput(); promptGenerationsInput.isPreview = false; Map valueMap = new Map(); ConnectApi.WrappedValue wrappedInput = new ConnectApi.WrappedValue(); wrappedInput.value = req.inputKeyValueString; valueMap.put('Input:inputString', wrappedInput); promptGenerationsInput.inputParams = valueMap; promptGenerationsInput.additionalConfig = new ConnectApi.EinsteinLlmAdditionalConfigInput(); promptGenerationsInput.additionalConfig.applicationName = 'PromptTemplateGenerationsInvocable'; // Use the provided prompt template API name instead of hardcoded ID ConnectApi.EinsteinPromptTemplateGenerationsRepresentation generationsOutput = ConnectApi.EinsteinLLM.generateMessagesForPromptTemplate( req.promptTemplateApiName, promptGenerationsInput ); if (generationsOutput == null || generationsOutput.generations.isEmpty()) { throw new AuraHandledException('No response returned from Einstein LLM. Please verify your Prompt Template is active and configured correctly.'); } String rawResponse = generationsOutput.generations[0].text; System.debug('Prompt response (raw): ' + rawResponse); // === 2. Parse returned key-value pairs === List pairs = rawResponse.split(';'); Map kvMap = new Map(); for (String pair : pairs) { pair = pair.trim(); if (String.isNotBlank(pair) && pair.contains(':')) { List kv = pair.split(':', 2); // split only on first colon String key = kv[0].trim(); String value = kv.size() > 1 ? kv[1].trim() : ''; kvMap.put(key, value); } } // === 3. Map values to output fields === // Map based on exact keys from prompt template output output.First_name = kvMap.get('First_name'); output.Last_name = kvMap.get('Last_name'); output.Email_address_of_candidate = kvMap.get('Email_address_of_candidate'); output.Phone_number_of_candidate = kvMap.get('Phone_number_of_candidate'); output.Street_address_of_candidate = kvMap.get('Street_address_of_candidate'); output.City_of_candidate = kvMap.get('City_of_candidate'); output.State_or_province_of_Candidate = kvMap.get('State_or_province_of_Candidate'); output.Country_of_candidate = kvMap.get('Country_of_candidate'); output.Pincode_or_zipcode_of_candidate = kvMap.get('Pincode_or_zipcode_of_candidate'); output.Summary_of_qualifications = kvMap.get('Summary_of_qualifications'); } catch (Exception e) { System.debug('Error processing Document AI details: ' + e.getMessage()); System.debug('Stack trace: ' + e.getStackTraceString()); // Return empty results to allow flow to continue } results.add(output); } return results; } } ``` You now have two Apex classes to use in the next steps: - `dE_DataCloudIDPFlowAction` - `dE_ExtractDocumentAIDetails` ## Next Step - [Step 4 - Create the Screen Flow](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-screen-flow.md): Create a new screen flow in Flow Builder to orchestrate Document AI and update the Contact record. # Step 3: Build Agentforce Agent Now that you have the Agentforce Data Library set up and your individual retriever configured in Intelligent Context, it's time to build an Agentforce agent that answers user questions based on your visual data. This guide shows how to set up an employee agent that uses the unstructured data files and retriever configurations you created in the previous steps. While this example focuses on an employee agent, you can apply the same approach to other agent types, such as service agents for customer-facing scenarios. See more examples in [Retail Solution Powered by Data 360 – DIY Store Front](https://github.com/salesforce-misc/Data360AgentforceSolutionKitRetail). ## 1. Build and Test a Prompt in Prompt Builder Prepare a prompt for the agent to define how it behaves, what sources it uses, how it responds when information is missing, and how it formats the final answer. ### Prompt Parts Include these two parts in your prompt: 1. Instructions and guidance for the LLM. 2. Two parameters to allow the model to generate answers based on your indexed content and not on general model knowledge. - **Question**: The question coming from the user through the agent, a free-text input that receives the user's question from the agent. - **Retriever**: The content the retriever returns from the search index. This retriever output passes the relevant chunks and metadata from the search index into the prompt. ### Prompt Considerations As you build your prompt, consider the following. - Be explicit about what sources the model is allowed to use. - Clearly define what should happen when the retriever doesn't return a good answer. - Specify whether the answer should include citations or source URLs. - Tailor the formatting to the expected end-user experience. - Keep the instructions focused on the actual role of the agent. #### Prompt Example ```text Objective: You are an AI expert. When a customer asks questions related to building a deck, provide a helpful answer. Prompt Rules: 1. Begin the response with exactly one catchy, customer-friendly paragraph that are directly related to the customer's specific deck-building question. - The paragraph must clearly reference the topic of the question and the tone should be enthusiastic and encouraging, as if guiding the customer through their project and display exactly 10 lines. - Do not shorten, merge, or combine lines. 2. Display all the information in the response. 3. Display all the installation steps exactly. Do not change the wording, and do not skip any step for each category. 4. Do NOT mix content from different items. 5. Your tone should be friendly and informative, as if speaking directly to the customer. 6. Ensure that your response is relevant to the specific question asked. 7. Do NOT add any extra words, explanations, summaries, or commentary beyond the retrieved content. 8. Do NOT use JSON. Use plain text only. Question:{!$Input:Question} You can use following information to answer:{!$EinsteinSearch:Building_a_Deck_Retriever_1Cx_96bc9aaf8da.results} ``` ## 2. Build the Prompt Template The prompt template defines how the agent uses the retrieved data to answer a user. After you configure the prompt, it follows this work process. - The user's question is passed into the prompt through Query. - The same question is used as the retriever's search text. - The retriever returns the most relevant results from the indexed website content. - These results are passed into the prompt as Knowledge Base Information. - The LLM uses both the question and the retrieved content to generate a grounded answer. It keeps the response tied to your indexed website content instead of relying on general model knowledge. To build the prompt template: 1. From the Data 360 app, find and select **Agentforce Studio** on the quick search bar. 2. From the menu in the left, select **Prompt Template**. 3. Click **New Prompt Template**. 4. Select the **Flex** template type. 5. Name the template and define the **Input**: - Create an input named **User Query**. - Set Type to **Free Text**. - Click **Next**. 6. In the Prompt Editor, paste your main prompt instructions into the prompt body. 7. Insert the Query and Retriever parameters to the bottom of the prompt: - To add the query parameter, click **Insert Resource** and select **User Query**. - To add the individual retriever you created, click **Insert Resource**, then click **Retrievers** and then **Configure Retrievers**. 8. Configure the Retriever within the prompt: - On the **Resources** tab on the left, select your individual retriever from the list, for example: **ADL_deck Retriever**. - Scroll down to **Search Parameters**. - Under **Search Text**, search and enter **User Query**. - Select the DMO output fields: **Chunk**. - Click **Apply and Insert**, and then **Save and Preview**. 9. To test your prompt, click the **Preview Settings** icon on the left menu, and enter a sample user question under **User Query**. 10. Validate that these results are taking place. - The retriever returns relevant results. - The answer is grounded in the indexed content. - The response format follows your instructions. - Fallback behavior works when no relevant content is found. If the results are weak, refine the prompt wording, retriever configuration, or indexing approach before you activate your agent. ## 3. Create an Agent Action from Prompt Template Create an action from the prompt template that you created. Assign the action to a subagent, and then assign the subagent to your agent. This is a bottom-up approach, but you can use a top-down approach if it better suits your use case. ### Create a New Action 1. Go to **Setup**. 2. In the quick search box, find and select **Agentforce Assets**. 3. In **Agentforce Assets**, go to the **Actions** tab, and then click **+New Agent Action**. 4. On **Create an Agent Action**, for **Reference Action Type**, enter **Prompt Template**. 5. For **Reference Action**, select the prompt template that you created in step 2: Build the Prompt Agent. 6. Enter **Agent Action Label** and **Agent Action API Name**. 7. Click **Next**. ### Configure the Action Under **Agent Action Configuration**, enter the key information to configure the action. 1. **Agent Action Description**: Describe what the action does and when it's used. For example: `Execute when a customer asks a question related to building a deck, and display exact prompt response`. 2. **Loading Text**: Enter the message shown to users while the agent is generating answers. For example: `Thinking…` 3. **Inputs**: - Under **Query** - **Description**: Describe the context for this action, such as business-specific acronyms or process definitions. For example: `An AI-generated string to be used in the knowledge article search`. - Select **Collect data from user**. 4. **Outputs**: Under **Prompt Response**, select **Show in conversation**. 5. Click **Finish** to save your action configurations. ### 4. Create a New Subagent Define a subagent and assign your action to it. 1. In **Agentforce Studio**, go to the **Subagents** tab, and then click **+New Subagent**. 2. Enter a **Name** and **API Name** that describe what the agent does in plain language. For example: `Answer questions with knowledge from Building a Deck Project Installation Instructions`. 3. **Classification Description**: Describe what the subagent does and the types of user requests that should be classified into this subagent. This describes what user messages should trigger this subagent. For example, `Handle customer queries related to how to build a deck and provide the information about it`. 4. **Scope**: Define what the agent is allowed to do within a subagent context. The scope sets boundaries on the subagent's capabilities and access to data or actions. For example, `Your job is only to assist customers with queries related to building a deck and perform the associated action and display the response. You should not handle unrelated topics or provide information outside of DIY Projects`. 5. **Instructions**: Add guidelines that tell your agent how to handle conversations in the context of the subagent, your business case, and the conversation in general. Each instruction is a single subagent-specific guideline. For example, `If customer asks building a deck queries, then run the action 'Building Deck Prompt' and display exact prompt response`. Learn [best practices for subagent instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_instructions.htm&type=5). 6. Click **Next**. 7. Before you create the subagent, select the action that you created to include it in your subagent. Learn more about [adding an action to a subagent from the asset library](https://help.salesforce.com/s/articleView?language=en_US&id=ai.agent_actions_add_asset_library.htm&type=5). 8. Click **Finish** to save your changes. ## 5. Create an Employee Agent Now that you have a subagent and action that are grounded on your prompt and individual retriever, assign them to your agent to allow it to use them when called. This example is of an employee agent, but the basic process is the same for other types of agents. - Learn more about [creating an agent from an Agentforce employee agent template](https://help.salesforce.com/s/articleView?id=ai.agent_employee_agent_setup.htm&type=5). - Learn more about [agent types and considerations](https://help.salesforce.com/s/articleView?id=ai.agent_setup_explore_types.htm&type=5). 1. From the **App Launcher**, find and select the **Agentforce Studio** app. 2. On the **Agents** tab, click **New Agent**. 3. Select an **Agentforce Employee** agent template. Enter the agent's name and then click **Let's Go**. 4. In the **Settings** section, define the settings that determine how your agent behaves in conversations, such as system messages and language settings. 5. On the left, hover over **Subagents** and click the **+** button. 6. Select **Add from Asset Library**. 7. Find the tile for the subagent you created. You can click **Details** to make sure it's assigned with the action you created. 8. Click **Select** and then **Add to Agent**. 9. In the **Data** section, select your Salesforce Data Library. The **Answer Questions with Knowledge** action grounds your agent's responses with it. 10. Test your agent. Enter queries the agent should handle on the **Preview** tab to confirm that it runs your prompt and returns answers that match the expected format and content. For more details about testing, see [Preview and Test in Agentforce Builder](https://help.salesforce.com/s/articleView?id=ai.agent_preview_and_test.htm&language=en_US&type=5). 11. To give your users access to your agent in Lightning Experience and mobile, see [Manage Employee Agent Access](https://help.salesforce.com/s/articleView?id=ai.agent_manage_aea_access.htm&type=5). 12. Optionally, connect your agent to [Enhanced Web Chat v1 or Slack](https://help.salesforce.com/s/articleView?id=ai.agent_deploy_enhanced_chat_v1.htm&type=5#connect_aea_v1). 13. When you're ready, [activate your agent](https://help.salesforce.com/s/articleView?id=ai.copilot_setup_activate_deactivate.htm&type=5). # Step 3: Create Search Index and Retriever After confirming that Data 360 ingests your website content, help Agentforce search your data at run time to provide your users with relevant answers reliably. Create a customized search index with parsing and chunking tuned to your content formats and page structure. Also create a retriever that Agentforce uses to pull relevant passages back into the model. ## 1. Create Search Index The search index helps Data 360 find relevant passages in your content. Use the next procedure as a pattern, but apply parsing, file-type, and chunking choices that match the content types and page shapes of your site. Consider your site pages’ typical length and complexity (plain text versus tables, diagrams, or dense layouts). For example, long pages or pages with heavy structure often need a different chunking strategy than short, sectioned help-center HTML. 1. On the Data Cloud app, select the **Search Index** tab. 2. To create a search index, click **New**, and then select **Advanced Setup**. 3. For **Search Type**, select **Hybrid Search**. 4. Under **Select Source Object**, select the relevant data space and your connector name, and click **Next** to proceed to **Parsing**. ### Define Parsing and Chunking Strategy Make sure that your data is broken down correctly so the LLM can process it effectively. Data 360 splits your data into chunks, converts them into vector embeddings, and stored this in a Vector Data Model Object (VDMO). This process enables the retriever to search efficiently and improve answer quality. Consequently, make sure to select an embedding model that supports your chunk size. The following section-aware chunking strategy helps preserve the structure of the source page. The 1,200 token limitation gives the chunks enough context without making them unnecessarily large, and the embedded model supports this chunk size. No overlap tokens keeps the chunk set cleaner when site pages are well structured. Title prepending gives each chunk more context, which can improve retrieval quality. 1. On **Parsing**, select the default option, **Default Parser**. 2. Select the default option, **No Pre-Processing**. 3. On **Select Files to Chunk**, remove unnecessary file extensions to keep only the ones you want to ingest. 4. Per file extension, configure chunking: - **Chunking Strategy:** Section Aware Chunking - **Max Tokens:** 1,200 - **Overlap tokens:** 0 - **Prepend fields to each chunk:** Select **Title** 5. Select the embedding model (**Vectorization Strategy):** **Salesforce Embedding V2 Small**. This embedding model supports 1,200-token chunk size (also referred to as **SFR-v2-small**). If you choose a smaller chunk size, like 512 tokens, use a model with a smaller supported sequence length. 6. Click **Next** and continue to save your changes. ## 2. Verify Chunk Creation After the index finishes successfully, confirm that chunk records are created and that they appear consistently with the source content you ingested. This validation step is important to confirm that the expected chunk data exists and is ready for retrieval. 1. In Data 360, go to **Data Explorer**. 2. Select a **Data Space**. 3. For **Object**, select **Data Lake Object**. 4. Locate the chunks object associated with your index. ## 3. Set Up Individual Retriever The retriever queries your indexed content and returns the relevant chunks to the LLM at run time. In this scenario, create an individual retriever and configure it to return the fields that are most useful for grounding and citations. 1. From the Data 360 app, find and select **Agentforce Studio** on the quick search bar. 2. Go to the **Agents** tab. 3. From the **Build** menu in the left, select **Data** and then select **Retrievers**. 4. Click **New Retriever**. 5. For retriever type, select **Individual Retriever** and click **Next**. 6. Select **Data Cloud** as the data source for the new retriever. 7. Define Retrieval Details: - **Data Space:** Select the relevant data space. - **Source Object:** Select your connector. - **Search Index:** Select the search index you created and click **Next**. 8. Define filters: Select **All Documents** and click **Next**. 9. Under **Fields to Return**, select: - URL - Title - Chunks 10. Enable **Citation Settings** to ensure the agent can show its sources and click **Next**. 11. Save your changes and retriever details, and then **Activate**. ## Before You Continue By the end of this step, make sure that you have: - A search index configured for the ingested HTML content - Verified chunk records created from that content - An active retriever connected to the index - Citation-ready fields available for the agent ## Next Step - [Step 4: Build and Test a Prompt in Prompt Builder](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-prompt.md): Build and test the Flex prompt that connects the user’s question to retrieved website content. # Step 4 - Create Bank Statement Extraction Flow (Apex Wrapper) Create a screen flow to invoke your Apex method that extracts data from the customer’s bank statement. ## 1. Create a New Flow On the **App Launcher**, create a new flow to extract data from the customer’s bank statement. 1. From the **App Launcher**, select **Flows**. 2. Click **New** to create a new flow. 3. Select the **Autolaunched Flow (No Trigger)** automation. ## 2. Add Your Apex Action to the Flow 1. In the Flow Builder, under **Autolaunched Flow**, click the **\+** button. 2. Select **Action**, and search for your Apex method under **Search Actions** on the right (Run Bank statement analysis using DataCloud Document AI). 3. Enter a flow label: `Bank_Statement_Extraction`. ## 3. Create Input Variables 1. Open the toolbox on the top left and click **New Resource** to create input variables. 2. The **New Resource** modal opens. Select Variable as **Resource Type**. 3. Enter `ContactEmail` as **API Name**. 4. Select Text as **Data Type**. 5. Check the checkbox next to **Available for input**. 6. Click **Done**. 7. Repeat steps 2-7 for these items: - `Org_Domain` - `Client_Id` - `Client_Secret` - `Document_Type` - `LLM_Model` - `ContentDocumentId` - `IDPConfigId` ## 4. Create Output Variables 1. Open the toolbox on the top left and click **New Resource** to create output variables. 2. In the **New Resource** modal, Select Variable as **Resource Type**. 3. Enter `Status` as **API Name**. 4. Select Text as **Data Type**. 5. Select **Available for output**. 6. Click **Done**. 7. Repeat steps 2-7 for these items: - `ExtractedDataJson` - `ErrorMessage` ## 5. Map Inputs and Store Outputs 1. Under **Set Input Values** on the right, enter these values to map the inputs. - Org_Domain → {\!Org_Domain} - Client_Id → {\!Client_Id} - Client_Secret → {\!Client_Secret} - Document_Type → {\!Document_Type} - LLM_Model → {\!LLM_Model} - ContentDocumentId → {\!ContentDocumentId} - IDPConfigId → {\!IDPConfigId} ![Input Mapping](https://developer.salesforce.com/docs/media/loan-agent-input-mapping.png '{"class": "image-framed"}') 2. Under **View Output Resources**, select **Manually assign variables (advanced)**. 3. Under **Store Output Values**, enter these values. - Status → {\!Status} - ExtractedDataJson → {\!ExtractedDataJson} - ErrorMessage → {\!ErrorMessage} ![Output Storing](https://developer.salesforce.com/docs/media/loan-agent-output-storing.png '{"class": "image-framed"}') ## 6. Save and Activate the Flow 1. Click the **Save** button, and save the flow as: `Bank_Statement_Extraction`. 2. On the saving modal, go to **Show Advanced**. Under **How to Run the Flow**, select **System Context Without Sharing–Access All Data**. 3. Click **Save**. 4. On the top right, click **Activate** to activate the flow. ## Next Step - [Step 5 - Create the Loan Prequalification Employee Agent](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-create-loan-prequalification-agent.md): Build your loan prequalification agent. # Step 4 - Create the Screen Flow Here is where everything comes together. In this step, you create a screen flow that orchestrates the entire Document AI process to extract data from resumes. After you build and activate the flow, it: - Retrieves the current Contact record. - Gets the latest document attached to the Contact. - Extracts the document name. - Calls Document AI to process the document. - Parses the JSON output. - Displays extracted data on a screen for user review and editing. - Updates the Contact record with the extracted (and potentially edited) information. ## Create a New Flow 1. On the **App Launcher**, find and select **Flows**. 2. Click **New** to create a new flow. 3. Under **Categories** select **Screen Automations**, and under **Types** select **Screen Flow**. The Flow Builder opens. Continue to add elements to set the actions the flow will execute. See [Step 5 - Create Flow Elements](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-flow-elements.md). ## Next Step - [Step 5 - Create Flow Elements](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-flow-elements.md): Add actions for the flow to execute. # Step 4: Build and Test a Prompt in Prompt Builder Now that Data 360 ingests and indexes your website content, and you've connected a retriever, create a prompt to tell the LLM how to answer questions using your retrieved content. The prompt defines how the model behaves, what sources it uses, how it responds when information is missing, and how the final answer is formatted. ## 1. Prepare Your Prompt ### Prompt Parts Include these two parts in your prompt: 1. Instructions and guidance for the LLM. 2. Two parameters to allow the model to generate answers based on your indexed website content and not on general model knowledge. - **User’s Question:** The question coming from the user through the agent. This is a free-text input that receives the user’s question from the agent. - **Knowledge Base Information:** The content the retriever returns from the search index. This is the retriever output. It passes the relevant chunks and metadata from the search index into the prompt. ### Prompt Considerations As you build your prompt, consider the following. - Use the next example as a starting point for your prompt. - Replace the example retriever resource name with the retriever you created for your search index. Adapt it to your own site, agent type, intended audience, and expected agent response. - Be explicit about what sources the model is allowed to use. - Clearly define what should happen when the retriever doesn't return a good answer. - Specify whether the answer should include citations or source URLs. - Tailor the formatting to the expected end-user experience. - Keep the instructions focused on the actual role of the agent. **tip:** To adjust the next prompt example to your own use case, you can prompt your choice of LLM to rewrite it for your specific site and other considerations. Here are some example modifications. - Replace Cirrus-specific language with your product or company terminology. - Adjust the tone from technical support to customer service, internal help desk, or product guidance. - Change the fallback behavior when no answer is found. - Change the response format. - Add or remove guardrails depending on what the agent should or should not answer. ### Prompt Example Cirrus designs this product support prompt, where the model provides answers using only the indexed Cirrus content. ```text Instructions for Answering: Product Questions: If the user asks about a product, provide a clear summary of the product, its main use case, and any key specifications available in the retrieved content. Comparison Requests: If the user asks to compare products, use only the retrieved Cirrus product information and clearly explain the main differences. Recommendations: If the user asks which product is right for them, base the answer only on the retrieved product content and the user's stated needs. Out-of-Scope: If the question is about pricing negotiations, order status, or information not included in the Cirrus product content, respond with: "I can only answer based on the Cirrus product information available in the connected knowledge source." Handle Lack of Information: If the Knowledge Base Information does not contain a relevant match, respond with: "I couldn't find a matching Cirrus product page for that request. Please try rephrasing the question or asking about a specific product." Generate the response using the following process: 1. Review the User's Question to identify the product or category being asked about. 2. Review the Knowledge Base Information to extract the most relevant product details. 3. Synthesize the retrieved information into a clear and helpful answer. Response formatting instructions: - Use bullet points for product highlights. - Use numbered steps only when the user asks for a process or comparison. - Use bold text to emphasize product names and important terms. - Always include the source URL at the end of the response. User's Question: {!$Input:Query} Knowledge Base Information: {!$EinsteinSearch:your_retriever_name.results} ``` ## 2. Build the Prompt Template The template defines how the agent uses the retrieved data to answer a user. After the prompt is configured, it follows this work process. - The user’s question is passed into the prompt through Query. - The same question is used as the retriever’s search text. - The retriever returns the most relevant results from the indexed website content. - These results are passed into the prompt as Knowledge Base Information. - The LLM uses both the question and the retrieved content to generate a grounded answer. It keeps the response tied to your indexed website content instead of relying on general model knowledge. To build the prompt: 1. From the Data 360 app, find and select **Agentforce Studio** on the quick search bar. 2. From the menu in the left, select **Prompt Template**. 3. Click **New Prompt Template**. 4. Select the **Flex** template type. 5. Name the template and define the **Inputs**: - Create an input named **User Query**. - Set Type to **Free Text**. - Click **Next**. 6. In the Prompt Editor, click **Insert Resource** to add your prompt. 7. Paste your main prompt instructions into the prompt body. 8. Insert the Query and Retriever parameters to the bottom of the prompt. - To add a User Query parameter, click **Insert Resource** on top, and select **User Query**. - To add a Knowledge Base Information parameter, click **Insert Resource** on top, and select **Retrievers** and then **Configure Retrievers**. 9. Configure the Retriever within the prompt: - On the **Resources** tab on the left, select your retriever from the list. - Scroll down to **Search Parameters**. - Under **Search Text**, search and enter **User Query**. - Select the output fields: URL, Title, Chunks. - For **Number of Results**, select **10**. - Click **Apply and Insert**, and then **Save and Preview**. 10. To test your prompt, click the **Preview Settings** icon on the left menu, and enter a sample user question under **User Query**. 11. Validate that these results are taking place. - The retriever returns relevant results. - The answer is grounded in the indexed content. - The response format follows your instructions. - Citations or source URLs appear as expected. - Fallback behavior works when no relevant content is found. If the results are weak, refine the prompt wording, retriever configuration, or indexing approach before you activate your agent. ## Next Step [Step 5: Implement the Prompt Template in Your Agent](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-implement-prompt-template-in-agent.md): Create an action from the prompt template, create a subagent, and assign them to your agent. # Step 5 - Create Flow Elements Create the Flow Builder elements to set the actions that the flow executes. ## 1. Create a Flow Element to Get Current Contact Record 1. On the flow you created in [Step 4 - Create the Screen Flow](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-screen-flow.md), click the **+** button, search and select the **Get Records** element. 2. Configure the **Get Records** element: - **Label:** Get Current Contact Record - **Data Source:** Salesforce Object - **Object:** Contact - **Filter Contact Records:** - **Field:** Contact ID - **Operator:** Equals - **Value:** +New Resource: - **Resource Type:** Variable - **API Name:** `recordId` - **Data Type:** Text - Under **Availability Outside the Flow**, select **Available for input** and **Available for output**. - Click **Done**. 3. Click **Save** to save the Get Records element. 4. Name your flow (for example, **Document AI Flow for Resumes**). 5. Click **Save** to save the element. ## 2. Create a Flow Element to Get Content Document Link Record 1. After the **Get Current Contact Record** element, click the **+** button, search and select the **Get Records** element. 2. Configure the **Get Content Document Link Record** element: - **Label:** Get Content Document Link Record - **Data Source:** Salesforce Object - **Object:** Content Document Link - **Filter Content Document Link Records:** - **Field:** LinkedEntityId - **Operator:** Equals - **Value:** `recordId` - **Sort Order:** Descending - **Sort By:** SystemModstamp - **How Many Records to Store:** Only the first record - **How to Store Record Data:** Choose fields and assign variables (advanced) - **Select Variable to Store Content Document Link Fields:** - **Record**: +New Resource - **Resource Type:** Variable - **API Name:** `ContentDocId` - **Data Type:** Text - Under **Availability Outside the Flow**, select **Available for input** and **Available for output**. - Click **Done**. - **Where to Store Field Values:** In separate variables. - **Select Variables to Store Content Document Link Fields**: - **Field:** ContentDocumentId - **Variable:** ContentDocId 3. Click **Save** to save this element. ## 3. Create a Flow Element to Get Content Document Name 1. After the **Get Content Document Link Record** element, click the **+** button, search and select **Get Records**. 2. Configure the **Get Content Document Name** element: - **Label:** Get Content Document Name - **Data Source:** Salesforce Object - **Object:** ContentDocument - **Filter Content Document Records:** - **Field:** ContentDocumentId - **Operator:** Equals - **Value:** `ContentDocId` - **How Many Records to Store:** Only the first record - **How to Store Record Data:** Choose fields and assign variables (advanced) - **Select Variable to Store Content Document:** - **Record**: + New Resource - **Resource Type:** Variable - **API Name:** `fileName` - **Data Type:** Text - Under **Availability Outside the Flow**, select **Available for input** and **Available for output**. - Click **Done**. - **Where to Store Field Values:** In separate variables. - **Select Variables to Store Content Document Fields**: - **Field:** Title - **Variable:** fileName 3. Click **Save** to save this element. ## 4. Create a Flow Element to Add the Document AI Apex Action This action invokes the Document AI Apex action you created in [Step 3 - Create Apex Classes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-apex-classes.md). 1. After the **Get Content Document Name** element, click the **+** button, search and select **Action**. 2. Search and select the Apex class you created: **de_DataCloudIDPFlowAction**. 3. Give the action a descriptive label (for example, **Document AI Apex Action**). 4. Set the input parameters: - **Client ID:** Your consumer key from [Prerequisite 1 - Create and Configure an External Client App](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-external-client-app.md). - **Client Secret:** Your client secret from [Prerequisite 1 - Create and Configure an External Client App](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-external-client-app.md). - **Content Document ID:** `ContentDocId` - **Document Type:** `application/pdf` (default) - **Enter Org Domain:** Your domain URL with the `https://` prefix from [Prerequisite 2 - Retrieve Your Salesforce Domain URL](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-retrieve-sf-domain-url.md). - **IDP Config:** Ensure it's toggled to **included** and enter `resume_config` (or the API name you used in [Step 1: Create a Document AI Configuration to Process Resumes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-document-ai-schema-config.md)). 5. Click **Save** to save this element. ![Enrich from File Action](https://developer.salesforce.com/docs/media/resume-document-ai-apex-action.png '{"class": "image-framed"}') ## 5. Create a Flow Element to Handle JSON Output This action invokes the prompt template you created in [Step 2 - Create a Prompt Template in Prompt Builder](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-prompt-template.md). 1. After the **Document AI Apex Action** element, click the **+** button, search and select **Action**. 2. Search and select the second Apex class you created in [Step 3 - Create Apex Classes](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-apex-classes.md): **de_ExtractDocumentAIDetails**. 3. Configure the action: - **Label:** Handle JSON Output - **Set Input Values:** - **Document AI JSON or Raw Data**: Select the output from the previous Apex action (**Outputs from Document AI Apex Action**) and then select **Extracted Data (JSON)**. - **Prompt Template API Name**: Enter the ID of the prompt template you created in [# Step 2 - Create a Prompt Template in Prompt Builder](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-prompt-template.md). 4. Set the input parameters: - **Document AI JSON and Raw Data:** Output from the previously defined Apex action (element 4). - **Prompt template API Name:** The ID from the prompt template created in [Create a New Prompt Template](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-prompt-template.md). 5. Click **Save** to save this element. ![Enrich from File Action](https://developer.salesforce.com/docs/media/resume-handle-json-output.png '{"class": "image-framed"}') ## 6. Create a Flow Element to Display Extracted Data With this flow element, you can review and edit the extracted data before it updates the Contact record. 1. After the **Handle JSON Output** element, click the **+** button, find and select **Screen**. 2. Select **Screen**. 3. In the **Components** tab, find and select **Text**. 4. In the **Properties** tab, set the component label, for example: **First Name**. 5. Under **Default Value** find and select the corresponding Apex value from the second Apex class you created: [Extract Resume Details with Document AI](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-apex-classes.md). For example: **Outputs from Handle_JSON_Outout** > **First_name**. 6. Click **Finish**. 7. Repeat steps 3-5 for each component. | Label | Map to Apex value | | ------------------------- | ------------------ | | First Name | (from Apex output) | | Last Name | (from Apex output) | | Email Address | (from Apex output) | | Phone Number | (from Apex output) | | Street Address | (from Apex output) | | City | (from Apex output) | | State or Province | (from Apex output) | | Country | (from Apex output) | | Pin Code or Zip Code | (from Apex output) | | Summary of Qualifications | (from Apex output) | 8. After you have on your screen a text field for each of these items, click **Done**. ![Enrich from File Action](https://developer.salesforce.com/docs/media/resume-screen-fields.png '{"class": "image-framed"}') ## 7. Create a Flow Element to Update Contact Record 1. After the **Screen\*\*** element, click the **+** button. 2. Find and select **Update Records**. 3. Configure the element: - **Label:** Update Contact Record - **How to Find Records to Update:** Specify conditions to identify records, and set fields individually - **Object:** Contact - **Filter Contact Records:** - **Field:** Contact ID - **Operator:** Equals - **Value:** `recordId` - **Set Field Values for the Contact Record:** Map each field in the table to the corresponding output from the Screen element. For example: For **Mailing City** Select **Raw Output from Document AI** > **City**. | Contact Field | Screen / Source Value | | ----------------- | ------------------------- | | MailingCity | City | | MailingState | State or Province | | MailingCountry | Country | | MailingStreet | Street Address | | MailingPostalCode | Pin Code or Zip Code | | Description | Summary of Qualifications | | Email | Email Address | | MobilePhone | Phone Number | 4. Click **Save** to save the element. 5. Click **Activate** to make the flow available for use. ![Loan Agent on Sales Cloud](https://developer.salesforce.com/docs/media/resume-update-contact-record-element.png '{"class": "image-framed"}') ## Next Step - [Step 6 - Add the Flow as a Quick Action Button on Contact Page](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-add-quick-action-button.md) — Add the Enrich from File button to the Contact page and test. # Step 5 - Create the Loan Prequalification Employee Agent Agentforce Employee agents help employees find information, complete tasks, and access personalized support across channels. Use Agentforce Employee agent templates to build agents that serve specific departmental needs, support role-based access, and scale securely across the organization. Unlike other agent templates, Employee agents are designed for internal employees, run in the logged-in user context, and can be created as multiple agents that you assign to specific profiles or users. [See more considerations for Agentforce Employee agent](https://help.salesforce.com/s/articleView?id=ai.agent_employee_agent_considerations.htm&type=5). ## Create an Agent 1. Go to **Setup**. 2. In the Quick Find search bar, find and select **Agentforce Agents**. 3. Click the **New Agent** button on the top right. 4. Select **Agentforce Employee Agent** and click **Next**. 5. Remove **General FAQ** from topics and click **Next**. 6. Enter the agent details and click **Next**. - **Agent Name**: Loan Pre-Qualification. - **API Name**: `Loan_prequalification` - **Description**: This topic is selected when a user requests assistance in analyzing their bank statement for loan prequalification. It includes evaluating financial data and providing loan recommendations. It also updates the contact's description with the final analysis. - **Role**: Your job is to only analyze the attached bank statement data, evaluate financial information, and provide a detailed loan recommendation. You aren't able to finalize loan approvals or handle unrelated inquiries. - **Company**: Enter your company name and provide relevant information about its product and business details. 7. Skip data sources selection. 8. Click **Create**. ## Create a Topic 1. On the Agent Builder, click **New** and then **New Topic**. 2. Enter topic description (optional) and click **Next**. 3. Enter these topic details. - **Name**: Bank Statement Analysis for Loan Pre-Qualification - **API Name**: `Bank_Statement_Analysis_for_Loan_Pre_Qualification` - **Classification Description**: This topic is selected when a user requests assistance in analyzing their bank statement for loan pre-qualification. It includes evaluating financial data and providing loan recommendations - **Scope**: Your job is to only analyze the attached bank statement data, evaluate financial information, and provide a detailed loan recommendation. You aren't able to finalize loan approvals or handle unrelated inquiries - **Instructions**: Add each instruction separately - If the query involves analyzing a bank statement, extract the bank statement data from the Contact record - Use Document AI to analyze the bank statement - Provide a detailed loan recommendation based on the analysis use AI for analyzing AI analysis 4. Click **Finish**. ![Create Topic](https://developer.salesforce.com/docs/media/loan-agent-create-topic.png '{"class": "image-framed"}') ### Next Step [Add actions](https://developer.salesforce.com/docs/ai/loan-agent/guide/aes-add-actions.md) to your agent to give it the tools to get its job done. # Step 5: Implement the Prompt Template in Your Agent Now that you have a tested prompt template, it's time to implement it in your Agentforce agent to provide users with answers based on your custom data, including source citations for user trust. This workflow is bottom-up. First, create an action from the prompt template. Then, create a subagent. Lastly, assign the subagent and action to an agent. You can use an existing agent or build one that's suited for your needs. ## Prepare Action and Subagent Key Definitions A subagent is a particular job that an agent can do and an essential element of an agent's reasoning. A subagent contains actions, which are the tools available for the job, and instructions, which tell the agent how to make decisions. Collectively, the subagents assigned to your agent define the capabilities your agent can handle. Identify your subagent and action, and then draft the information required for setup. Preparing these definitions in advance streamlines the configuration process and leads to better results. - Learn more about [identifying subagents and actions](https://help.salesforce.com/s/articleView?id=ai.agent_plan_action_identify.htm&type=5). - Learn more about [the subagent's different parts](https://help.salesforce.com/s/articleView?language=en_US&id=ai.copilot_topics.htm&type=5). **Subagent Description**: Describe what the subagent does overall. **Subagent Action Description**: Describe what the specific action (task) does and when it's used. **Subagent Classification Description**: Describe what the subagent does and the types of user requests that are to be classified into this subagent. In other words, describe what user messages should trigger this subagent. **Subagent Scope**: Define what the agent is allowed to do within a subagent context. The scope sets boundaries on the subagent's capabilities and access to data or actions. ### Example Cirrus plans its agent's subagent and action. Their purpose is to get the subagent to answer questions about Cirrus products by using public product content from the Cirrus website. **Subagent Description**: A support subagent for Cirrus Energy that answers questions about Cirrus renewable energy products by using public product content from the Cirrus website. The subagent helps users understand product categories, product differences, and key product details. **Agent Action Description**: When the user asks about Cirrus Energy products, including solar panels, batteries, starter sets, or small turbines, this action retrieves information from the indexed Cirrus product pages and returns a grounded answer based on that content only. **Subagent Classification Description**: Use this subagent when the user's intent is to learn about Cirrus products, compare products, understand product specifications, or ask which Cirrus product fits a specific need. User questions include questions about products such as Professional Solar Panel 400W, Starter Set Pro, EcoWind Turbine 500W, batteries, and other products listed on the Cirrus website. **Subagent Scope**: Use this subagent to answer questions about Cirrus product pages and product categories that exist on the public Cirrus website. The subagent can summarize product details, compare products, and answer questions grounded in the indexed product content. It can't answer questions about order status, private account information, billing, or content that doesn't exist in the connected Cirrus product pages. ## Create an Agent Action from Prompt Template Create an action from the prompt template that you created. Assign the action to a subagent, and then assign the subagent to your agent. This is a bottom-up approach, but you can use a top-down approach if it better suits your use case. ### Create a New Action 1. Go to **Setup**. 2. In the quick search box, find and select **Agentforce Assets**. 3. In **Agentforce Assets**, go to the **Actions** tab, and then click **+New Agent Action**. 4. On **Create an Agent Action**, for **Reference Action Type**, enter **Prompt Template**. 5. For **Reference Action**, select the prompt template that you created in [Step 4: Build and Test a Prompt in Prompt Builder](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-prompt.md). 6. Enter **Agent Action Label** and **Agent Action API Name**. 7. Click **Next**. ### Configure the Action Under **Agent Action Configuration**, enter the key information that you prepared in advance, and complete the other fields. 1. **Agent Action Description**: Enter the subagent action description that you prepared in advance. 2. **Loading Text**: Enter the message shown to users while the agent is generating answers. For example: `Thinking…`. 3. **Inputs**: - Under **Query**: - **Description**: Describe the context for this action, such as business-specific acronyms or process definitions. For example: `An AI-generated string to be used in the knowledge article search`. - Select **Collect data from user**. - Under **Citation Mode**: - **Description**: Tell the agent when to provide citations. For example: `Always use post generation`. - Select **Require input**. - Select **Collect data from user**. 4. **Outputs**: Under **Prompt Response**, select **Show in conversation**. 5. Click **Finish** to save your action configurations. ### 3. Create a New Subagent Define a subagent and assign your action to it. 1. In **Agentforce Studio**, go to the **Subagents** tab, and then click **+New Subagent**. 2. Enter a **Name** and **API Name** that describe what the agent does in plain language. For example: `Answer questions with knowledge from solar site`. 3. **Classification Description**: Enter the Subagent Classification Description that you prepared in advance. 4. **Scope**, enter the subagent scope you prepared in advance. 5. **Instructions**: Add guidelines that tell your agent how to handle conversations in the context of the subagent, your business case, and the conversation in general. Each instruction is a single subagent-specific guideline. For example, see instructions listed under [Prompt Example](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-create-prompt.md). Learn [best practices for subagent instructions](https://help.salesforce.com/s/articleView?id=ai.copilot_topics_instructions.htm&type=5). 6. Click **Next**. 7. Before you create the subagent, select your action to include it in your subagent. Learn more about [adding an action to a subagent from the asset library](https://help.salesforce.com/s/articleView?language=en_US&id=ai.agent_actions_add_asset_library.htm&type=5). 8. Click **Finish** to save your changes. ### 4. Assign the Subagent and Action to Your Agent Now that you have a subagent and action, assign them to your agent to allow it to use them when called. 1. From the **App Launcher**, find and select **Agentforce Studio**. Can't access Agentforce Studio? See [permission issues and troubleshooting](https://help.salesforce.com/s/articleView?language=en_US&id=ai.agent_builder_studio.htm&type=5). 2. From your **Agents** list, open an agent of your choice. Don't have an agent? Follow the steps in the tip. 3. On the left, hover over **Subagents** and click the **+** button. 4. Select **Add from Asset Library**. 5. Find the tile for the subagent you created. You can click **Details** to make sure it's assigned with the action you created. 6. Click **Select** and then **Add to Agent**. **tip:** **How to Create an Agent** If you don't have an agent yet, follow these instructions to create one. This example is of a service agent, but the basic process is the same for other types of agents. - Learn more about [creating an agent from an Agentforce service agent template](https://help.salesforce.com/s/articleView?id=sf.bots_service_intro.htm&type=5). - Learn more about [agent types and considerations](https://help.salesforce.com/s/articleView?id=sf.agentforce_agent_types.htm&type=5). 1. From the **App Launcher**, find and select the **Agentforce Studio** app. 2. On the **Agents** tab, click **New Agent**. 3. Select the **Agentforce Service** agent template. 4. Under **Agent Details**, select or create an **Agent's User Record** for this agent. To securely access data and perform actions, Service agents operate as an agent user: a Salesforce integration user with all the permissions that the agent needs to do its job. See [Best Practices for Agent User Permissions](https://help.salesforce.com/s/articleView?id=sf.bots_service_user_best_practices.htm&type=5). 5. Enter the agent's name and then click **Let's Go**. 6. In the **Agent Definition** section, go to the menu on the left, hover over **Subagents**, and then click the **+** button. 7. Select **Add from Asset Library**. 8. Find the tile for the subagent you created. You can click **Details** to confirm that it's assigned with the action you created. 9. Click **Select** and then **Add to Agent**. ### 5. Test and Troubleshoot the Agent Now that you have an agent with a subagent and action to help it answer user questions and add citations, it's time to test it to confirm that it delivers as expected. Learn more about [testing and troubleshooting your agent](https://help.salesforce.com/s/articleView?id=ai.agent_parent_test.htm&type=5). 1. In **Agentforce Builder**, click **Preview** on the top left. 2. In the test panel, enter a query that your agent can handle. 3. Review the agent's response and confirm that the following is taking place. - The prompt template action runs correctly. - Citations appear in the response. Verify that source references appear correctly and link to the appropriate knowledge articles or web pages. - The answer matches the expected format and content. If citations don't appear or appear incorrectly, review the citation configuration in your prompt template action and confirm that your development environment supports citation collection from prompt templates. If the response doesn't meet expectations, return to the action or subagent configuration and adjust the instructions or input requirements. # Step 6 - Add the Flow as a Quick Action Button on Contact Page Now that you've configured the screen flow, the final step is to make it easily accessible by adding a button to the Contact page. ## 1. Create a Quick Action 1. Go to **Setup**, and click the **Object Manager** tab. 2. In the **Quick Find** search bar, find and select **Contact**. 3. Select the **Contact** object. 4. On the left-hand menu, click **Buttons, Links, and Actions**. 5. Click **New Action**. ## 2. Configure the Action 1. Configure the action with these settings: - **Action Type:** Select **Flow** - **Flow:** From the dropdown list, select **Document AI Flow for Resumes** (or the name of the flow you created in [Step 4 - Create the Screen Flow](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-screen-flow.md) and configured in [Step 5 - Create Flow Elements](https://developer.salesforce.com/docs/ai/automate-resume-processing/guide/aes-create-flow-elements.md)). - **Label:** Enter **Enrich from File**. 2. Click **Save**. ## 3. Add the Button to the Contact Page Layout 1. From the **App Launcher**, find and select **Sales**, and then open the **Contacts** tab. 2. Navigate to any Contact record. 3. Go to the **Setup Menu**, find and select **Edit Page**. 4. On the **Lightning App Builder**, find the **Actions** section on the right. **note:** If you don't see the **Actions** section, upgrade to Dynamic Actions. Click anywhere in the Contact component on the top of the page to open the Highlights right pane, and then click **Upgrade Now** under **Upgrade to Dynamic Actions**. Choose any layout. Learn more about [creating dynamic actions in the Lightning App Builder](https://help.salesforce.com/s/articleView?id=platform.lightning_app_builder_create_dynamic_action.htm&type=5). ![Enrich from File Action](https://developer.salesforce.com/docs/media/resume-enrich-from-file-action.png '{"class": "image-framed"}') 5. Look for the actions available to add, or click **Add Action**. 6. Find and select **Enrich from File**. 7. Click **Done**. ## 4. Reorder the Button 1. For better visibility, drag the **Enrich from File** action to the top of the actions list. 2. Click **Save**. 3. If prompted, click **Activate**, or click the back arrow in Lightning App Builder to return to the Contact page. ## 5. Test Your Implementation 1. In Sales Cloud, navigate to a Contact record. 2. Locate the **Enrich from File** button on the top right of the Contact's **Related** tab (you may need to refresh the page). 3. Go to **Files** and upload a resume document to the Contact record. 4. Click **Enrich from File**. The flow executes, extracts data from the resume, displays it on a screen for review, and updates the Contact record. Congratulations! You have successfully implemented Document AI for resume processing in Salesforce. # Strategize Connection with Web Content (Crawler) Connector Follow these steps to continue strategizing your content ingestion with a Web Content (Crawler) connector. If your site has a relevant sitemap, continue to set up your connector. ## 1. Define the Starting URL and Crawling Depth The Starting URL is the page on your site where Data 360 begins crawling for ingestion when you use the Web Content (Crawler) connector. Crawl Depth is the number of link levels Data 360 follows from that starting URL. For example, if the starting URL is your home page and the crawl depth is 1, Data 360 ingests the home page and the pages it links to directly. At depth 2, it also ingests pages linked from those pages. To find a starting URL and crawl depth: 1. List a few representative pages you want to include in the ingestion, like the sample pages from your strategizing exercise. Open each in the browser and note how you navigate there from a natural entry point like home or a docs landing page. 2. Pick a starting URL that's the highest shared ancestor in that navigation path. This is a single page that is still on the path to your targets but sits as “high” as needed so you don't start deeper than necessary. 3. Set crawl depth to the smallest number that still reaches your target pages from that starting URL: count how many link hops it takes from the starting URL down to the deepest page you need. ### Example Cirrus wants Agentforce to answer questions about TinyTurbine 250W. A representative target page is the product detail page: https://cirrus-static-site.vercel.app/products/small_turbines/tinyturbine-250w.html. From the site navigation, the Products level that covers this and all other products is a practical starting URL: https://cirrus-static-site.vercel.app/products/small_turbines/. With crawl depth 2, Data 360 ingests the Products page, the Small Turbines category page, and every page it links to directly, including the TinyTurbine 250W page and any sibling product pages in that section. ## 2. Strategize Filtering with a Regular Expression After you select the relevant ingestion method and decide on a starting URL and crawl depth, decide how to scope the site ingestion to include only the relevant pages. A simple way to scope content ingestion is by filtering URLs with a regular expression. Prepare a regular expression that matches the pages you want to ingest. For example, if you enter `./content/.`, all pages under the starting URL that include `/content/` in their URL path get ingested. If you don’t specify any included pages, all pages under the starting URL get ingested. ### Example Cirrus only wants to ingest product-related pages. Based on the sample pages they've previously selected, a suitable regular expression pattern is: `._/products/._`. This pattern matches URLs that contain the expression `/products/`, which aligns with Cirrus's content ingestion scope. ## Before You Continue After strategizing your website ingestion, make sure that you have: - Your selected web content connector - The content scope for the agent - The starting URL and crawl depth - The filtering logic to limit ingestion to the relevant pages ### Example Cirrus gathers its findings for its ingestion strategy. - Selected website content connector: Web Content (Crawler) - Content scope: Product-related - Starting URL: https://cirrus-static-site.vercel.app/products; Crawl depth: 2 - Filter pattern: `._/products/._` ## See Also - [Use Unstructured Data in Data 360](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_connect_overview.htm&type=5) - [Billing Considerations for Unstructured Data](https://help.salesforce.com/s/articleView?id=data.c360_a_unstructured_data_billing_considerations.htm&type=5) ## Next Step - [Step 2: Set Up a Web Content Connector and Verify Content Ingestion](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guide/aes-set-up-web-content-connector.md): Create the connector, apply your filtering decisions, and confirm that the content ingests into Data 360. # The Agentic Enterprise Solutions | I want to... | Products | Audience | | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -------- | | [Build a loan prequalification employee agent](https://developer.salesforce.com/docs/ai/loan-agent/guides/aes-loan-agent-hp.md) | Data 360, Agentforce, Sales Cloud | Admins | | [Automate resume processing](https://developer.salesforce.com/docs/ai/automate-resume-processing/guides/aes-automate-resume-processing-hp.md) | Data 360, Flow Builder, Sales Cloud | Admins | | [Ground Agentforce on my website](https://developer.salesforce.com/docs/ai/ground-agentforce-on-website/guides/aes-ground-agentforce-on-website.md) | Data 360, Agentforce | Admins | | [Power Agentforce with complex visual data](https://developer.salesforce.com/docs/ai/power-agentforce-visual-data/guides/aes-power-agentforce-visual-data.md) | Data 360, Agentforce | Admins | | [See the Cumulus Financial Service agent integration example](https://developer.salesforce.com/docs/ai/agentic-enterprise-get-started/aes-cumulus-financial-service-agent.md) | Data 360, Agentforce, Slack | Admins | | [Find more cross-product solutions](https://help.salesforce.com/s/articleView?id=data.c360_a_solutions.htm&type=5) | | |