# AI on SAP HANA Data: HANA Cloud Vector Engine, PAL, or a Private RAG Beside HANA

> Source: https://netray.co/erp-ai/sap-hana-ai-vector-engine-private-rag
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: AI for ERP

## Short answer

There are three ways to put AI on SAP HANA data: use SAP HANA Cloud's vector engine for embeddings and similarity search inside HANA, use the Predictive Analysis Library for classical machine learning in the database, or run a private RAG system beside HANA that reads released views. Licence type, deployment and whether you need non-SAP data decide which fits.

## Kind

platform

## Erp Family

sap

## Erp Products

- SAP HANA
- SAP HANA Cloud
- SAP S/4HANA
- SAP BW/4HANA

## Industries

- Manufacturing
- Aerospace
- Electronics
- Defense

## Region

Global

## Persona

SAP Data Architect

## Eyebrow

SAP HANA + AI

## Intro

SAP HANA sits under S/4HANA, BW/4HANA and many custom applications, so it holds a large share of the data that manufacturers want to ask questions about. Naturally, data teams ask whether they can build AI directly on HANA rather than copying data elsewhere.

SAP has added AI capabilities to HANA. SAP HANA Cloud includes a vector engine for storing embeddings and running similarity search, which is what retrieval-augmented generation needs, along with a knowledge graph engine. HANA has long included the Predictive Analysis Library and Automated Predictive Library for classical machine learning such as regression, classification, clustering and time series forecasting. These are real tools, well suited to teams already invested in HANA Cloud and BTP.

Two practical constraints shape the decision. First, licensing: many SAP customers run HANA under a runtime licence bundled with SAP applications, which typically restricts direct access by non-SAP applications and custom development. Reading data through released CDS views and APIs, or holding a full-use licence, is usually required. Second, scope: manufacturing questions often need MES, PLM and document data that does not live in HANA.

This page explains the options, where each fits, and how to design retrieval over HANA-based data without breaking licences or authorisations.

## Pain Points

### Licence restrictions

**Detail:** Runtime HANA licences commonly prohibit direct access by third-party tools, so a quick SQL connection for an AI pilot can create a compliance problem.

### Semantic complexity

**Detail:** Raw HANA tables under S/4HANA are hard to use directly; meaning lives in CDS views, calculation views and application logic.

### On-prem versus cloud features

**Detail:** The vector engine is a HANA Cloud capability; on-prem HANA customers need to check what their release supports before planning around it.

### Data outside HANA

**Detail:** Documents, PLM data and plant systems needed for many answers are not in HANA, so in-database AI covers only part of the question.

### Authorisations

**Detail:** Analytic privileges and application authorisations must still apply when AI retrieves data; direct database users often bypass them.

## Use Cases

### Vector search in HANA Cloud

**Description:** Store embeddings of product texts, documents or notifications in HANA Cloud and run similarity search for retrieval, near the business data.

**Erp Objects:** HANA Cloud vector engine (REAL_VECTOR type, similarity functions), document tables

**Outcome:** Retrieval inside the SAP data platform with SAP-managed operations.

### Classical ML with PAL

**Description:** Run forecasting, classification or anomaly detection inside HANA using the Predictive Analysis Library.

**Erp Objects:** PAL procedures, calculation views as input, result tables

**Outcome:** Numeric predictions computed where the data lives, without data movement.

### Private RAG over released views

**Description:** Extract data through CDS views or OData into a private retrieval index alongside documents, used by an on-prem model.

**Erp Objects:** Released CDS views, OData APIs, BW/4HANA queries, document stores

**Outcome:** Answers combining SAP and non-SAP data with licence-safe access.

### Text-to-query over curated views

**Description:** The model generates queries only against a curated set of views with documented semantics, never raw tables.

**Erp Objects:** Curated CDS or calculation views, view documentation

**Outcome:** More reliable answers because the model works with business-meaningful structures.

### Similar notification search

**Description:** Find similar past quality or maintenance notifications using embeddings of their text and attributes.

**Erp Objects:** QM and PM notification texts, codes, equipment

**Outcome:** Faster investigations using prior resolutions.

### BW/4HANA analytics questions

**Description:** Ask questions over BW/4HANA models in plain language, with the model calling defined queries.

**Erp Objects:** BW/4HANA CompositeProviders, queries

**Outcome:** Business users get answers from existing analytic models without building reports.

### Anomaly detection on postings

**Description:** Use PAL or external models to flag unusual postings or movements for review.

**Erp Objects:** ACDOCA through CDS views, MATDOC through CDS views

**Outcome:** Early identification of errors and unusual activity for finance and inventory teams.

## Architecture

**Overview:** Choose between in-HANA AI (HANA Cloud vector engine and PAL) and a private RAG layer beside HANA that reads released views. Many landscapes use both: PAL for numeric models and private RAG for language-based answers across systems.

**Layers:**

#### HANA data

**Detail:** S/4HANA, BW/4HANA or custom schemas, accessed through CDS views, calculation views and APIs.

#### In-database AI

**Detail:** HANA Cloud vector engine and PAL for embeddings, similarity search and classical ML where licensed.

#### Extraction layer

**Detail:** For private RAG: scheduled extraction through released views or OData into an external index such as pgvector or Qdrant.

#### Private model

