Overview
A Spring Boot starter that enables existing Spring Boot applications to conform to the AWS Bedrock AgentCore Runtime contract with minimal configuration. Simply add the dependency and annotate your agent methods.Version: 1.0.0-RC3
Modules
| Module | Description |
|---|---|
spring-ai-bedrock-agentcore-starter | Core starter for AgentCore Runtime integration |
spring-ai-memory-bedrock-agentcore | Spring AI ChatMemoryRepository using AgentCore Memory |
Key Features
Auto-configuration
Automatically sets up AgentCore endpoints when added as dependency
Annotation-based
Simple
@AgentCoreInvocation annotation to mark agent methodsSSE Streaming
Server-Sent Events support with
Flux<String> return typesHealth Checks
Built-in
/ping endpoint with Spring Boot Actuator integrationAsync Task Tracking
Prevents premature shutdown during background work
Rate Limiting
Built-in Bucket4j throttling for invocations and ping endpoints
Quick Start
1. Add Dependency
2. Create Agent Method
3. Run Application
The application will automatically expose:POST /invocations- Agent processing endpointGET /ping- Health check endpoint
Supported Method Signatures
Basic POJO Method
Basic POJO Method
With AgentCore Context
With AgentCore Context
Map Method (Flexible)
Map Method (Flexible)
String Method (text/plain)
String Method (text/plain)
SSE Streaming with Spring AI
SSE Streaming with Spring AI
Background Task Tracking
AWS Bedrock AgentCore Runtime monitors agent health and may shut down agents that appear idle. UseAgentCoreTaskTracker to communicate active work:
/ping endpoint returns:
- “Healthy” - Agent is ready, no background tasks
- “HealthyBusy” - Agent is healthy but actively processing (prevents shutdown)
- “Unhealthy” - Agent has issues (with Actuator integration)
Health Monitoring
Without Spring Boot Actuator:- Returns static “Healthy” status
- Always responds with HTTP 200
- Integrates with Actuator health checks
- Maps Actuator status:
UP→ “Healthy”,DOWN→ “Unhealthy” - Tracks status change timestamps
Custom Controller Override
Override default controllers with custom implementations using marker interfaces:Configuration
Memory Module
Thespring-ai-memory-bedrock-agentcore module provides Spring AI ChatMemoryRepository integration with AWS Bedrock AgentCore Memory for persistent conversation storage.
Add Dependency
Configure Memory
Use with Spring AI
Conversation ID Format
- Simple:
user123→ actor:user123, session:default-session - With Session:
user123:session456→ actor:user123, session:session456
Message Type Mapping
| Spring AI Message | AgentCore Role | Supported |
|---|---|---|
UserMessage | USER | Yes |
AssistantMessage | ASSISTANT | Yes |
SystemMessage | N/A | Filtered |
ToolResponseMessage | N/A | Filtered |
AWS Permissions
Examples
See theexamples/ directory in the repository:
| Example | Description |
|---|---|
simple-spring-boot-app/ | Minimal AgentCore agent with async task tracking |
spring-ai-sse-chat-client/ | SSE streaming with Spring AI and Amazon Bedrock |
spring-ai-simple-chat-client/ | Traditional Spring AI integration |
spring-ai-override-invocations/ | Custom controller override using marker interfaces |
spring-ai-extended-chat-client/ | Extended chat client with JWT and Terraform deployment |
spring-ai-memory-integration/ | Memory module integration example |
Requirements
- Java 17+
- Spring Boot 3.x
- Spring AI 1.1.1+ (for memory module)
Resources
GitHub Repository
Source code and contribution guidelines
AWS Bedrock AgentCore
AWS Bedrock AgentCore documentation