Run Java / Spring AI Agents on AgentCore

AWS Developers · Intermediate ·🤖 AI Agents & Automation ·9mo ago

Key Takeaways

The video demonstrates how to deploy a Java Spring AI agent on Amazon Bedrock AgentCore Runtime, a container-based and serverless agent runtime, using a chat client builder and a configuration parameter to connect to the Amazon Nova Light model.

Full Transcript

So, lots of people are building AI agents, but where do we run those? There's the new Amazon Bedrock Agent Core runtime, which allows us to take a container built with any agent framework and get that up and running super quick on the cloud. So, let's take a look at how. First, I'm using a Java project with Spring AI, and I've used Spring AI to create my agent. So, to do that, I have a chat client builder, and I just create a chat client. That's going to be connected up to Bedrock. I do that through a configuration parameter, so we can go into my source, resources, and see where I've actually set up the model to point to the Amazon Nova Light model. And then I've set a few more parameters in here. To run on Agent Core runtime, we need to have a request handler for {slash} invocations, and we need to have another request handler for {slash} ping, which will determine if the application is healthy, if the agent can respond to requests. So, I've set those parameters here in the configuration. Now, let's go look at the source code. I've got the chat client, and I've plugged those into a post mapping handler in Spring. So, whenever I get an HTTP post into my application, that'll be handled by this function. It's going to take a prompt and then call Bedrock and return the response. I've then containerized this application. I've uploaded the container up to AWS, and now I'm going to go create a new Agent Core runtime environment for this thing to run it. So, to do that, I'm going to say host agent. I can give it a name. I can specify my Docker container, which is this one. And then I can assign the IAM permissions and hit host agent. That'll take a couple minutes to provision and get all up and running, but once it's up and running, what we'll see is, like this one, here's the information about this agent running on Agent Core runtime. And this thing is secured through IAM. And so, the easiest way to actually test this thing is just within the console, I can go to the agent sandbox, select which agent and which version I want to use, and then put in the JSON that I want to send to that invocations endpoint, which will go to my agent, go to Bedrock, and I'm going to say, all right, my question is, tell me a joke, and I hit run. So, now Agent Core runtime will spin up my container, send the request to it. That container will then make the request to Bedrock and return the response, and there we go. Sure enough, I see my response from my agent. Joke is, why did the scarecrow win an award? Because he was outstanding in his field. So, great joke, Bedrock, thank you, and hope you try out Agent Core with Java or with whatever agent framework you want to use.

Original Description

Running Java AI Agents on the cloud has never been easier than with Amazon Bedrock AgentCore Runtime! Check out this quick demo of deploying a Spring AI agent to the container-based, serverless, agent runtime!
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from AWS Developers · AWS Developers · 0 of 60