**Detail:** An open-weight model on your GPUs using retrieval from HANA-based data and other sources.

#### Authorisation

**Detail:** Analytic privileges and application roles enforced either by HANA or by retrieval filters in the private layer.

## Deployment Options

### HANA Cloud native

**Fit:** Companies already using HANA Cloud and BTP.

**Detail:** Use the vector engine and SAP's generative AI hub; keep data inside SAP's platform.

### Private RAG beside on-prem HANA

**Fit:** On-prem S/4HANA customers, runtime licence holders, restricted environments.

**Detail:** Read through released views, index externally, run models on-prem.

### Hybrid

**Fit:** Companies with HANA Cloud for analytics and on-prem operational systems.

**Detail:** PAL or vector engine for SAP-centric models; private layer for cross-system language questions.

## Compliance

### Confirm HANA licence type before any direct access; use released views and APIs under runtime licences.

**Framework:** SAP licensing

### Controlled data extracted for retrieval stays on-prem with the private model.

**Framework:** ITAR / EAR

### AI is read-only on financial data; anomaly flags feed existing review processes.

**Framework:** SOX

### Personal data in embeddings follows the same retention and deletion rules as source data.

**Framework:** GDPR

## Integration Notes

- Confirm whether your HANA licence is runtime or full use before connecting any non-SAP tool directly.
- Prefer released CDS views (I_ and C_ prefixes) or OData APIs for S/4HANA data extraction.
- Vector engine availability differs between HANA Cloud and on-prem HANA releases; check your release.
- Keep embeddings refreshed incrementally using change timestamps on source views.
- Apply analytic privileges or equivalent retrieval filters so users only see authorised data.
- Document the semantics of each curated view; the model's accuracy depends on it.

## Product Fit

### DataRay

**Why:** Private retrieval over HANA-based data alongside databases, documents and file shares.

### ERPray

**Why:** Plain-language answers over S/4HANA through released APIs, read-only, on-prem available.

### Custom build

**Why:** PAL models, embedding pipelines and curated view layers specific to your landscape.

## Engagement

### Landscape and licence review

**Duration:** 1 week

**Deliverables:**

- HANA licence assessment
- Data source inventory
- Use case shortlist

### Design

**Duration:** 2 weeks

**Deliverables:**

- In-HANA vs private RAG decision
- Curated view list
- Authorisation design

### Pilot

**Duration:** 4-6 weeks

**Deliverables:**

- Retrieval pipeline
- Model endpoint
- Evaluation set

### Production

**Duration:** 3-4 weeks

**Deliverables:**

- Incremental refresh
- Monitoring
- Governance

## Buyer Questions

- Do we hold a runtime or full-use HANA licence, and what access does it permit?
- Does our HANA release support the vector engine?
- Which curated views will the AI use, and who maintains them?
- How are analytic privileges enforced in retrieval?
- What non-SAP data does the use case need?
- Where are embeddings stored and how are they refreshed?

## Faq

### Does SAP HANA have a vector database?

**Answer:** SAP HANA Cloud includes a vector engine that stores embeddings in a vector data type and supports similarity search functions, which is the core of retrieval-augmented generation. Availability for on-prem HANA depends on release, so check SAP's documentation for your version. For many teams already on HANA Cloud, keeping vectors next to business data is attractive.

### Can we connect an AI tool directly to HANA with SQL?

**Answer:** Technically yes, but licensing often says no. Many customers license HANA as a runtime database bundled with SAP applications, which typically restricts direct access by non-SAP applications. Check your contract. Under runtime licences, use released CDS views, OData APIs or SAP-approved extraction methods instead.

### What is PAL in SAP HANA?

**Answer:** The Predictive Analysis Library is a set of machine learning algorithms that run inside HANA, covering regression, classification, clustering, time series and more. It suits numeric prediction tasks close to the data. It is not a language model and does not answer questions in plain language, but it pairs well with a language model layer.

### Should we use HANA Cloud vector engine or an external vector store?

**Answer:** Use HANA Cloud if you are already on it, your data is mostly SAP, and SAP's platform meets your deployment needs. Use an external store such as pgvector or Qdrant with a private model when you need on-prem deployment, mix SAP with many non-SAP sources, or face licence restrictions on HANA access.

### Why not let the model query raw S/4HANA tables?

**Answer:** Raw tables are large, technical and change between releases, and their meaning depends on application logic. Models produce far more reliable results against curated, documented CDS or calculation views. Released views are also the access path SAP supports, which matters for licensing and upgrades.

### How do we enforce authorisations in a RAG system?

**Answer:** Either let HANA enforce analytic privileges by querying as the end user, or tag indexed content with organisational attributes and filter retrieval by the user's authorisations before the model sees anything. The second approach is common for private RAG and must be designed and tested explicitly.

### Can BW/4HANA data be used for AI?

**Answer:** Yes. BW/4HANA models and queries already encode business meaning, so a model calling defined queries can answer analytic questions reliably. This often delivers value faster than building new views on S/4HANA, especially for historical analysis.

## Search terms

sap hana ai, sap hana vector engine, sap hana cloud vector database, sap hana rag, sap hana pal machine learning, ai on sap hana data, sap hana genai, private rag sap hana, sap hana llm, bw4hana ai, sap hana runtime license ai

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
