CDS pluginCDS plugintypeInstalls into a CAP project and extends the runtime. CAP loads it through cds.requires or the plugin hook.See every one →What this type is →by SAPby SAPoriginPublished by SAP itself. A visible facet, never an input to a reading — a dormant official plugin reads exactly like a dormant independent one.See every one →

@cap-js/ai

Out-of-the-box value-help recommendations powered by SAP RPT-1, SAP AI Core as a standard CAP service, and an experimental local embedding model behind SQLite's vector functions.

Facts

Latestv1.2.1ReleasedLast pushLicenceApache-2.0

Where it sits

Lives in
Provides
LLM integrationCAPLLM integrationcapabilityCalling a language model from application code with the tenant, destination and credential handling already solved instead using an SDK call with a hand-rolled key.Retrieval-augmented generationCAPRetrieval-augmented generationcapabilityGrounding a model's answer in data retrieved at question time: text split into chunks, each chunk embedded as a vector, and the chunks nearest to the question placed into the prompt. Semantic search is the same retrieval with a person reading the matches, and fine-tuning changes the model's weights, not its input.
Flavors
Node.jsfrom its runtime
Requires
@sap/cds≥ 9@sap/cdsartifactThe runtime the plugin is loaded by: @sap/cds ^10.1 for the local embeddings on SQLite, while the package's other capabilities still support @sap/cds 9.
Optional
@cap-js/sqlite@cap-js/sqliteartifactThe database the plugin redirects so that the vector functions run against a local ONNX model instead of the character-hash emulation.SAP AI CoreSAP AI CoreartifactThe service binding the recommendations need in a production deployment; without one, local development uses a mock implementation for UI smoke tests.

Who is behind it

SAP Cloud Application Programming ModelSAP Cloud Application Programming ModelOrganisationMaintains this
In the atlas: maintains 34
@cap-js
maintainerDaniel HutzelPersonContributes to this
In the atlas: contributes to 32, wrote 3
@danjoa
Guilherme DellagustinPersonContributes to this
In the atlas: contributes to 27
@dellagustin-sap
Marten SchiwekPersonContributes to this
In the atlas: contributes to 16
@schiwekM
Simon EngelPersonContributes to this
In the atlas: contributes to 14, wrote 4
@SirSimon04
sjvansPersonContributes to this
In the atlas: contributes to 45
@sjvans
Sören LeibachPersonContributes to this
In the atlas: maintains 6, contributes to 5, wrote 1
@sleibach
Stefan RudiPersonContributes to this
In the atlas: contributes to 13, wrote 5
@stefanrudi
7 contributors

Before choosing this

Conditions

LicenceSAP Developer License Agreement 3.2 CAP§ 1, 2, 3A cds-plugin is used with SAP CAP materials, or an artifact is explicitly identified as a CAP plugin or application.
  • § 1 License. Productive customer applications are limited to SAP BTP or another SAP-licensed platform, and mass extraction to a non-SAP product is restricted except where solely required for SAP interoperability.
  • § 2 Intellectual Property. The agreement retains SAP's rights in the covered materials and limits making APIs, tools or software available to third parties, while preserving ownership of customer applications subject to SAP's underlying rights.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.
SAP Developer License Agreement 3.2 CAP →

Also, from LLM integration§ 3: Calling a model for inference is not automatically AI training. Section 3 matters when the covered material or application participates in training, model development, refinement or the text-and-data-mining uses it names.

Also, from Retrieval-augmented generation§ 3: Retrieval and inference are not automatically AI training. The section becomes relevant if the indexed or retrieved covered material is instead used for training, developing or refining the model or system.

What it declares

Every artifact

Type
CDS plugin
Origin
By SAP
Runtime
Node.js

As a CDS plugin

Declared for
>=9
Distributed through
npm

For LLM integration

Models it reaches
SAP AI Core

Tasks this contributes to2Beta