← Previous Next →
1 Using Microsoft Active Directory across On-premises and Cloud Workloads
Using Microsoft Active Directory across On-premises and Cloud Workloads
AWS Developers
2 What is Cloud Computing with AWS? | Hebrew Webinar
What is Cloud Computing with AWS? | Hebrew Webinar
AWS Developers
3 Best Practices for Getting Started with AWS | Hebrew Webinar
Best Practices for Getting Started with AWS | Hebrew Webinar
AWS Developers
4 Best Practices for Using AWS Identity and Access Management (IAM) Roles
Best Practices for Using AWS Identity and Access Management (IAM) Roles
AWS Developers
5 Building Scalable Web Apps | Hebrew Webinar
Building Scalable Web Apps | Hebrew Webinar
AWS Developers
6 Dev & Test on the AWS Cloud | Hebrew Webinar
Dev & Test on the AWS Cloud | Hebrew Webinar
AWS Developers
7 Storage & Backup on AWS | Hebrew webinar
Storage & Backup on AWS | Hebrew webinar
AWS Developers
8 Disaster Recovery on AWS | Hebrew Webinar
Disaster Recovery on AWS | Hebrew Webinar
AWS Developers
9 AWS Israel News  | Episode 1
AWS Israel News | Episode 1
AWS Developers
10 Security Best Practices on AWS | Hebrew Webinar
Security Best Practices on AWS | Hebrew Webinar
AWS Developers
11 Ready: Introduction to AI on AWS | Hebrew Webinar
Ready: Introduction to AI on AWS | Hebrew Webinar
AWS Developers
12 Set: What is ML for developers? | Hebrew Webinar
Set: What is ML for developers? | Hebrew Webinar
AWS Developers
13 Go!: Building your own ChatBot with Amazon Lex | Hebrew Webinar
Go!: Building your own ChatBot with Amazon Lex | Hebrew Webinar
AWS Developers
14 And Beyond: Amazon Sagemaker | Hebrew Webinar
And Beyond: Amazon Sagemaker | Hebrew Webinar
AWS Developers
15 Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech Talks
Building API-Driven Microservices with Amazon API Gateway - AWS Online Tech Talks
AWS Developers
16 Understanding AWS Secrets Manager - AWS Online Tech Talks
Understanding AWS Secrets Manager - AWS Online Tech Talks
AWS Developers
17 Best Practices for Building Enterprise Grade APIs with Amazon API Gateway - AWS Online Tech Talks
Best Practices for Building Enterprise Grade APIs with Amazon API Gateway - AWS Online Tech Talks
AWS Developers
18 Build, Train and Deploy Machine Learning Models on AWS with Amazon SageMaker - AWS Online Tech Talks
Build, Train and Deploy Machine Learning Models on AWS with Amazon SageMaker - AWS Online Tech Talks
AWS Developers
19 AWS Israel News | Episode 2 | re:Invent
AWS Israel News | Episode 2 | re:Invent
AWS Developers
20 AWS Floor28 News - January
AWS Floor28 News - January
AWS Developers
21 AWS Floor28 News - February - Hebrew
AWS Floor28 News - February - Hebrew
AWS Developers
22 AWS Floor28 News - March - Hebrew
AWS Floor28 News - March - Hebrew
AWS Developers
23 AWS Floor28 News - April - Hebrew
AWS Floor28 News - April - Hebrew
AWS Developers
24 AWS Floor28 News - May - Hebrew
AWS Floor28 News - May - Hebrew
AWS Developers
25 Authentication for Your Applications: Getting Started with Amazon Cognito - AWS Online Tech Talks
Authentication for Your Applications: Getting Started with Amazon Cognito - AWS Online Tech Talks
AWS Developers
26 AWS Floor28 News - June - Hebrew
AWS Floor28 News - June - Hebrew
AWS Developers
27 AWS Floor28 News - July - Hebrew
AWS Floor28 News - July - Hebrew
AWS Developers
28 Enriching your app with Image Recognition and AWS AI Services - AWS Webinar - Hebrew
Enriching your app with Image Recognition and AWS AI Services - AWS Webinar - Hebrew
AWS Developers
29 Personalize, Forcast, and Textract - AWS Webinar - Hebrew
Personalize, Forcast, and Textract - AWS Webinar - Hebrew
AWS Developers
30 Managing Your ML Development Lifecycle with Amazon SageMaker - AWS Webinar - Hebrew
Managing Your ML Development Lifecycle with Amazon SageMaker - AWS Webinar - Hebrew
AWS Developers
31 Running your ML code in Amazon Sagemaker - AWS Webinar - Hebrew
Running your ML code in Amazon Sagemaker - AWS Webinar - Hebrew
AWS Developers
32 Get Started in Minutes with Amazon Connect in Your Contact Center - AWS Online Tech Talks
Get Started in Minutes with Amazon Connect in Your Contact Center - AWS Online Tech Talks
AWS Developers
33 AWS Floor28 News - August - Hebrew
AWS Floor28 News - August - Hebrew
AWS Developers
34 AWS Floor28 News - September - Hebrew
AWS Floor28 News - September - Hebrew
AWS Developers
35 Deep Dive on Amazon EventBridge - AWS Online Tech Talks
Deep Dive on Amazon EventBridge - AWS Online Tech Talks
AWS Developers
36 Advanced Serverless Orchestration with AWS Step Functions - AWS Online Tech Talks
Advanced Serverless Orchestration with AWS Step Functions - AWS Online Tech Talks
AWS Developers
37 Living on the Edge - an Introduction to  Amazon CloudFront and Lambda@Edge  - Hebrew Webinar
Living on the Edge - an Introduction to Amazon CloudFront and Lambda@Edge - Hebrew Webinar
AWS Developers
38 AWS Floor28 News - October - Hebrew - YouTube
AWS Floor28 News - October - Hebrew - YouTube
AWS Developers
39 What's New with AWS Storage - AWS Online Tech Talks
What's New with AWS Storage - AWS Online Tech Talks
AWS Developers
40 How to Build a Compelling Migration Business Case Using TSO Logic - AWS Online Tech Talks
How to Build a Compelling Migration Business Case Using TSO Logic - AWS Online Tech Talks
AWS Developers
41 Configuring and Managing Amazon S3 Replication - AWS Online Tech Talks
Configuring and Managing Amazon S3 Replication - AWS Online Tech Talks
AWS Developers
42 AWS Floor28 News - November - Hebrew
AWS Floor28 News - November - Hebrew
AWS Developers
43 Using Relational Databases with AWS Lambda - Easy Connection Pooling - AWS Online Tech Talks
Using Relational Databases with AWS Lambda - Easy Connection Pooling - AWS Online Tech Talks
AWS Developers
44 AWS Floor28 News - December 2019 - Hebrew
AWS Floor28 News - December 2019 - Hebrew
AWS Developers
45 AWS Floor28 News - January 2020 - Hebrew
AWS Floor28 News - January 2020 - Hebrew
AWS Developers
46 Top 10 Data Migration Best Practices - AWS Online Tech Talks
Top 10 Data Migration Best Practices - AWS Online Tech Talks
AWS Developers
47 How to Use Azure Active Directory with AWS SSO - AWS Online Tech Talks
How to Use Azure Active Directory with AWS SSO - AWS Online Tech Talks
AWS Developers
48 AWS Tips & Tricks - Amazon Redshift Advisor - Hebrew
AWS Tips & Tricks - Amazon Redshift Advisor - Hebrew
AWS Developers
49 AWS Tips & Tricks - Amazon Redshift Elastic Resize - Hebrew
AWS Tips & Tricks - Amazon Redshift Elastic Resize - Hebrew
AWS Developers
50 AWS Tips & Tricks - Amazon Redshift Spectrum - Hebrew
AWS Tips & Tricks - Amazon Redshift Spectrum - Hebrew
AWS Developers
51 AWS Tips & Tricks - Savings Plans & Cost Explorer - Hebrew
AWS Tips & Tricks - Savings Plans & Cost Explorer - Hebrew
AWS Developers
52 AWS Tips & Tricks - Amazon Redshift Concurrency Scaling - Hebrew
AWS Tips & Tricks - Amazon Redshift Concurrency Scaling - Hebrew
AWS Developers
53 AWS Tips & Tricks - Training Models with Amazon SageMaker - Hebrew
AWS Tips & Tricks - Training Models with Amazon SageMaker - Hebrew
AWS Developers
54 AWS Tips & Tricks - Auto Model Tuning with Amazon SageMaker - Hebrew
AWS Tips & Tricks - Auto Model Tuning with Amazon SageMaker - Hebrew
AWS Developers
55 AWS Tips & Tricks - Amazon Comprehend - Hebrew
AWS Tips & Tricks - Amazon Comprehend - Hebrew
AWS Developers
56 Understanding High Availability and Disaster Recovery Features for Amazon RDS for Oracle
Understanding High Availability and Disaster Recovery Features for Amazon RDS for Oracle
AWS Developers
57 Amazon Forecast  – Forecasting  - From Months to Days (Hebrew)
Amazon Forecast – Forecasting - From Months to Days (Hebrew)
AWS Developers
58 Visualize your data with Amazon QuickSight (Hebrew)
Visualize your data with Amazon QuickSight (Hebrew)
AWS Developers
59 Amazon Kendra (Hebrew)
Amazon Kendra (Hebrew)
AWS Developers
60 AWS Floor28 News - AI/ML Special Edition
AWS Floor28 News - AI/ML Special Edition
AWS Developers

