CapabilityAI & AgentsNode.js, read from its artifacts

RAG on CDS

Answering a question from your own data rather than from what a model remembers — embeddings stored beside the records they describe, and a similarity search that runs where the data already is.

Showing artifacts, examples and content with confirmed Node.js applicability. View All CAP

Overview

SAP SHIPS
@cap-js/ai

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.

@sap/cds

Carries the modelled half: the Vector type is built into CDS and the vector functions are part of the query language, so an embedding is an element of an entity and a retrieval is a WHERE clause. vector_embedding turns a text into a vector, cosine_similarity and l2distance compare two, and a stored calculated element keeps a row's embedding in the database and recomputes it whenever the row changes. Splitting a text into chunks and assembling what was found into a prompt are not here.

A Node.js coverage assessment has not been written. View all flavors

THE COMMUNITY ADDS
cap-llm-plugin

Puts the retrieval into one call: a single method that embeds the question through SAP AI Core, searches SAP HANA Cloud's vector engine for the nearest rows and sends them on to the model. The embedding and the similarity search are also exposed on their own, for a handler that wants to keep the steps apart. What gets embedded, and when, is the application's: the README describes no chunking and no embed-on-write.

@mi8y/cap-agents-aicore-vectorstore

Reaches a Document Grounding collection through the LangChain vector store interface, so ingestion, chunk storage, embedding and retrieval happen in SAP AI Core and nothing is persisted in the application's database.

@mi8y/cap-agents-cds-vectorstore

Holds chunks, their embeddings and their metadata as CDS entities in the application's own database, and retrieves them by cosine similarity through the LangChain vector store interface.

@saptarishi/cds-plugin-llm

Answers the generation half only. ragChain takes documents the caller has already retrieved, assembles them into a prompt under a context budget and sends it to the configured provider; embed on the same client produces the vectors, and semanticCache and embeddingDedup reuse earlier answers. The store, the index and the search are not in the package, which is what @saptarishi/cds-plugin-vector-hana composes with it to supply.

@saptarishi/cds-plugin-vector-hana

Answers the storage and retrieval half inside a CAP project: a vector table per @rag-annotated entity kept in sync by the plugin's own CRUD handlers, top-K cosine search with an optional metadata filter, hybrid vector-and-keyword retrieval fused by reciprocal rank, and a RAG helper that assembles the hits into a citation-tagged prompt and calls a chat provider, with a streaming variant that returns the hits before the first token. The embedding and chat models come from a separate provider plugin, and the embedded unit is one row's projected fields.

A Node.js coverage assessment has not been written. View all flavors

Licence1

LicenceSAP Developer License Agreement 3.2 CAP§ 3AlwaysCovered SAP materials or a covered CAP customer application are included in training data, model development or model refinement.
  • § 3 Artificial Intelligence Training. The agreement prohibits use of the covered materials and customer applications for training artificial-intelligence models or systems.

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.

SAP Developer License Agreement 3.2 CAP →

Artifacts9

9 of 9 artifacts
ArtifactSignals
CDS plugins4
@cap-js/aiValue-help recommendations and SAP AI Core as a CAP service
Signals
Use terms
@saptarishi/cds-plugin-llmCAP service kind putting eleven model providers behind one API
Signals
Use terms
@saptarishi/cds-plugin-vector-hanaVector storage and similarity search on SAP HANA from CAP
Signals
Use terms
cap-llm-pluginGenerative AI in CAP with fields anonymised through SAP HANA
Signals
Functional boundary+1
Packages3
@mi8y/cap-agents-aicore-vectorstoreLangChain vector store on SAP AI Core Document Grounding
Signals
none
@mi8y/cap-agents-cds-vectorstoreLangChain vector store with CDS entities for embeddings
Signals
none
@sap/cdsCAP Node.js runtime
Signals
none
Services2
SAP AI CoreAI runtime on BTP with the Generative AI Hub
Signals
none
SAP HANA CloudManaged SAP HANA database service on BTP
Signals
Functional boundary

Content5

Group by
Piece, what it offers
CAP in the age of AI #7 - vector embeddings wrap-up
YouTube — SAP Developers playlists, DJ Adams, Johannes Vogt, part 7 of 7, Video
CAP in the age of AI
YouTube — SAP Developers playlists, DJ Adams, Johannes Vogt, Simon Engel, Stefan Rudi, Daniel Schlachter, Series
HANA Cloud’s VECTOR EMBEDDING in CAP and Comparison with OpenAI Embedding
SAP Community, lalitmohan, BlogThe reasoningA recipeRunnable code
Show 2 more
Using HANA Cloud’s "VECTOR_EMBEDDING" Function in CAP
SAP Community, Mio Yasutake, BlogThe reasoningRunnable code
RAG with SAP HANA Cloud Vector Engine, GenAI Hub & CAP
SAP Community, KevinR, BlogThe reasoningA recipeRunnable code
CAP in the age of AI #7 - vector embeddings wrap-up
YouTube — SAP Developers playlists, DJ Adams, Johannes Vogt, part 7 of 7, Video
HANA Cloud’s VECTOR EMBEDDING in CAP and Comparison with OpenAI Embedding
SAP Community, lalitmohan, BlogThe reasoningA recipeRunnable code
RAG with SAP HANA Cloud Vector Engine, GenAI Hub & CAP
SAP Community, KevinR, BlogThe reasoningA recipeRunnable code

Seen working5

ArtifactSignals
Samples5
cap-bp-ragEvent-driven RAG app with CAP, Cloud Integration and SAP HANA Cloud
No license
cap-embedding-functionCAP service computing embeddings with HANA Cloud vector_embedding
none
cap-vector-hcVECTOR_EMBEDDING in a CDS entity for FAQ similarity search
No license
SAP BTP AI Best Practice Demo - Vector Embedding (RAG) - CAPCAP samples embedding CSV rows into the SAP HANA Cloud vector store
Functional boundary
SAP BTP AI Best Practice Demo - Vector Query (RAG) - CAPCAP samples running RAG similarity queries over SAP HANA Cloud vectors
Functional boundary

Details

Coverage
statecore and community, CAP, Node.js, derived
also inABAP, BTP/BAIP
Designs that place it1
Integrating and Extending JouleIntegrating and Extending Joulereference architecturedocument grounding in customer-owned content
For your agent
Ref
capability:retrieval-augmented-generation
JSON
/capabilities/retrieval-augmented-generation.json
MCP
Connecting an agent