Experimental
@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
SessionSummaryMemoryProps Struct
Properties for SessionSummaryConfiguration.
| Stability | Experimental |
|---|---|
| Source | bedrock/agents/memory.ts |
Example
ts
const agent = new bedrock.Agent(this, 'MyAgent', {
agentName: 'MyAgent',
instruction: 'Your instruction here',
foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
memory: Memory.sessionSummary({
maxRecentSessions: 10, // Keep the last 10 session summaries
memoryDuration: Duration.days(20), // Retain summaries for 20 days
}),
});
python
agent = bedrock.Agent(self, "MyAgent",
agent_name="MyAgent",
instruction="Your instruction here",
foundation_model=bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
memory=Memory.session_summary(
max_recent_sessions=10, # Keep the last 10 session summaries
memory_duration=Duration.days(20)
)
)
java
Agent agent = Agent.Builder.create(this, "MyAgent")
.agentName("MyAgent")
.instruction("Your instruction here")
.foundationModel(BedrockFoundationModel.AMAZON_NOVA_LITE_V1)
.memory(Memory.sessionSummary(SessionSummaryMemoryProps.builder()
.maxRecentSessions(10) // Keep the last 10 session summaries
.memoryDuration(Duration.days(20))
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.Bedrock.Alpha
var agent = new Agent(this, "MyAgent", new AgentProps {
AgentName = "MyAgent",
Instruction = "Your instruction here",
FoundationModel = BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
Memory = Memory.SessionSummary(new SessionSummaryMemoryProps {
MaxRecentSessions = 10, // Keep the last 10 session summaries
MemoryDuration = Duration.Days(20)
})
});
go
// Install: go get github.com/aws/aws-cdk-go/awsbedrockalpha/v2
agent := bedrock.NewAgent(this, jsii.String("MyAgent"), &AgentProps{
AgentName: jsii.String("MyAgent"),
Instruction: jsii.String("Your instruction here"),
FoundationModel: bedrock.BedrockFoundationModel_AMAZON_NOVA_LITE_V1(),
Memory: awsbedrockalpha.Memory_SessionSummary(&SessionSummaryMemoryProps{
MaxRecentSessions: jsii.Number(10),
// Keep the last 10 session summaries
MemoryDuration: awscdk.Duration_Days(jsii.Number(20)),
}),
})
Properties
maxRecentSessionsoptionalnumbermax_recent_sessionsoptionalint | floatmaxRecentSessionsoptionalNumberMaxRecentSessionsoptionaldoubleMaxRecentSessionsoptional*float64 = 20 #Maximum number of recent session summaries to include (min 1).