This video teaches how to deploy a Java Spring AI agent on Amazon Bedrock AgentCore Runtime, a container-based and serverless agent runtime, and how to configure IAM permissions and use Docker containers for deployment. The video demonstrates a quick demo of deploying a Spring AI agent to the AgentCore runtime and testing it using the agent sandbox.

Key Takeaways
  1. Create a Java project with Spring AI and build a chat client
  2. Configure the chat client to connect to the Amazon Nova Light model
  3. Set up request handlers for /invocations and /ping
  4. Containerize the application and upload it to AWS
  5. Create a new Agent Core runtime environment and specify the Docker container and IAM permissions
  6. Test the agent using the agent sandbox and send a JSON request to the invocations endpoint
💡 The Amazon Bedrock AgentCore Runtime provides a container-based and serverless agent runtime that allows for easy deployment and management of AI agents, and the use of Docker containers and IAM permissions enables secure and scalable deployment.

Related Reads

📰
How I Built a WhatsApp AI Assistant for a SA Salon - And What It Taught Me About Local AI
Building a WhatsApp AI assistant for a South African salon reduced no-show rates from 30% to 8%, teaching valuable lessons about local AI development
Dev.to AI
📰
{
Build a practical knowledge pipeline for AI agents to ingest and recall web, video, and document data from anywhere
Dev.to AI
📰
Why Adding More Rules Makes Your Agent Dumber - 268 Rules, 14 Always Loaded, and a Tool to Audit Yours
Adding more rules to an agent can decrease its performance, learn how to audit and optimize your rules
Dev.to · Xin & EQ
📰
Do not migrate an AI API by changing only the base URL
Learn why simply changing the base URL is not enough for a successful AI API migration and what steps to take instead
Dev.to · Edward Li
Up next
How to Build an AI Agent in UiPath (Step-by-Step Tutorial)
Kevin Stratvert
Watch →