SAP

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Connect a CAP-level agent to AI Core

See the power of CAP-level agents when connected to SAP AI Core.

Overview

You will learn

  • ✔One way of configuring your CAP-level agent to be able to connect to an AI Core instance
DJ Adams D DJ Adams October 20, 2026
Created on October 15, 2026
Contributors

More from DJ Adams

See all 19 tutorials by DJ Adams →

Prerequisites

This is a special tutorial, to be used in the Developer Garage on the show floor at SAP TechEd 2026 in Berlin. We plan to replace this tutorial with an extended one on the same topic after the TechEd season is over.

This tutorial is designed to follow directly on from the Create an agent from a CAP service tutorial, which is therefore the main prerequisite here. In other words, remain in the development environment you are still in from that previous tutorial, and stay in the cap-create-agent/ project directory from there.

Steps

Intro

CAP-level agents can be configured in different ways to use LLMs, as described in the CAP-level Agents guide in Capire.

Following the CAP philosophy of local-first development and the “hybrid” approach which combines the best of both worlds, one way of moving from the mocked LLM that we saw in the previous tutorial to a real LLM is to run the agent locally but connect remotely to an instance of the SAP AI Core service.

In this tutorial we’ll configure such a connection, using an approach to supply credentials with a convenient feature from the SAP Cloud SDK for AI, a package which the CAP-level agents plugin @cap-js/agents uses.


Step 1 Step 1 Set the LLM configuration for AI Core use
—

We can configure the LLM used by an agent via cds.requires.llm. By default, the value (technically for cds.requires.llm.kind) in development mode is auto. In the previous exercise we explicitly set it to mock, using a process-specific environment variable like this: cds_requires_llm_kind=mock cds watch.

For this tutorial, we’ll set it to aicore. There are many places that are treated as sources for the effective environment beyond the process-specific environment variable used last time. This time we’ll use a .env file in the project directory here.

👉 First, stop any CAP server that might still be running from a previous tutorial.

👉 Next, in the cap-create-agent/ directory (see the Prerequisites section above), add the following to a new file .env:

Text
cds.requires.llm.kind=aicore
cds.requires.llm.resourceGroup=codejam-genai

A note on the resourceGroup setting:

In SAP AI Core, resource groups are unique workspace environments with their own specific configuration, artifacts and more. SAP AI Core’s “extended” service plan is required for agent use, as it makes access available to foundation models and Generative AI Hub features.

So for this sort of CAP-level agent setup with an LLM provided via SAP AI Core, a resource group that has been set up in the context of the “extended” plan is required.

For the purposes of this tutorial at SAP TechEd 2026 in Berlin, we have made available an SAP AI Core instance, with such a resource group called codejam-genai; some of you may recognise this from one of the CodeJams run by the Developer Advocates.

Step 2 Step 2 Try out the agent to LLM connectivity
+
Step 3 Step 3 Add credential information
+
Step 4 Step 4 - Retry with the configuration and credentials
+
Step 5 Wrap-up and further info
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 5
1. Step 1 Set the LLM configuration for AI Core use 2. Step 2 Try out the agent to LLM connectivity 3. Step 3 Add credential information 4. Step 4 - Retry with the configuration and credentials 5. Wrap-up and further info
Next