Answer a question from records in a CAP serviceA question asked in plain words is answered from rows the CAP model already holds: the records nearest to the question in meaning are found and put in front of a language model, so the answer rests on those records rather than on what the model remembers.Covers, under conditionslocal embedding model
What it does

Makes the similarity search on a laptop behave like the one in the database. Without it, capire states that SQLite and H2 emulate vector_embedding with lexical character-hash vectors, which match spelling rather than meaning; with it, the standard sqlite database generates semantic embeddings from a local ONNX model and no external service is called.

Conditions

@sap/cds ^10.1 and @cap-js/sqlite ^3.1, the versions capire states the local embeddings require; Local development: the README calls the facility experimental and sends production vector workloads to SAP HANA's vector engine

Remaining work

Install the plugin in a project on the stated versions. The retrieval, the prompt and the model call are the same work as on the core path, and the answer still has to be built somewhere else for production.

All options on the Retrieval-augmented generation page →
Run a CAP service's model calls with no SAP AI Core bindingA CAP project whose handlers call a language model starts, serves and answers on a laptop or in a pipeline where no SAP AI Core instance is bound — either from a mock, or from a model running locally.Covers, under conditionsmock in place of the service
What it does

Answers without the service: the README states that a production deployment requires an SAP AI Core service binding and that without one, local development uses a mock implementation for UI smoke tests. The project starts and the Fiori field shows a recommendation with nothing bound.

Conditions

The recommendations are what is being run: the README names the mock for them, not for every call the AICore service can make; The mock is for UI smoke tests, in the README's own words, so what comes back is not a model's answer

Remaining work

Nothing to install for the mock, and nothing it can tell you about the answers a real deployment would give. Anything beyond the recommendations, including the AICore service the plugin embeds, was not read here for a no-binding run.

All options on the LLM integration page →

Connections5

@cap-js/ai connections@cap-js/aiPROVIDES→ provides2provides stated UI recommendations powered by SAP AI Core, simplified access to SAP AI Core resources as a CAP service, and vector embedding support. cap-js/ai — README: https://github.com/cap-js/ai#readme CAP plugins — AI: https://cap.cloud.sap/docs/plugins/#aiLLM integrationprovides stated Redirects the standard `sqlite` database so that `VECTOR_EMBEDDING` and the vector functions run against a local ONNX model, the current default being sentence-transformers/all-MiniLM-L6-v2. Without it, capire states that SQLite and H2 emulate `vector_embedding` with character-hash vectors, which match spelling rather than meaning, so this is what makes a similarity search on a laptop behave like the one on SAP HANA. The README declares it experimental and points production vector workloads at SAP HANA's vector engine, and capire scopes it to local development. CAP-native Embeddings, SQLite and H2 — capire, source on GitHub: https://raw.githubusercontent.com/cap-js/docs/main/guides/ai/embeddings.md CAP-native Embeddings, SQLite and H2 — capire, source on GitHub: https://raw.githubusercontent.com/cap-js/docs/main/guides/ai/embeddings.md CAP-native Embeddings, SQLite and H2 — capire, source on GitHub: https://raw.githubusercontent.com/cap-js/docs/main/guides/ai/embeddings.md cap-js/ai — README, Local vector embeddings with SQLite (experimental): https://raw.githubusercontent.com/cap-js/ai/main/README.mdRetrieval-augmented generationNEEDS→ needs1needs stated The runtime the plugin is loaded by: `@sap/cds` ^10.1 for the local embeddings on [SQLite](external:sqlite), while the package's other capabilities still support `@sap/cds` 9. cap-js/ai — README, local embeddings on SQLite: https://raw.githubusercontent.com/cap-js/ai/main/README.md@sap/cds→ optionally needs2optionally needs stated If: The local vector embeddings are used: capire states the plugin requires @sap/cds ^10.1 and @cap-js/sqlite ^3.1 for them. The recommendations and the AICore service do not involve SQLite. The database the plugin redirects so that the vector functions run against a local ONNX model instead of the character-hash emulation. CAP-native Embeddings, SQLite and H2 — capire, source on GitHub: https://raw.githubusercontent.com/cap-js/docs/main/guides/ai/embeddings.md@cap-js/sqliteifoptionally needs stated If: The recommendations run in a production deployment; without the binding, local development uses a mock implementation for UI smoke tests. The service binding the recommendations need in a production deployment; without one, local development uses a mock implementation for UI smoke tests. cap-js/ai — README, Recommendations: https://raw.githubusercontent.com/cap-js/ai/main/README.mdSAP AI Coreif

