Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
21b9a29
fix: AMS documentation link in cap-users.md (#2367)
johannes-vogel Feb 10, 2026
2461b3f
tenant-specific deployment parameters (#2379)
ecklie Feb 11, 2026
5cf619b
fixed colors
danjoa Feb 11, 2026
d7645ec
added troubleshooting for 431 (#2373)
mariayord Feb 11, 2026
8917d9b
Hook for internal HANA TMS troubleshooting (#2377)
ecklie Feb 11, 2026
ced81f8
remove variants hint
renejeglinsky Feb 12, 2026
a1fb804
Merge branch 'main' of https://github.com/capire/docs
renejeglinsky Feb 12, 2026
b9dbd65
Tools/cds build: rework w/o toggling (#2391)
renejeglinsky Feb 12, 2026
5c38f2a
Fiori Guide: remove toggle (#2393)
renejeglinsky Feb 13, 2026
ff5cbd7
fix impl variants (#2371)
Akatuoro Feb 13, 2026
de58eb5
Use comma in CSV instead of semicolon in extensibility guide (#2387)
swaldmann Feb 13, 2026
92e9c15
Core concepts: fixed text (#2396)
martindecorte Feb 16, 2026
e0ba936
Update learn-more.md (#2385)
qmacro Feb 16, 2026
79bf0bc
Reintroduce interactive diagrams (#2388)
Akatuoro Feb 16, 2026
0ed9c7d
Fix formatting in bookshop.md for this.after (#2401)
Max-Meinel Feb 16, 2026
7aa637b
Simplify Outbound Authentication (#2400)
beckermarc Feb 17, 2026
8cfb8ed
Update links to examples in cds-test.md (#2405)
renejeglinsky Feb 17, 2026
1a75990
Fix typo in ReviewsService API reference (#2398)
narendran-nv Feb 17, 2026
99797a6
Fix yaml snippet
chgeo Feb 17, 2026
e0ee1b8
editing
renejeglinsky Feb 17, 2026
cc24303
MTXS hana deployment logs (#2390)
ecklie Feb 18, 2026
522ad21
Delete .nvmrc
chgeo Feb 18, 2026
ccd5590
Use latest Node version again
chgeo Feb 18, 2026
555f61e
chore: Update CLI texts (#2407)
github-actions[bot] Feb 18, 2026
3b38991
accessibility check
renejeglinsky Feb 19, 2026
7724d11
Merge branch 'main' of https://github.com/capire/docs
renejeglinsky Feb 19, 2026
8632f71
add protocol fragments (#2394)
SirSimon04 Feb 23, 2026
6e157b5
Fix link to bookstore/package.json in documentation (#2399)
narendran-nv Feb 23, 2026
2811926
[CDS/CXL] Edit CXL guide (#2363)
renejeglinsky Feb 24, 2026
269cf97
chore(deps): update dependency cspell to v9.7.0 (#2412)
renovate[bot] Feb 24, 2026
707a9e9
chore(deps): update dependency @mdit/plugin-dl to v0.23.0 (#2413)
renovate[bot] Feb 24, 2026
7324c8f
added redirect for db hana guide
renejeglinsky Feb 24, 2026
a7a1d1a
Live cql (#2403)
Akatuoro Feb 25, 2026
c4052e3
Added npm/mvn install to cloned repos
danjoa Feb 26, 2026
01a39f7
add redirects
renejeglinsky Feb 26, 2026
5dc479d
chore(deps): update shiki monorepo to v3.23.0 (#2414)
renovate[bot] Feb 26, 2026
75a6a6d
Less version changes from renovate, use variables
chgeo Feb 26, 2026
abd2372
chore(deps): update dependency com.sap.cloud.security.ams.client:cap-…
renovate[bot] Feb 26, 2026
7ae5a07
remove(lint): commented out section in tools/lint (#2418)
joergmann Feb 27, 2026
91cabdd
Adjust `cds version` output to current format
swaldmann Feb 27, 2026
1299005
fix deprecated version in hana limitation link (#2415)
kulliax Feb 27, 2026
7bcc9fe
feat(install): setup for Windows / Linux / WSL (#2392)
joergmann Mar 2, 2026
badc1cd
Fix typo in get-help.md (#2423)
qmacro Mar 2, 2026
01565ee
chore(deps): update eslint (#2397)
renovate[bot] Mar 2, 2026
94bd9f2
chore(deps): update dependency vite-plugin-cds to v0.1.10 (#2421)
renovate[bot] Mar 2, 2026
21c1042
chore(deps): update dependency markdownlint-cli to v0.48.0 (#2425)
renovate[bot] Mar 3, 2026
265e473
chore(deps): update dependency @mdit/plugin-dl to v0.23.1 (#2424)
renovate[bot] Mar 3, 2026
00597c0
Troubleshooting note on HANA root cert change (#2429)
chgeo Mar 3, 2026
86379b1
Removed external repository support (#2426)
rashmiangadi05 Mar 3, 2026
cc830a2
Fix toggles (#2428)
Akatuoro Mar 3, 2026
6af54cd
Remove feature parity hint in Postgres guide (#2430)
swaldmann Mar 3, 2026
2f0c20b
CAP Java: Migration Guide 4 to 5 (#2427)
StefanHenke Mar 3, 2026
aba4ed9
Enhance documentation on message persistence in drafts (#2416)
MattSchur Mar 3, 2026
affe284
chore: assign `public/` to technical code owners
chgeo Mar 4, 2026
2fac839
fix toggle animation (#2434)
Akatuoro Mar 4, 2026
4746a8d
chore(deps): update dependency com.sap.cds:cds4j-api to v4.8.0 (#2437)
renovate[bot] Mar 6, 2026
8ee5fd0
chore: Update CLI texts (#2432)
github-actions[bot] Mar 6, 2026
8f99e57
chore(deps): update dependency com.sap.cds:cds-services-api to v4.8.0…
renovate[bot] Mar 6, 2026
adbffd4
alesi documentation (#2352)
rjayasinghe Mar 9, 2026
eebca40
Add maven build profiles (#2411)
vl-leon Mar 9, 2026
5395e49
feat: Parallel Processing of Atomicity Groups in Node.js Apps (#2436)
sjvans Mar 9, 2026
2ff882d
add section for CAP Java OpenRewrite recipes (#2194)
rjayasinghe Mar 9, 2026
af7f5e0
show cqn when running cql queries (#2438)
Akatuoro Mar 10, 2026
96c0d04
chore(deps): update dependency @sap/cds to v9.8.1 (#2441)
renovate[bot] Mar 10, 2026
4401d4b
chore(deps): update eslint (#2440)
renovate[bot] Mar 10, 2026
5b06012
Alternate stable link
chgeo Mar 10, 2026
e1f941b
chore(deps): update dependency @cap-js/sqlite to v2.2.0 (#2442)
renovate[bot] Mar 10, 2026
c383e25
Document `cds up --overlay` (#2444)
swaldmann Mar 10, 2026
b714eda
Added documentation for hybrid testing with IAS (#2342)
mariayord Mar 11, 2026
4519600
chore(deps): update dependency @sap/cds to v9.8.2 (#2445)
renovate[bot] Mar 11, 2026
919ce34
chore(deps): update dependency sass to v1.98.0 (#2446)
renovate[bot] Mar 11, 2026
66b1245
chore: Update Java Properties (#2447)
github-actions[bot] Mar 11, 2026
f5b4a44
chore: Update CLI texts (#2448)
github-actions[bot] Mar 11, 2026
1e67bfa
Fuzzy Search: remove beta badge (#2402)
renejeglinsky Mar 11, 2026
0b683bc
fix menu title of Core Eventing in CAP (#2408)
sjvans Mar 12, 2026
b036a48
Stress that evens can be recurring
chgeo Mar 12, 2026
35ed485
Merge branch 'cap.cloud.sap' into main
renejeglinsky Mar 16, 2026
eef8d5d
Bump dependencies, ESLint 10
chgeo Mar 16, 2026
5279cb3
Add missing `globals` package`
chgeo Mar 16, 2026
e387188
Fix eslint findings
chgeo Mar 16, 2026
c749d3d
Go back to cds 9.7 for now
chgeo Mar 16, 2026
d37cc80
Bump version to 2026.2.1
chgeo Mar 16, 2026
d9b7418
Bump version to 2026.2.2
renejeglinsky Mar 17, 2026
77b11fb
Simplified get-started setup + cosmetics
chgeo Mar 17, 2026
3ad547d
fixed links
danjoa Mar 18, 2026
4942e5c
Fix small typos (#2464)
vmikhailenko Mar 19, 2026
182eb88
Troubleshoot entry for data file change on HANA
chgeo Mar 19, 2026
d26e033
document post-active switch and behavior (#2450)
rjayasinghe Mar 23, 2026
0d3e33f
Added information regarding de-/serialization of custom data types (#…
t-bonk Mar 23, 2026
a6e1c31
chore: cds 9.8 (#2467)
chgeo Mar 23, 2026
8db66c9
Update migration for Spring Boot 4 (#2455)
StefanHenke Mar 24, 2026
46ef4a0
chore: go back to cds 9.7, issues w/ local dev
chgeo Mar 24, 2026
44fc12a
add tip regarding liquibase license change (#2449)
rjayasinghe Mar 24, 2026
6015c0d
Update Spring Boot 4 migration guide (#2470)
StefanHenke Mar 24, 2026
2a6c3d4
Update Service Layer Testing examples (#2458)
samyuktaprabhu Mar 26, 2026
b7c2978
fix: `cds.model = cds.compile.for.nodejs(csn)` (#2473)
sjvans Mar 30, 2026
7b3188a
fix: add --recurse-submodules flag to git clone command in feature-to…
Naguco Mar 30, 2026
e4f56ef
Change URL to CXL series (#2475)
qmacro Mar 31, 2026
f68f376
Update multitenancy configuration for CAP Java projects (#2476)
renejeglinsky Mar 31, 2026
40fa6a4
fixed test-run locally sections in integration guides
danjoa Mar 31, 2026
cd03029
polishing
danjoa Mar 31, 2026
7235cbe
Split replays and episode notes for CXL series (#2484)
qmacro Apr 1, 2026
335ec61
chore(deps): update dependency @typescript-eslint/parser to v8.58.0 (…
renovate[bot] Apr 2, 2026
afef6d4
chore(deps): update dependency @mdit/plugin-dl to v0.23.2 (#2477)
renovate[bot] Apr 2, 2026
c85e37c
chore(deps): update dependency adm-zip to v0.5.17 (#2483)
renovate[bot] Apr 2, 2026
5bbd170
chore: Update CLI texts (#2463)
github-actions[bot] Apr 2, 2026
b307bef
fix odata redirect
renejeglinsky Apr 7, 2026
059190a
document skip locked (#2466)
dahajnal Apr 7, 2026
66b4518
Document tenant-specific IAS host injection in RequestContext (#2474)
StefanHenke Apr 14, 2026
787b690
Update dependency sass to v1.99.0 (#2485)
renovate[bot] Apr 14, 2026
af8c272
Update dependency cspell to v9.8.0 (#2486)
renovate[bot] Apr 14, 2026
6e94358
chore: Update CLI texts (#2490)
github-actions[bot] Apr 14, 2026
6453a47
Update dependency @typescript-eslint/parser to v8.58.2 (#2492)
renovate[bot] Apr 14, 2026
135dfed
fix: add missing command flag to reference command (#2498)
PDT42 Apr 14, 2026
f47c1d5
Fix Multitenancy link in Postgres.md (#2497)
mperumalswamy Apr 14, 2026
86db564
[java] Add tips and tricks section (#2369)
vmikhailenko Apr 14, 2026
a343bfc
[java] building applications - small typos (#2494)
vl-leon Apr 14, 2026
16502c8
add `@cap-js/process` (#2472)
SirSimon04 Apr 14, 2026
d52f45c
update cds (#2502)
Akatuoro Apr 14, 2026
c79aa94
minor fixes
danjoa Apr 15, 2026
f595006
chore: Update CLI texts (#2503)
github-actions[bot] Apr 15, 2026
eeace0b
Eliminate link warnings in VS Code
danjoa Apr 15, 2026
7a2738e
fix broken links
smahati Apr 15, 2026
3d92814
Revert "fix broken links" ... and fix it trw
danjoa Apr 15, 2026
398d27c
Allow `cdl` as alias for `cds` language
chgeo Apr 15, 2026
e55e719
feat: direct CRUD in both stacks (#2406)
sjvans Apr 15, 2026
b734e36
Fixing outdated dependencies (#2504)
danjoa Apr 16, 2026
a5ba780
Update dependency com.sap.cds:cds-services-api to v4.8.1 (#2509)
renovate[bot] Apr 16, 2026
8e25ae6
Improved <Config>
danjoa Apr 17, 2026
1ed1f55
Allow code fences to be not expanded
chgeo Apr 17, 2026
c475917
Bump version to 2026.4.0
chgeo Apr 20, 2026
997995d
Remove hierarchical tree view image asset
danjoa Apr 20, 2026
034cebe
Deferred need to add Cloud SDK
danjoa Apr 20, 2026
2e7dc64
Apr 26 release
danjoa Apr 20, 2026
78789ff
Added info notes on Vector type
danjoa Apr 20, 2026
0e689f6
polished
danjoa Apr 20, 2026
37f041d
VSCode-checkable link anchor
danjoa Apr 20, 2026
dd51b60
Link to `Node.js > Upgrading @sap/cds` (#2512)
sjvans Apr 20, 2026
431a61b
Minor CDL update to clarify @inner position (#2505)
qmacro Apr 21, 2026
9b3d9f3
Add required @ prefix to common annotation alternatives (#2506)
qmacro Apr 21, 2026
391b7bf
Fix (?) CXL constraint for no-description in constraints.md (#2515)
qmacro Apr 21, 2026
33f4e26
Also add rene as code owner
chgeo Apr 21, 2026
f016c41
Deprecations and removals in CAP Java 5 (#2479)
StefanHenke Apr 21, 2026
c4a88c2
Avoid multi-exposing Elements in views (#2478)
MattSchur Apr 21, 2026
b0a161d
java-composite-messaging-event-patterns (#2520)
t-bonk Apr 21, 2026
b80c99e
Fix positioning of row anchor
chgeo Apr 21, 2026
013565b
Java props: full type on hover. Split List values
chgeo Apr 21, 2026
d719f58
.
danjoa Apr 22, 2026
f11fe1b
feat: guide for Vue.js/React setup (#2459)
swaldmann Apr 22, 2026
ac95e0c
fix styles (#2521)
Akatuoro Apr 22, 2026
be6fc3d
Update dependency com.sap.cds:cds4j-api to v4.9.0 (#2525)
renovate[bot] Apr 22, 2026
6e2e68e
Updates cds.test docs for version 1.0
danjoa Apr 22, 2026
5532358
Fixed link
danjoa Apr 22, 2026
343cf43
cds-test: mention new defaults more
chgeo Apr 23, 2026
a279ebb
Fix link
chgeo Apr 23, 2026
de0e0fb
HANA TMS v2 public (#2529)
chgeo Apr 23, 2026
68e2f4a
Improved cds.test docs once more
danjoa Apr 23, 2026
56b7a96
Remove sections for cds property changes in 4.9 (#2531)
StefanHenke Apr 23, 2026
8a4926b
Fix documenyation about maintaining cds-dk in CAP Java applications (…
mofterdinger Apr 23, 2026
1213f9c
Update dependency @typescript-eslint/parser to v8.59.0 (#2517)
renovate[bot] Apr 23, 2026
2b7121a
better quality image for IAS config
swaldmann Apr 23, 2026
e3ba609
docs(java): update fiori-drafts table for draftNew / post-active sema…
rjayasinghe Apr 23, 2026
958bb80
Java: cds-maven-plugin migration guide 4 -> 5 (#2522)
mofterdinger Apr 23, 2026
9c65225
Update dependency com.sap.cds:cds-services-api to v4.9.0 (#2535)
renovate[bot] Apr 23, 2026
3d81cf1
Fixed docs about cds.entities, srv.entitites etc.
danjoa Apr 23, 2026
5635c34
Improved docs on srv.entities, part 2
danjoa Apr 24, 2026
dcd420f
copy errors
danjoa Apr 24, 2026
f963a26
tweaked
danjoa Apr 24, 2026
98d7c48
avoid line breaks
danjoa Apr 24, 2026
5c9c1c9
polished section on event handlers
danjoa Apr 24, 2026
b91b1b2
Merge tag '2026.04.0'
chgeo Apr 24, 2026
9b4163d
Bump version
chgeo Apr 24, 2026
835d90a
Fix link again
chgeo Apr 24, 2026
960a987
fix: .env files allow plain property keys using dots
danjoa Apr 24, 2026
5ef8b1c
Fix `srv-entities` anchor
chgeo Apr 24, 2026
b3347dc
Even more polished <Config>
danjoa Apr 24, 2026
a9fe214
fix hana docu link + destination service link (#2536)
ecklie Apr 24, 2026
c59e2c5
node.js does not support runtime views yet (#2422)
johannes-vogel Apr 27, 2026
dd8a098
Mac -> macOS, no 'WSL'
chgeo Apr 27, 2026
50103b1
Vector Embeddings in Java (#2508)
MattSchur Apr 27, 2026
94b216f
Move Vector Embeddings Guide from HANA to Databases (#2507)
MattSchur Apr 27, 2026
c51c20f
patch version 2026.4.1
renejeglinsky Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .vitepress/theme/components/ConfigInspect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
</div>
<div class="vp-code-group vp-doc" v-else>
<CodeGroup :groups="[
{ id: 'env', label: '.env file', lang: 'properties', group, code: propStr },
{ id: 'yml', label: '.cdsrc.yaml', lang: 'yml', group, code: rcYmlStr },
{ id: 'js', label: '.cdsrc.js', lang: 'js', group, code: rcJsStr },
{ id: 'pkg-rc', label: 'package.json', lang: 'json', group, code: pkgStr },
// { id: 'pkg-priv', label: '~/.cdsrc.json', lang: 'json', group, code: rcJsonStr, private: true },
// { id: 'pkg', label: '.cdsrc.json', lang: 'json', group, code: rcJsonStr },
{ id: 'js', label: '.cdsrc.js', lang: 'js', group, code: rcJsStr },
{ id: 'yml', label: '.cdsrc.yaml', lang: 'yml', group, code: rcYmlStr },
{ id: 'env', label: '.env file', lang: 'properties', group, code: propStr },
// { id: 'shl', label: 'Linux/macOS Shells', lang: 'sh', group, code: 'export '+envStr, transient: true },
// { id: 'shp', label: 'Powershell', lang: 'powershell', group, code: '$Env:'+envStr, transient: true },
// { id: 'shw', label: 'Cmd Shell', lang: 'cmd', group, code: 'set '+envStr, transient: true }
Expand Down Expand Up @@ -120,13 +120,13 @@

pkgStr.value = JSON.stringify(pkg, null, 2)
rcJsonStr.value = JSON.stringify(pkg.cds??{}, null, 2)
rcJsStr.value = 'module.exports = ' + rcJsonStr.value.replace(/"(\w*?)":/g, '$1:')
rcJsStr.value = 'exports.' + Object.keys(pkg.cds??{})[0] + ' = ' + JSON.stringify(Object.values(pkg.cds??{})[0], null, 2).replaceAll('"', '')
rcYmlStr.value = yaml.stringify(pkg.cds)

let envKey = fqn.replaceAll('_', '__').replaceAll(keyDel, '_')
if (/^[a-z_]+$/.test(envKey)) envKey = envKey.toUpperCase() // only uppercase if not camelCase
envStr.value = `${envKey}=${jsonVal ? JSON.stringify(jsonVal) : value}`
propStr.value = `${envKey}=${jsonVal ? JSON.stringify(jsonVal) : value}`
propStr.value = `${fqn} = ${jsonVal ? JSON.stringify(jsonVal) : value}`

javaAppyml.value = yaml.stringify(pkg)
javaEnvStr.value = `-D${propStr.value}`
Expand Down
2 changes: 1 addition & 1 deletion cds/cdl.md
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ To add or update CDS views without redeploying the database schema, annotate the

Runtime views must be simple [projections](#as-projection-on), not using *aggregations*, *join*, *union* or *subqueries* in the *from* clause, but may have a *where* condition if they are only used to read.

In CAP Java, runtime views are enabled by default, in Node.js enable them via <Config>cds.features.runtime_views: true</Config>.
In CAP Java, runtime views are enabled by default. Node.js does not support it yet.

[Learn more about runtime views in CAP Java.](../java/working-with-cql/query-execution#runtimeviews) {.learn-more}

Expand Down
10 changes: 5 additions & 5 deletions get-started/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ On macOS, Linux and WSL (Windows Subsystem for Linux), we recommend using [Homeb
```shell [macOS]
bash -c "$( curl https://raw.githubusercontent.com/homebrew/install/HEAD/install.sh )"
```
```shell [Linux / WSL]
```shell [Linux]
# install curl (required to get Homebrew) and git (required to run Homebrew)
sudo apt install curl git -y
bash -c "$( curl https://raw.githubusercontent.com/homebrew/install/HEAD/install.sh )"
Expand All @@ -34,7 +34,7 @@ bash -c "$( curl https://raw.githubusercontent.com/homebrew/install/HEAD/install
### Node.js and _cds-dk_ {.required}

::: code-group
```shell [macOS / Linux / WSL]
```shell [macOS/Linux]
brew install node # Node.js LTS
npm i -g @sap/cds-dk # install CAP's cds-dk globally
```
Expand All @@ -59,7 +59,7 @@ sqlite3 -version
### Java and Maven {.optional}

::: code-group
```shell [macOS / Linux / WSL]
```shell [macOS/Linux]
brew install sapmachine-jdk
brew install maven
```
Expand Down Expand Up @@ -92,7 +92,7 @@ brew install git # Git CLI
brew install gh # GitHub CLI
brew install github # GitHub Desktop App
```
```shell [Linux / WSL]
```shell [Linux]
brew install git # Git CLI
brew install gh # GitHub CLI

Expand Down Expand Up @@ -127,7 +127,7 @@ git -v # display Git cli version
```shell [macOS]
brew install --cask visual-studio-code # VS Code itself
```
```bash [Linux / WSL]
```bash [Linux]
# VS Code on Homebrew is only supported for macOS
sudo snap install --classic code
code -v # display VS Code's version
Expand Down
1 change: 1 addition & 0 deletions guides/databases/_menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
## [ PostgreSQL ](postgres.md)
# [ Schema Evolution ](schema-evolution.md)
# [ Performance Guide ](performance.md)
# [ Vector Embeddings ](vector-embeddings.md)
80 changes: 0 additions & 80 deletions guides/databases/hana.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,86 +261,6 @@ See the [Deploying to Cloud](../deploy/index.md) guide for information about how

The HANA Service provides dedicated support for native SAP HANA features as follows.

### Vector Embeddings

Vector embeddings let you add semantic search, recommendations, and generative AI features to your CAP application. Embeddings are numeric arrays that represent the meaning of unstructured data (text, images, etc.), making it possible to compare and search for items that are semantically related to each other or a user query.

#### Choose an Embedding Model

Choose an embedding model that fits your use case and data (for example english or multilingual text). The model determines the number of dimensions of the resulting output vector. Check the documentation of the respective embedding model for details.

Use the [SAP Generative AI Hub](https://community.sap.com/t5/technology-blogs-by-sap/how-sap-s-generative-ai-hub-facilitates-embedded-trustworthy-and-reliable/ba-p/13596153) for unified consumption of embedding models and LLMs across different vendors and open source models. Check for available models on the [SAP AI Launchpad](https://help.sap.com/docs/ai-launchpad/sap-ai-launchpad-user-guide/models-and-scenarios-in-generative-ai-hub-fef463b24bff4f44a33e98bb1e4f3148#models).

#### Add Embeddings to Your CDS Model
Use the `cds.Vector` type in your CDS model to store embeddings on SAP HANA Cloud. Set the dimension to match your embedding model (for example, 1536 embedding dimensions for OpenAI *text-embedding-3-small*).

```cds
entity Books : cuid {
title : String(111);
description : LargeString;
embedding : Vector(1536); // adjust dimensions to embedding model
}
```

#### Generate Embeddings
Use an embedding model to convert your data (for example, book descriptions) into vectors. The [SAP Cloud SDK for AI](https://sap.github.io/ai-sdk/) makes it easy to call SAP AI Core services to generate these embeddings.

:::details Example using SAP Cloud SDK for AI
```Java
var aiClient = OpenAiClient.forModel(OpenAiModel.TEXT_EMBEDDING_3_SMALL);
var response = aiClient.embedding(
new OpenAiEmbeddingRequest(List.of(book.getDescription())));
book.setEmbedding(CdsVector.of(response.getEmbeddingVectors().get(0)));
```
:::

#### Query for Similarity
At runtime, use SAP HANA's built-in vector functions to search for similar items. For example, find books with embeddings similar to a user question:

::: code-group
```Java [Java]
// Compute embedding for user question
var request = new OpenAiEmbeddingRequest(List.of("How to use vector embeddings in CAP?"));
CdsVector userQuestion = CdsVector.of(
aiClient.embedding(request).getEmbeddingVectors().get(0));

// Compute similarity between user question and book embeddings
var similarity = CQL.cosineSimilarity( // computed on SAP HANA
CQL.get(Books.EMBEDDING), userQuestion);

// Find Books related to user question ordered by similarity
hana.run(Select.from(BOOKS).limit(10)
.columns(b -> b.ID(), b -> b.title(), b -> similarity.as("similarity"))
.orderBy(b -> b.get("similarity").desc())
);
```

```js [Node.js]
const response = await new AzureOpenAiEmbeddingClient(
'text-embedding-3-small'
).run({
input: 'How to use vector embeddings in CAP?'
});

const questionEmbedding = response.getEmbedding();
let similarBooks = await SELECT.from('Books')
.where`cosine_similarity(embedding, to_real_vector(${questionEmbedding})) > 0.9`;
```
:::

:::tip Evolve embeddings with your model
Store embeddings when you create or update your data. Regenerate embeddings if you change your embedding model.
:::

:::tip Use SAP Cloud SDK for AI
Use the [SAP Cloud SDK for AI](https://sap.github.io/ai-sdk/) for unified access to embedding models and large language models (LLMs) from [SAP AI Core](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core).
:::

Learn more about the [SAP Cloud SDK for AI (Java)](https://sap.github.io/ai-sdk/docs/java/getting-started) or the [SAP Cloud SDK for AI (JavaScript)](https://sap.github.io/ai-sdk/docs/js/getting-started) {.learn-more}

[Learn more about Vector Embeddings in CAP Java](../../java/cds-data#vector-embeddings) {.learn-more}


### Geospatial Functions

CDS supports the special syntax for SAP HANA geospatial functions:
Expand Down
109 changes: 109 additions & 0 deletions guides/databases/vector-embeddings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
label: Vector Embeddings
---
# Vector Embeddings

Vector embeddings convert unstructured content (text, images, and so on) into numeric vectors that encode semantics (meaning). Comparing these vectors enables semantic search, recommendations, and enhanced generative AI features in your CAP application. For example retrieving related records, ranking results by relevance, or augmenting prompts for LLMs.

## Choose an Embedding Model

Choose an embedding model that fits your use case and data (for example English or multilingual text). The model determines the number of dimensions of the resulting output vector. Check the documentation of the respective embedding model for details.

Use the [SAP Generative AI Hub](https://www.sap.com/products/artificial-intelligence/generative-ai-hub.html) for unified consumption of embedding models and LLMs across different vendors and open-source models. Check for available models on the [SAP AI Launchpad](https://help.sap.com/docs/ai-launchpad/sap-ai-launchpad-user-guide/models-and-scenarios-in-generative-ai-hub-fef463b24bff4f44a33e98bb1e4f3148#models).

## Add Embeddings to Your CDS Model
Use the built-in CDL [Vector type](../../cds/types) in your CDS model to store embeddings. Set the vector dimensions to match the embedding model (for example, 768 for *SAP_GXY.20250407*).

```cds
extend Incidents with {
embedding : Vector(768);
}
```

## Generate Embeddings
Use an embedding model to convert your data (for example, incident titles and summaries) into vectors.

:::warning Evolve embeddings with your model
Store embeddings when you create or update your data. Regenerate embeddings if you change your embedding model.
:::

### Generate Embeddings on the Database

To generate vector embeddings on write in SAP HANA, you can use the [vector_embedding](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-sql-reference-guide/vector-embedding-function-vector) function as calculated element [on-write](../../cds/cdl#on-write) with embedding models from [SAP HANA NLP](https://help.sap.com/docs/hana-cloud-database/sap-hana-cloud-sap-hana-database-vector-engine-guide/creating-text-embeddings-with-nlp-51eb170d038d4099a9bbb85c08fda888) or a configured remote source from SAP AI Core:

```cds
extend Incidents with {
@cds.api.ignore
embedding : Vector(768) = vector_embedding(
'Title: ' || title || ', Summary: ' || summary,
'DOCUMENT', 'SAP_GXY.20250407'
) stored;
}
```

:::tip Prefer calculated elements for vector embeddings
If the database calculates vector embeddings on write it automatically regenerates the embedding if the input data changes.
:::

::: info Local Testing with H2 and SQLite
On H2 and SQLite the `CQL.vectorEmbedding` function is emulated to support local testing.
:::

> [!warning] Java only and <Beta/>
> The `vector_embedding` function is currently in beta and only supported by the CAP Java runtime.

[Learn more about Vector Embeddings in CAP Java](../../java/cds-data#vector-embeddings) {.learn-more}

### Generate Embeddings Programmatically

Alternatively, you can compute vector embeddings in your application layer using the [SAP Cloud SDK for AI](https://sap.github.io/ai-sdk/) to call SAP AI Core services for generating embeddings.

:::details Example using SAP Cloud SDK for AI
```Java
var aiClient = OpenAiClient.forModel(OpenAiModel.TEXT_EMBEDDING_3_SMALL);
var response = aiClient.embedding(
new OpenAiEmbeddingRequest(List.of(book.getDescription())));
book.setEmbedding(CdsVector.of(response.getEmbeddingVectors().get(0)));
```
:::

:::tip Use SAP Cloud SDK for AI
Use the [SAP Cloud SDK for AI](https://sap.github.io/ai-sdk/) for unified access to embedding models and large language models (LLMs) from [SAP AI Core](https://help.sap.com/docs/sap-ai-core/sap-ai-core-service-guide/what-is-sap-ai-core).
:::

Learn more about the [SAP Cloud SDK for AI (Java)](https://sap.github.io/ai-sdk/docs/java/getting-started) or the [SAP Cloud SDK for AI (JavaScript)](https://sap.github.io/ai-sdk/docs/js/getting-started) {.learn-more}

## Query for Similarity
At runtime, use vector functions to search for similar items. In an example Retrieval-Augmented Generation (RAG) scenario, use `CQL.cosineSimilarity` to enhance the context of a user query for the LLM. First, compute the vector embedding of the user query and use it to find related incidents.

::: code-group
```Java [Java]
// Compute embedding for user question
var query = CQL.val(
"Any incidents with solar inverters this month? How were they resolved?");
var embedding = CQL.vectorEmbedding(query, TextType.QUERY, "SAP_GXY.20250407");

// Compute similarity between user question and incident embeddings
var similarity = CQL.cosineSimilarity(CQL.get(Incidents.EMBEDDING), embedding);

// Find Incidents related to user question ordered by relevance
Select.from(INCIDENTS)
.columns(i -> similarity.times(100).as("relevance"),
i -> i.ID(), i -> i.title(), i -> i.summary(), i -> i.date())
.where(i -> similarity.gt(0.75))
.orderBy(i -> i.get("relevance").desc());
```

```js [Node.js]
const response = await new AzureOpenAiEmbeddingClient(
'text-embedding-3-small'
).run({
input: 'Any incidents with solar inverters this month? How were they resolved?'
});

const questionEmbedding = response.getEmbedding();
let similarIncidents = await SELECT.from('Incidents')
.where`cosine_similarity(embedding, to_real_vector(${questionEmbedding})) > 0.75`;
```
:::

2 changes: 1 addition & 1 deletion guides/extensibility/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ In case something unexpected happens, set the variable `DEBUG=cli` in your shell

::: code-group

```sh [Mac/Linux]
```sh [macOS/Linux]
export DEBUG="cli"
```

Expand Down
4 changes: 2 additions & 2 deletions guides/multitenancy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ The SAP HANA Tenant Management Service (TMS) v2 service provides direct support
> - **Not suitable for existing applications** as there is **no migration from Service Manager** available yet. This will be provided as HANA tool later.<br>
> There **won't be support for both Service Manager and TMS v2** together in one application.

[For more information, see the SAP HANA documentation](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-multitenancy-guide-internal/introducing-sap-hana-cloud-multitenancy){.learn-more}
[For more information, see the SAP HANA documentation](https://help.sap.com/docs/hana-cloud/sap-hana-cloud-multitenancy/introducing-sap-hana-cloud-multitenancy){.learn-more}
[Find the TMS v2 API on the SAP Business Accelerator Hub](https://api.sap.com/api/TenantAPI/overview){.learn-more}

#### Configure MTXS for Tenant Management Service
Expand Down Expand Up @@ -965,7 +965,7 @@ so clustering the upgrade by database does not work properly.
## SaaS Dependencies {#saas-dependencies}
Some of the xsuaa-based services your application consumes need to be registered as _reuse services_ to work in multitenant environments. This holds true for the usage of both the SaaS Registry service and the Subscription Manager Service (SMS).

CAP Java as well as `@sap/cds-mtxs`, each offer an easy way to integrate these dependencies. They support some services out of the box and also provide a simple API for applications. Most notably, you need such dependencies for the following SAP BTP services: [Audit Log](https://discovery-center.cloud.sap/serviceCatalog/audit-log-service), [Event Mesh](https://discovery-center.cloud.sap/serviceCatalog/event-mesh), [Destination](https://discovery-center.cloud.sap/serviceCatalog/destination), [HTML5 Application Repository](https://discovery-center.cloud.sap/serviceCatalog/html5-application-repository-service), and [Cloud Portal](https://discovery-center.cloud.sap/serviceCatalog/cloud-portal-service).
CAP Java as well as `@sap/cds-mtxs`, each offer an easy way to integrate these dependencies. They support some services out of the box and also provide a simple API for applications. Most notably, you need such dependencies for the following SAP BTP services: [Audit Log](https://discovery-center.cloud.sap/serviceCatalog/audit-log-service), [Event Mesh](https://discovery-center.cloud.sap/serviceCatalog/event-mesh), [Destination](https://discovery-center.cloud.sap/serviceCatalog/destination-service), [HTML5 Application Repository](https://discovery-center.cloud.sap/serviceCatalog/html5-application-repository-service), and [Cloud Portal](https://discovery-center.cloud.sap/serviceCatalog/cloud-portal-service).

For CAP Java, all these services are supported natively and SaaS dependencies are automatically created if such a service instance is bound to the CAP Java application, that is, the `srv` module.

Expand Down
Loading
Loading