• IDD
  • IDD
  • Skybuffer AI
    • Skybuffer AI Installation and Initial Setup
      • On Business Technology Platform (BTP)
        • Skybuffer AI Installation Guide on BTP
      • On Premise: XSA Runtime and SAP HANA EE
        • Installing SAP HANA Including XS Runtime
        • XS Deployment Process
      • Post Installation User Guide
    • AI Agent
      • AI Agent Configurator
        • Register New AI Agent
        • Intents and Entities Creation
        • Skills Creation and Management
          • Standard Action Types
          • Generative AI Action
          • Document Grounding Action
          • Log Insight Action
        • Scheduling
        • Communication Channels
          • Copy the Existing Channel
          • Skills Activation
          • Webchat Communication Channel Setup
          • Destination Assignment
          • Facebook Messenger Communication Channel Setup
          • Zoom Communication Channel Setup
          • MS Teams Communication Channel Setup
          • Slack Communication Channel Setup
          • Telegram Communication Channel Setup
          • Viber Communication Channel Setup
          • WhatsApp Communication Channel Setup
          • AI Agent Communication Channel Setup
        • Monitor Section
      • Destination Management
      • AI Translate
      • Survey Craft
      • Identity Providers
      • Business AI Scenarios
      • Models Hub
      • Document Grounding Hub
    • AI Connector
      • AI Connector Configurator
      • AI Connector Logs
      • AWS Integration
      • Google Services Integration
      • Twilio Integration
      • Yandex Services Integration
    • SAP Backend for Business AI
      • Business AI Scenarios Package Administration
        • Installation Guide
        • Uninstallation Guide
      • Business AI Scenarios Package Maintenance Guide
        • Product License
        • Configuration of Email Sending Mechanism
          • Configuration Settings
          • Setup of Specific Email Sending Control
        • Technical User Setup
          • Central oData Service Authorization Role Maintenance
          • Technical User ID Creation
        • Assigning Business AI Scenarios to ABAP RIK Classes
        • Simplified User Creation Scenario Setup (Without Approval Workflow)
          • Maintain and Assign Reference Users for User Creation Scenario
          • Activate Notification for New User Creation (Optional)
        • User Creation Scenario Setup with Approval Workflow
          • Configure Approval Workflow for User Creation Scenario
          • Set Up Approval Steps for Different User Types Creation
    • HOW-TO Guides
      • SAP AI Core Integration. Ollama Server Setup
      • MS SharePoint Integration. Add-in Registration
      • MS Teams Integration. Single Sign-On
        • Create Azure Bot Service
        • Configure Azure Bot Service and Connect to Bot Management App
        • Create Middleware SSO Application
        • Configure Bot Service Application SSO
        • Create Azure AD Enterprise Application for SAP Backend
        • Configure oAuth2 in SAP System
        • Assign Identity Provider and Push Nodejs Configuration
        • Deploy Your App into Microsoft Teams
        • Managing Application Keys
    • Troubleshooting
      • Edge Browser Access Issue
    • Hybrid Chats
      • Hybrid Chats Maintenance Guide
        • Business and Technical Users Setup
          • Create Business and Technical Users
          • Create Business Partners
        • Tenant Configuration
        • Live Pool Management and Configuration
          • Start Live Pool
          • Manage Live Pool
        • System Configuration
          • Configure Status Profile
          • Set Up Technical Messages for Hybrid Chats
        • Hybrid Chats Configuration
        • Hybrid Chats Categorization
          • Categorization Management
          • Categorization Mapping
          • Translate Categories
      • Hybrid Chats User Manual
        • Hybrid Chats
          • HC Archive Mode
          • HC Active Mode
        • HC My Data
          • Edit Personal Data and Profile Picture
          • Default Settings Management
          • Notification and Dialogue Manual Mode Management
          • Quick Replies Management
            • Standard User Mode - Quick Replies
            • Administrator User Mode - Quick Replies
        • HC Analytics
          • HC Analytics
          • Operator Activity Analytics
          • Exit Survey Analytics
        • HC Teams
          • Access HC Teams Application
          • Create New Team
          • Create New Team Member
          • Edit Agent
          • Edit Team Name

Document Grounding Action

29 views 0

Document Grounding Action

This Action Type allows you to browse Vectorized files available in your system and retrieve text fragments corresponding to your question/query.

Step 1. Press the Document Grounding button at the bottom of an Action Group. New action will be created.

Step 2. Setup new action block step by step:

A – Help Dialog

For guidance on the action and some hints, click the Information Icon.

B – Document Grounding Destination

This field defines the AI model used to generate responses. By default, when you create an Action, it is set to use a hardcoded mask called “AI AGENT DEFAULT”. This is not the name of a specific model and does not exist in the model hub.

Instead, “AI AGENT DEFAULT” is a placeholder that always points to the current default Document Grounding model assigned to the AI Agent.

