SAP BTP AI Best Practice Demo - Vector Embedding (RAG) - CAP
A CAP backend-sample and fullstack-sample that parse an uploaded CSV of science data, embed each row through SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp and store the vectors in SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp's vector store.
uploadScienceData parses an uploaded CSV of science data and creates the embeddings through SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp's Generative AI Hub, in the logic srv/services/ai-sdk.ts holds; the vectors go into the schema.cds entity the sample deploys to an HDI container in SAP HANA CloudSAP HANA CloudThe managed database under most of this: CAP's default target, the store Datasphere and Analytics Cloud sit on, and a service with plans and components.sap official, btp, and scienceData reads the stored rows back. The fullstack-sample adds a UI5 app, manage-science-data, together with a launchpad configuration and an approuter for local testing, on top of the same service. Building that container is a step of its own before a run, npm run build:db, beside the cds bind for the SAP AI CoreSAP AI CoreSAP's AI service on BTP: the runtime for AI assets, and through the Generative AI Hub inside it the access to foundation models, the orchestration service with its templating, masking, filtering and grounding modules, the Prompt Registry and Document Grounding.sap official, btp instance.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerLuís MarquesContributes to this
In the atlas: contributes to 8@luismarques-io1 contributor
Before choosing this
Conditions
PracticalFunctional boundary
Every CDS service in both samples is marked @requires: 'any' and left publicly accessible, which the README says simplifies the testing and deployment process, and it asks for proper authentication mechanisms to be applied in their place.
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
- Use as
- A reference
- Runtime
- Node.js
As a sample
- Form
- A reference application
Connections
Grounding a model's answer in data retrieved at question time
AI runtime on BTP with the Generative AI Hub
Managed SAP HANA database service on BTP
AI runtime on BTP with the Generative AI Hub
Managed SAP HANA database service on BTP
Download
README
quoted from SAP-samples/sap-btp-ai-best-practices under Apache-2.0, readCAP Implementations for Generative AI Access
This directory contains Cloud Application Programming (CAP) model implementations that demonstrate best practices for accessing Embeddings models using the SAP GenAI Hub and storing them in SAP HANA Vector Store. It provides examples of different ways to create and store embeddings in the vector store.
Available Samples
- backend-sample: Standalone CAP backend service implementation
- fullstack-sample: Complete CAP application with UI5 frontend
Overview
These samples showcase how to:
- Connect to generative AI services from CAP applications
- Structure service layers for AI orchestration
- Implement proper error handling
- Deploy applications to SAP BTP
Getting Started
Each subdirectory contains a comprehensive README.md with detailed setup instructions, deployment guides, and usage examples.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Flavors
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-btp-ai-bp-vector-rag-embedding-cap- JSON
- /artifacts/sap-samples-btp-ai-bp-vector-rag-embedding-cap.json
- MCP
- Connecting an agent