Skip to Content

Orchestration(V2) with Grounding Capabilities in SAP AI Core

This tutorial provides a step-by-step guide to setting up document grounding, creating pipelines, and utilizing vector APIs for facility management. In our use case, we use facility management emails uploaded to AWS S3 as grounding documents. This enables precise retrieval of relevant information, supporting efficient query resolution and service request handling. Follow this guide to streamline facility-related insights and response processes.
You will learn
  • How to set up orchestration pipelines, enable document grounding, and perform vector retrieval using SAP AI Core’s grounding capabilities
I321506Smita NaikMarch 5, 2026
Created by
I321506
March 5, 2026
Contributors
I321506

Prerequisites

  1. BTP Account
    If you do not already have a commerical SAP Business Technology Platform (BTP) account, you can use BTP Advanced Trial.
    Create a BTP Account
  2. For SAP Developers or Employees
    Internal SAP stakeholders should refer to the following documentation: How to create BTP Account For Internal SAP Employee, SAP AI Core Internal Documentation
  3. For External Developers, Customers, or Partners
    Follow this tutorial to set up your environment and entitlements: External Developer Setup Tutorial, SAP AI Core External Documentation
  4. Create BTP Instance and Service Key for SAP AI Core
    Follow the steps to create an instance and generate a service key for SAP AI Core. Ensure to use service plan extended:
    Create Service Key and Instance
  5. AI Core Setup Guide
    Step-by-step guide to set up and get started with SAP AI Core:
    AI Core Setup Tutorial
  6. An Extended SAP AI Core service plan is required, as the Generative AI Hub is not available in the Free or Standard plans. For more details, refer to
    SAP AI Core Service Plans
  7. AI Launchpad Setup Guide
    Step-by-step guide to set up AI Launchpad:
    AI Launchpad Tutorial

Pre-read

In this tutorial, we explore how to extend orchestration capabilities in SAP AI Core by incorporating grounding — the process of enriching GenAI outputs with domain-relevant context to ensure accurate and reliable responses. Grounding addresses key challenges such as hallucinations and lack of specificity by connecting the model to external knowledge sources during inference.

In this tutorial we are covering:

  • How to create the Data Injestion Pipeline(pipeline API and vectore API options). You can choose either of these options based on the requirements
  • How to use Amazon S3 or Microsoft SharePoint as document repository.
  • How to retrieve and verify the content dynamically from uploaded documents.
  • How to configure and use grounding in orchestration. We are focusing on the grounding module usage, but in the consumption request you will also find optional modules such as data masking and content filtering and templating, model configuration are the mandatory modules in orchestration.
  • how to use the solution using SAP AI Launchpad, Python SDK, JavaScript, and API(Bruno Client).

Use Case: In our scenario, we use facility management emails uploaded to Microsoft SharePoint or Amazon S3 as grounding documents. The orchestration pipeline retrieves relevant content from these documents and enables context-aware question answering using retrieval-augmented generation (RAG).

For additional context, refer to:
🔗 Grounding in SAP AI Core (Help Portal)

Video links:

Overview of the tutorial steps:

img
  • Step 1
  • Step 2
  • Step 3

    Resource groups segment workloads and manage resources for specific AI Core services.

    To enable document grounding in SAP AI Core, your Resource Group (RG) must include a specific label. If you’re creating a new RG, add this label during setup.

  • Step 4

    This step is required only if you are using external document repositories such as Amazon S3 or Microsoft SharePoint for grounding.

    Note:

    • If you do not want to use an external document repository, and instead plan to use chunks data then use Vector API and generate embeddings and store in vector database. In this scenario you can SKIP this step entirely.
    • There are other options such as SFTP is also supported. But currently in the tutorial we are not covering it.

    A Generic Secret securely stores credentials for your document repository in SAP AI Core. These secrets are later used while creating the knowledge base (data repository) using the Pipeline API.

    👉 Which one to create?

    Create the generic secret for SharePoint or S3 based on the document repository you plan to use for your grounding documents.

    🔸 If you’re using Microsoft SharePoint:

    Follow the instructions to create a secret with the required base64-encoded SharePoint credentials.

    🔸 If you’re using Amazon S3:

    Use the AWS CLI to configure your bucket and provide the base64-encoded credentials in the secret payload.

    Proceed directly to creating collections using the Vector API if you’re not working with S3 or SharePoint or SFTP.

  • Step 5

    Choose your data repository type and set up the integration.

    In the tutorial, currently we are covering the document repositories:

    • Microsoft Sharepoint
    • AWS S3

    This step covers, fetching documents from a supported data source(Sharepoint, S3, SFTP etc), preprocessing and creating chunks of those documents, and stores their semantic embeddings in the HANA Vector Store.

    Create Pipeline

    In this use case, we have added facility management emails as grounding documents, uploading them to the designated SharePoint folder. I’m attaching the sample email folder sample_emails.zip used in this scenario. For practice, you can also use these emails if needed.

  • Step 6

    Vector API processes the chunks provided by user and stores their semantic embeddings in collections.

  • Step 7
  • Step 8

    If you only want to test semantic matching from the data repository without involving LLM inference or orchestration, you can use this standalone retrieval search option.

    Steps:

    • Again, navigate to 07_retrieval in Bruno.

    • Use retrieval_vector to get relevant chunks.

    • Simply provide your search query and the data repository ID(s) in the request

    Analyze the chunks field in the response.

    This is useful for debugging retrieval quality before plugging into a larger pipeline.

    img
  • Step 9

    Before beginning inference, make sure:

    An orchestration deployment with scenario ID: orchestration is RUNNING.

    Use the get_deployment API (under the “Deployments” section in the Bruno collection) to confirm the deployment.

    Update the orchestration_service_url in your environment variables accordingly.

    NOTE: If you don’t have an orchestration deployment or would like to refer GET Deployment steps, refer to “Create Configuration for Orchestration Deployment” step in this tutorial tutorial.

  • Step 10
  • Step 11
  • Step 12

    Adding Grounding significantly enhances the model’s ability to provide Accurate and Context-specific responses. Without Grounding, the model generates generic replies, while with grounding, it retrieves precise information from the uploaded document. Screenshots showcasing both responses are provided for comparison.

Back to top