You can override this by selecting a specific model for your Action (e.g., Ollama). If you do, the Action will always use that model—even if the AI Agent’s default changes later.

C – Input Prompt
The Input Prompt is where you include the user phrase. You can enhance the {{user_phrase}} by adding additional text or memory parameters.

Example Input Prompt 1: {{user_phrase}}
Example Input Prompt 2: Answer this question: {{user_phrase}} in context of {{memory.rt_leave_request_type}}.

D. Filtering by Attributes

This feature allows you to limit the Grounded Search by specific attributes associated with the documents in the database. To filter by attributes, use the Add Condition button. You can also create advanced filtering by combining multiple conditions within Condition Sets.

NOTE: To select an attribute from the list, it must first be added to the corresponding Document Grounding model in the ML Models Hub application.

Press Add Condition button:

A table will appear with one row filled in. Mark the checkbox on the left of the first row with AND/OR, and press the Add Condition button.

 

Select an Attribute, Operation, and Value from expandable lists.

You can select only Attributes and Values that are present in Document Grounding HUB application and correspond with existing files.

 

Example 1:

Use only documents that have:

“Document Type” Attribute equal to “Strategy” AND  

“Project” Attribute equal to “Internal”:

E – Additional Parameters.
Parameters for the  Destination are applied by default. You can view these parameters in the AI Agent Configurator application, in Document Grounding Settings section. To customize the AI’s behavior further, you can redefine existing parameters or add new ones using Add Parameter function.

Available Parameters:

  • chunks: sets the maximum number of text segments (chunks) that will be retrieved and used for generating a response to the user’s query. Expected Format: Integer (e.g., 3, 5)
  • max_distance: sets the relevance threshold for how closely chunks must match the query. Lower values yield more precise results, higher values include broader context. Expected Format: Integer (e.g., 30, 10)

NOTE: Changing default parameters can significantly influence the AI Model’s performance and responses. Therefore, it is recommended to proceed with caution when making changes.

F- Output Memory Parameter

The result of Document Grounded search will be saved as the array structure in the memory parameter specified in the ‘Output Parameter’, rt_rag_output by default.

The Document Grounding reply structure:

[
    {
        "chunkText": "", // Extracted text segment (chunk) from the document matching the search criteria.
        "distance": "",  // Relevance score indicating how closely the chunk matches the search query (lower values = closer match).
        "docGUID": "",   // Unique identifier (GUID) of the document from which the chunk was extracted.
        "docName": "",   // Name of the document containing the extracted chunk.
        "link": "",      // URL or link to access the document directly.
        "ragGUID": "",   // Unique identifier (GUID) for the vectorized document representation in the Grounded Documents database.
        "startPos": ""   // Starting position of the extracted text chunk within the document, indicating where the relevant text begins.
    }
]

To refer to the Document Grounding reply structure, use the following syntax: {{memory.rt_rag_output.[n].field_name}}, where n — ordinal number of element in the array starting from 0, field_name — name of the field of the array element.

Here we display the retrieved chunks in Text Action Block:

Step3. Save your changes when done editing.

Postprocessing Hints:
What can you do with the generated response ?

1.  Display Grounded Search response in message to user : 

Create a Text Action, and print out “chunks” generated :

Example :

I was able to find the following facts according to your search request:
**Fact number 1**: {{memory.rt_rag_output.[0].chunkText}}
**Document Name**: {{memory.rt_rag_output.[0].docName}}
**Document Link**: {{memory.rt_rag_output.[0].link}}

2. Grounded Search reply processing by Gen AI: use retrieved chunks as a source for Generative AI response.

  • Add a Generative AI Action after your Grounded Search action.
  • Add a Processing Instruction: In the Generative AI Action, include an instruction in the Instruction field to define how the Grounded Search results should be processed. Use the memory parameter {{memory.rt_rag_output}} to refer to those  search results.

Instruction Template: If you need a starting point, use the template below as an example. Copy and paste it into the  Instruction field of your Generative AI Action:

Template 1:
Please create a reply to the Input Prompt using the provided chunks and output them in the following structure:
**Fact number …**: [summary of each chunkText]
**Document Name**: [docName]
**Link**: [Link]
Start with some general phrase, like ‘Here are the facts according to your request’ or similar.
There should be as many facts, document names and links as chunkText elements. If no facts, reply that nothing was found according to the request.
Facts: {{memory.rt_rag_output}}

Template 2:
Generate a consistent reply to the Input Prompt based on the chunkTexts of the following facts: {{memory.rt_rag_output}}. Don’t include any additional information in the reply.

NOTE: You can customize the instruction to fit your specific needs. This template is just an example to help you get started.

Was this helpful?

Yes  No
Related Articles
  • Copy the Existing Channel
  • Destination Assignment
  • Skills Activation
  • Log Insight Action
  • Edge Browser Access Issue
  • Troubleshooting
Copyright 2022 Skybuffer.com. All Rights Reserved.