Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
shabana
Product and Topic Expert
Product and Topic Expert
5,772

In my recent webinars and sessions about the SAP HANA Cloud vector engine, one of the most frequently asked questions was how to use SAP HANA Cloud vector engine and SAP Datasphere together to build intelligent data applications. Leveraging these powerful services in tandem allows for smooth data integration and sophisticated application development, addressing the growing demand for comprehensive and actionable insights from diverse data sources.

In this blog, we will delve into SAP Datasphere, that acts as a Business Data Fabric, streamlining access to SAP data (including business context) while also enabling the integration of external data sources. This unified view of your data landscape enables informed decision-making and drives impactful outcomes. We will also explore how SAP HANA Cloud allows you to operationalize data with machine learning and multi-model engines. The spotlight will be on the new vector engine, a key component in developing Gen AI infused Intelligent Data Applications (IDA). These IDAs, including natural language querying, leverage the full spectrum of analytical capabilities across historical and real-time data.

Let us now get granular into how SAP HANA Cloud can serve as the foundation for intelligent data applications alongside SAP Datasphere, to enable new innovative AI scenarios. We will explore how utilizing its analytical components to their fullest potential can unlock new insights. This blog is also intended to shed light on the usage of the SAP HANA Cloud vector engine for current SAP Datasphere customers and those who are eager to explore this aspect.

Intelligent Data Application Premise, an example use case

Scenario in a nutshell:

  1. SAP S/4HANA product data has been retrieved into SAP Datasphere using Semantic Onboarding
  2. SAP HANA Cloud Vector Engine: powering a Gen AI-driven product recommendation application
    • The product data on SAP Datasphere is federated into SAP HANA Cloud
    • A Gen AI Intelligent Data Application is planned to offer a “conversational product search and recommendation” for end users, based on the product descriptions.
    • The Gen AI-driven product recommendation
      1. utilizes semantic similarity search against embedded product description stored in SAP HANA Cloud.
      2. leverages a LLM to generate recommendations based on the user request and relevant products.
      3. provides a great and improved, guided, and conversational product recommendation experience (vs classic product search) within an intelligent application on SAP BTP.

 ArchitectureArchitecture

 Let's take a closer look at the details:

Our vision for the Intelligent Data Application (IDA) in this example centers around a sophisticated Gen AI-driven intelligent product recommendation application which would help the user to find the right product. In case of its unavailability, it would suggest other suitable, contextually closest alternatives based on the natural language query asked by the user. This IDA takes advantage of SAP HANA Cloud's new vector engine, which works with the Large Language Models to understand natural language queries and provide intuitive search functionalities via the Retrieval Augmented Generation (RAG) pattern for the user’s benefit.

To achieve seamless integration of diverse data sources, for example, including product data from SAP S/4HANA system or additional data from sources like for example the Data Marketplace or Google Cloud, we utilize the Semantic Onboarding functionality of SAP Datasphere. This tool serves as a conduit for importing semantically rich objects into SAP Datasphere, ensuring the preservation of contextual richness. Meaning, in our case, all the related data domain information and associations of the product table are onboarded to SAP Datasphere with ease.

Breaking it down into specific steps for further clarity:

Step 1: Data Consolidation and Exposure in SAP Datasphere

  • We leverage Data Builder within SAP Datasphere to create a comprehensive view of product data. This view is achieved by joining the semantically onboarded "Product" CDS view from S/4HANA with the associated "Product Description" table likely using an inner join (please note that the onboarding of “Product” CDS view has also onboarded all its associated tables including Product Description). This process ensures all relevant product information, including descriptions, is consolidated within SAP Datasphere.
  • The resulting view, containing the enriched product data, is made accessible in SAP HANA Cloud via virtual data integration as a remote source.

Use of Data Builder in SAP Datasphere to create a consolidated view which will be further federated to SAP HANA CloudUse of Data Builder in SAP Datasphere to create a consolidated view which will be further federated to SAP HANA Cloud