Install

npm add @cap-js/ai

Derived from the package name. No recipe recorded; the README has the configuration.

Learn more3

Readings
  1. CAP in the age of AI #7 - vector embeddings wrap-upDJ Adams, Johannes Vogt, YouTube — SAP Developers playlists
  2. CAP: The Road Ahead - Simplicity in an AI EraSAP Developers, YouTube — SAP Developers playlists
  3. Enhancing Enterprise Applications: AI-powered User Experience with SAP CAP AI Pluginrupamaity, SAP Community

Where it sits in your app

Download
Your CAP applicationYour SAP BTP subaccountdocumentedmay needif The local vector embeddingsare used: capire states theplugin requires @sap/cds ^10.1 a…documentedmay needif The recommendations run ina production deployment;without the binding, local devel…@cap-js/ai, module@cap-js/ai@cap-js/sqlite, module@cap-js/sqliteSAP AI Core, service instanceSAP AI Core
SAPnot SAP's, or the project's ownunder a condition

README

quoted from cap-js/ai under Apache-2.0, read
cap-js/ai/README.mdOn GitHub

REUSE status

CAP AI plugin for Node.js

@cap-js/ai adds UI recommendations powered by SAP AI Core, simplified access to SAP AI Core resources, and vector embedding support for CAP applications.

Recommendations

The plugin adds SAP-RPT-1 recommendations to draft-enabled entities. Fields with a value help are included automatically:

@odata.draft.enabled
entity Books {
  key ID    : Integer;
      title : String;
      genre : Association to Genres;
      price : Decimal;
}

annotate Genres with @cds.odata.valuelist;

Recommendations as default values

Use @UI.RecommendationState to opt individual fields in or out:

annotate Books with {
  genre @UI.RecommendationState: 0;
  price @UI.RecommendationState;
}

A production deployment requires an SAP AI Core service binding. Without one, local development uses a mock implementation for UI smoke tests. See Recommendations for regression targets, request behavior, data handling, and deployment lifecycle.

SAP AI Core

The plugin provides an AICore CAP service for managing resource groups, deployments, and configurations:

const aiCore = await cds.connect.to('AICore');
const { resourceGroups, deployments } = aiCore.entities;

const groups = await aiCore.run(SELECT.from(resourceGroups));
await aiCore.stop(deployments, { id: '<deployment id>' });

See SAP AI Core integration for setup, supported queries, helper methods, and multitenancy.

Local vector embeddings with SQLite (experimental)

Warning

The SQLite extensions, local vector embeddings, local model management, and the related tooling are experimental facilities for local development. Breaking changes are expected, including changes caused by SQLite's synchronous function interface and by local model management. Use SAP HANA's vector engine for production vector workloads.

