This track introduces attendees to building AI agents using the SAP Cloud SDK for AI (JavaScript) and LangGraph.
-
For this exercise, you will use VS Code as the IDE. Open the IDE by typing "Visual Studio Code" in the Windows search bar.
-
Open the terminal in VS Code by navigating to Terminal -> New Terminal from the top menu.
-
Clone the project repository by running the following command in the terminal:
git clone https://github.com/SAP-samples/teched2025-AI160.git
After cloning, you’ll see a new folder with the project’s name in the same location where you ran git clone. (By default, this folder is created in the user directory, e.g. C:\Users<user-name>\teched2025-AI160.)
-
Go to File → Open Folder, and select the cloned folder.
-
Verify that Node.js (v22) and npm are installed by running the following commands in the terminal:
node -v
npm -vThe project used for this session is a Purchase Order Management application with AI agent capabilities.
The necessary dependencies are specified in the package.json file.
The SAP Cloud SDK for AI uses the scope @sap-ai-sdk, including @sap-ai-sdk/langchain for LangGraph integration.
The application consists of three main components:
-
Agent (agent/): The AI agent server that handles purchase order analysis and escalation workflows.
- The po-agent.ts file contains the main agent logic using the Orchestration LangChain client and LangGraph state graphs.
- The tools/ directory contains various tools the agent can use.
- You will mainly work with these files during your exercises.
-
Mock Server (mock-server/): Simulates SAP S/4HANA Purchase Order APIs for testing.
-
UI (ui/): React frontend for interacting with the AI agent.
Note
The agent will not function properly until the exercises are completed.
Tip
The solutions to the exercises are provided but have been commented out. We strongly recommend that you attempt to solve the exercises by writing the code yourself instead of just uncommenting or copying the solution. This approach will allow you to experience the full developer workflow, including useful features like auto-completion and debugging. By typing the code, you'll better understand the agent logic, discover useful functions, and build muscle memory, all of which contribute to a deeper learning experience.
The exercises demonstrate how to build AI agents using the SAP Cloud SDK for AI and LangGraph. You'll learn to create state-based agents with tool calling capabilities and implement business logic through custom agent tools.
- Preparation
- Exercise 1 - Implementing Overdue PO Items Detection Agent
- Exercise 2 - Implementing Note Creation
- Exercise 3 - (Optional) Filter and Mask Content using Orchestration Service features
Start from here.