Step 2: Vectorization and Processing in SAP HANA Cloud

  • Within SAP HANA Cloud, we utilize the exposed product data, joining it with a new table containing the vector representations (embeddings) of product descriptions.
  • These embeddings are generated by feeding the original product text descriptions retrieved from the virtualized product data table into a text embedding function available through the SAP Generative AI Hub.

With the required vectorized data now residing in SAP HANA Cloud, we can harness its multi-model capabilities, particularly the vector engine to work with the vectorized product description. Storing vectorized data in SAP HANA Cloud ensures its easier accessibility for Gen AI scenarios, while also leveraging the platform's scalability and performance capabilities.

 Further vector processing on SAP HANA CloudFurther vector processing on SAP HANA Cloud

To further improve the intelligence of our recommendation system, we integrate Large Language Models (LLMs). Specifically, when using a Retrieval-Augmented Generation (RAG) approach, LLMs enable our application to grasp the intricacies of natural language queries. This allows the system to respond in a way that is both relevant and informative. By combining the strengths of LLMs with the vectorized data stored in SAP HANA Cloud, we establish a powerful synergy. This synergy significantly boosts the accuracy and relevance of our recommendations, resulting in a more intuitive and conversational product search experience.

The above approach emphasizes the power of SAP HANA Cloud in driving intelligent data applications. By combining advanced analytics capabilities, multi-model engines, and LLMs, we enable businesses to find valuable insights from their data, make better choices, and succeed in today's data-driven world.

Boosting LLM’s accuracy with SAP HANA Cloud vector engineBoosting LLM’s accuracy with SAP HANA Cloud vector engine

Code snippet for intelligent product search & recommendationCode snippet for intelligent product search & recommendation

See the Intelligent Data Application in Action:

We have also created a demo video that provides a clear view of the entire scenario. Watch it now!

Demo pic - DS blog.png

Use of SAP HANA Cloud Vector Engine on SAP Datasphere:

As mentioned at the beginning of the blog, this topic has consistently topped our list of frequently asked questions and sparked significant interest among our users. Let me address it head-on and provide clarity. The SAP HANA Cloud Vector Engine capability is indeed available for use via SAP Datasphere, but it's important to note that this functionality is accessible only after the underlying SAP HANA Cloud system is upgraded to a version on or after QRC1 2024. While this upgrade may seem advantageous, it's not advisable to utilize the vector engine with SAP Datasphere due to several reasons, as mentioned in detail in this SAP Note - 3463689

Firstly, utilizing the vector engine can lead to increased memory consumption within SAP Datasphere, potentially causing memory shortages, particularly in enterprise reporting scenarios. Memory consumption and sizing considerations heavily depend on the dimensions of the vectors and vary with each embedding model. Additionally, the underlying SAP HANA Cloud of SAP Datasphere is strictly managed by SAP, limiting the freedom and flexibility typically associated with standalone SAP HANA Cloud instances. This lack of flexibility may impact the execution of certain business use cases running on top of SAP Datasphere. Furthermore, employing the Vector Engine will directly impact memory and storage demands, potentially necessitating the up sizing of SAP Datasphere instances beyond their current configurations.

Given these considerations, the optimal approach to maximize the benefits of SAP HANA Cloud's multi-model and advanced analytics capabilities, without stumbling upon memory consumption restrictions is to use SAP HANA Cloud as a standalone system, next to your existing SAP Datasphere environment. This ensures greater control over resource management and flexibility in executing diverse business use cases, ultimately driving more effective and efficient data-driven strategies, while avoiding data duplication.

Summary:

In conclusion, as we have explored in this blog, this example scenario vividly illustrates how SAP HANA Cloud could also serve as an excellent sidecar database for organizations seeking to explore advanced analytics capabilities and combine data from multiple sources, whether internal SAP systems or third-party data sources. Integrating SAP HANA Cloud alongside existing systems enables efficient offloading of analytical workloads, ensuring optimal system performance and resource utilization. The described scenario is acting as a “template” for other multi-model use cases, where SAP HANA Cloud can provide powerful value to the rich capabilities of SAP Datasphere, especially in the context of application development.

Further References

4 Comments