@cap-js/ai redirects the standard sqlite database so that VECTOR_EMBEDDING and the vector functions run locally against a real ONNX model — no external service, and no code changes versus SAP HANA. This lets you develop and test semantic search on SQLite. The following searches Bookshop's books by the meaning of their descriptions.

  1. Install the local-development dependencies:

    npm add -D @cap-js/ai @cap-js/sqlite@^3.1 @huggingface/hub \
      @huggingface/tokenizers onnxruntime-node

    This requires @sap/cds ^10.1 and @cap-js/sqlite ^3.1 (the package's other capabilities still support @sap/cds 9). No configuration is needed: the standard sqlite and sqlite:memory databases pick up the local implementation automatically.

  2. Expose the search as an OData function. It ranks books by the cosine similarity between an embedded search phrase and each book's embedded description:

    using { sap.capire.bookshop.Books } from '@capire/bookshop';
    
    service SearchService {
      function searchBooks(phrase : String) returns array of {
        title : String;
        relevance : Double;
      };
    }
    const cds = require('@sap/cds')
    
    module.exports = class SearchService extends cds.ApplicationService { init() {
      this.on('searchBooks', ({ data: { phrase } }) =>
        SELECT.from('sap.capire.bookshop.Books')
          .columns`title, cosine_similarity(
            vector_embedding(descr, 'DOCUMENT', 'SAP_GXY.20250407'),
            vector_embedding(${phrase}, 'QUERY', 'SAP_GXY.20250407')) as relevance`
          .orderBy`relevance desc`
      )
      return super.init()
    }}

    The model name is ignored on SQLite — the locally configured model is used — and honored on SAP HANA, so the same query runs unchanged on both. This embeds every book's description on each request; for repeated searches, persist the embeddings instead (see Local vector embeddings).

  3. Run the app and call the function:

    cds watch

    In another terminal:

    curl "http://localhost:4004/odata/v4/search/searchBooks(phrase='a%20haunting%20poem%20about%20lost%20love')"

@cap-js/ai looks for the configured model in the project's .cds/models first, then in ~/.cds/models. If it is missing, startup warns, downloads it to ~/.cds/models, and initializes it; later starts and other projects reuse that cache. The function returns the books ranked by relevance to the phrase.

The current default is sentence-transformers/all-MiniLM-L6-v2, chosen only as the most-downloaded reasonably small model matching the sentence-similarity task, ONNX format, and Apache-2.0 license. This is not a recommendation and may change while the feature is experimental — set cds.requires.db.embedding.model to pin it. Browse alternatives among trending Apache-2.0 sentence-similarity models with ONNX artifacts, then validate your choice with the provided tooling.

See Choosing a model and Local vector embeddings for compatibility checks, explicit or shared provisioning, runtime behavior, and limitations.

Advanced

Test the plugin locally

The sample application is in tests/bookshop.

npm test

Integration tests require an SAP AI Core binding:

cds bind ai-core -2 <your-ai-core-service-instance>
npm run test:hybrid

Support, feedback, and contributing

This project welcomes feature requests, bug reports, and contributions through GitHub issues. See the Contribution Guidelines for development information.

Security

Report potential security issues through the project's security policy, not through public issues.

Code of Conduct

Participation in this project is governed by the Code of Conduct.

Licensing

Copyright 2026 SAP SE or an SAP affiliate company and ai contributors. See LICENSE and the REUSE report.

Apache-2.0, read

History

Latest

v1.2.1

Fixes 3

Notes
Fixed
  • Relax onnxruntime-node peer dependency from an exact 1.20.1 pin to ^1.20.1, allowing any compatible 1.x release. The synchronous SQLite integration now handles the native binding API changes introduced in 1.21.0 (initOrt initialization requirement, inputMetadata/outputMetadata replacing inputNames/outputNames).
  • Relax @huggingface/tokenizers peer dependency from an exact 0.1.3 pin to ^0.2.0. The Tokenizer constructor, encode signature, and return shape are identical across 0.1.3 and 0.2.0.
  • Remove local development dependencies from peer dependencies so they are not included in production deployments.
  1. v1.2.0

    Features 2

    Notes
    Added
    • Experimental: Extend the standard sqlite service and its sqlite:memory preset for local CAP development with VECTOR_EMBEDDING, model provisioning tooling, and sentence-transformers/all-MiniLM-L6-v2 as a replaceable default that may change while the feature remains experimental. Local vector embeddings require @sap/cds^10.1 and @cap-js/sqlite^3.1; the package's other capabilities continue to support @sap/cds>=9.
    • Experimental: Add local SPARQL_EXECUTE and sparql_table support through the optional oxigraph peer dependency.
  2. v1.1.0

    Features 1, Changed 1, Fixes 5

    Notes
    Added
    • New @UI.RecommendationState opt-in annotation for scalar fields to use Regression prediction from RPT-1
    Changed
    • Extend task_type to {classification, regression}
    Fixed
    • Row-level authorization is now enforced when collecting the recommendations context
    • CDS-to-RPT-1 dtype map now correctly maps cds.Boolean to 'string' and cds.DateTime/cds.Timestamp to 'string', fixing HTTP 422 errors from /predict
    • Recurisly enhance composition children of draft-enabled entities so recommendations are displayed for nested entities
    • Fix empty-rows server crash in _fetchPrediction when draft entity compositions are empty, now returns an empty result instead of throwing a TypeError
    • RPT-1 inference limits now honoured: _fetchPrediction logs a warning and returns empty when target_columns > 10 or row columns > 100, instead of letting the API reject with a 422
  3. v1.0.1

    Fixes 1

    Notes
    Fixed
    • Empty recommendations on read on active entities are returned empty to avoid UI errors
  4. v1.0.0

    Features 4

    Notes
    Added
    • Out of box support for recommended values in field helps in Fiori UIs by providing an SAP_Recommendations navigation property in OData services which contains the recommendations.
    • Provide a CAP AICore service, via which SAP AI Core artefacts can be queried, like 'resourceGroups', 'deployments' or 'configurations' with cds.ql (SELECT.from(resourceGroups) and alike).
    • Automatically create an AI Core deployment for SAP RPT-1 which is used for the recommended values in single tenant and multi tenant scenarios.
    • Automatically creates an AI Core resource group per tenant in multi tenant scenarios. In single tenant mode the 'default' resource group is used.
11,355downloads per week, npm
Weekly downloads for @cap-js/ai26 complete calendar weeks from 2026-04-27 to 2026-10-25; the latest total is 11355.27 Apr – 3 May: 2984 May – 10 May: 17511 May – 17 May: 9418 May – 24 May: 8825 May – 31 May: 3291 Jun – 7 Jun: 948 Jun – 14 Jun: 11915 Jun – 21 Jun: 23722 Jun – 28 Jun: 1329 Jun – 5 Jul: 786 Jul – 12 Jul: 19813 Jul – 19 Jul: 11020 Jul – 26 Jul: 35727 Jul – 2 Aug: 2913 Aug – 9 Aug: 12310 Aug – 16 Aug: 18617 Aug – 23 Aug: 19124 Aug – 30 Aug: 9931 Aug – 6 Sept: 777 Sept – 13 Sept: 39014 Sept – 20 Sept: 41121 Sept – 27 Sept: 5,41828 Sept – 4 Oct: 4,2455 Oct – 11 Oct: 48,17812 Oct – 18 Oct: 32,68119 Oct – 25 Oct: 11,355

Others providing29

LLM integration
  1. llm_clientABAP client with one interface to chat-completion LLM APIsfrom ABAP
  2. abap-agent-runtimeABAP-native MCP endpoint that drives opted-in abap2UI5 appsfrom ABAP
  3. abap_btocs_ollamaB-Tocs ABAP SDK plugin connecting to Ollama modelsfrom ABAP
  4. SAP AI CoreAI runtime on BTP with the Generative AI Hubfrom BTP/BAIP
  5. cap-java/cds-aiBridge from CAP Java to SAP AI Core, with Fiori field recommendationsfrom CAP
  6. cap-llm-pluginGenerative AI in CAP with fields anonymised through SAP HANAfrom CAP
  7. @geertjanklaps/cds-toon-ai-protocol-adapterProtocol adapter serving CAP data as TOON instead of JSONfrom CAP
  8. abap-sdk-nwas-xABAP client library for IBM watsonx.ai APIsfrom ABAP
  9. @jerome-benoit/sap-ai-providerVercel AI SDK provider for SAP AI Corefrom CAP
  10. ui5-cap-ai-featuresCDS plugin and UI5 controls for AI text features via SAP AI Corefrom CAP
  11. Microsoft AI SDK for SAPABAP library for calling Azure OpenAI and OpenAIfrom ABAP
  12. zllmABAP framework for chaining and orchestrating LLM callsfrom ABAP
  13. ABAP AI SDKSAP reuse library for calling large language models from ABAPfrom ABAP
  14. @sap-ai-sdk/ai-apiAI Core control plane API surface of SAP's AI SDKfrom CAP
  15. @sap-ai-sdk/coreShared internals of SAP's AI SDKfrom CAP
  16. @sap-ai-sdk/foundation-modelsClient for foundation models via SAP AI Core and Generative AI Hubfrom CAP
  17. @sap-ai-sdk/orchestrationOrchestration Service client for templating, grounding and maskingfrom CAP
  18. @sap-ai-sdk/prompt-registryClient for prompts kept in SAP's prompt registryfrom CAP
  19. @saptarishi/cds-plugin-llmCAP service kind putting eleven model providers behind one APIfrom CAP
  20. @shahid.la/cds-db-nlquery-mcpMCP server answering plain-English questions against a CDS schemafrom CAP
  21. @ui5/webcomponentsSAP's UI elements as standard custom elementsfrom UI5
  22. abap-sdk-nwasAn ABAP client library for IBM Watson's Discovery, Language Translator, Natural Language Understanding, Speech to Text, Text to Speech and Assistant services, installed through abapGit.from ABAP
Retrieval-augmented generation
  1. SAP AI CoreAI runtime on BTP with the Generative AI Hubfrom BTP/BAIP
  2. SAP HANA CloudManaged SAP HANA database service on BTPfrom BTP/BAIP
  3. cap-llm-pluginGenerative AI in CAP with fields anonymised through SAP HANAfrom CAP
  4. @mi8y/cap-agents-aicore-vectorstoreLangChain vector store on SAP AI Core Document Groundingfrom CAP
  5. @mi8y/cap-agents-cds-vectorstoreLangChain vector store with CDS entities for embeddingsfrom CAP
  6. zvdbVector database implemented in ABAP for document chunk retrievalfrom ABAP
  7. @sap/cdsCAP Node.js runtimefrom CAP
  8. @saptarishi/cds-plugin-llmCAP service kind putting eleven model providers behind one APIfrom CAP
  9. @saptarishi/cds-plugin-vector-hanaVector storage and similarity search on SAP HANA from CAPfrom CAP
  10. sap-knowledge-pipelinePython library turning OData or HANA records into chunked documentsfrom BTP/BAIP

Details

Sources5
npm registrydiscovered herechecked
capirediscovered here, pluginschecked
npm registry, @cap-js/aiversion, releases, installschecked
github.com/git+https://github.com/cap-js/ai.gittree, pushes, contributors, CIchecked
README.mdquoted, and what the entry declareschecked

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
runtimesnode
declared for>=9
latestv1.2.1
first release
releases and cadence6, ~37d median
discovered vianpm registry, capire · plugins
first seen in the atlas
ecosystem and domaincap, ai-and-agents
Contributors7
History in the atlas8
  1. model_access: SAP AI Core
  2. the same page's whole sentence, checked 2026-10-15
  3. production; the mock is for UI smoke tests
  4. +sap-cds, +btp-ai-core
  5. capability:llm-integration, capability:retrieval-augmented-generation
  6. Out-of-the-box value-help recommendations powered by SAP RPT-1, [SAP AI Core](artifact:btp-ai-core) as a standard CAP service, and an experimental local embedding model behind SQLite's vector functions.
  7. capire states the version range the local embeddings need, @sap/cds ^10.1 and @cap-js/sqlite ^3.1. The database plugin is the one of the two that is an edge; the runtime range belongs to the plugin's own manifest, which was not read here.
  8. First seen.
For your agent