@aws-cdk/aws-bedrock-agentcore-alpha 2.221.1-alpha.0 → 2.222.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +3794 -502
- package/.jsii.tabl.json.gz +0 -0
- package/.warnings.jsii.js +69 -1
- package/README.md +327 -5
- package/agentcore/index.d.ts +4 -0
- package/agentcore/index.js +5 -1
- package/agentcore/memory/memory-strategy.d.ts +164 -0
- package/agentcore/memory/memory-strategy.js +174 -0
- package/agentcore/memory/memory.d.ts +538 -0
- package/agentcore/memory/memory.js +661 -0
- package/agentcore/memory/perms.d.ts +63 -0
- package/agentcore/memory/perms.js +90 -0
- package/agentcore/memory/strategies/managed-strategy.d.ts +133 -0
- package/agentcore/memory/strategies/managed-strategy.js +209 -0
- package/agentcore/memory/strategies/self-managed-strategy.d.ts +127 -0
- package/agentcore/memory/strategies/self-managed-strategy.js +254 -0
- package/agentcore/memory/validation-helpers.d.ts +41 -0
- package/agentcore/memory/validation-helpers.js +89 -0
- package/agentcore/network/network-configuration.js +4 -4
- package/agentcore/runtime/runtime-artifact.js +1 -1
- package/agentcore/runtime/runtime-authorizer-configuration.d.ts +4 -4
- package/agentcore/runtime/runtime-authorizer-configuration.js +13 -32
- package/agentcore/runtime/runtime-base.js +3 -13
- package/agentcore/runtime/runtime-endpoint-base.js +1 -1
- package/agentcore/runtime/runtime-endpoint.js +1 -1
- package/agentcore/runtime/runtime.d.ts +2 -2
- package/agentcore/runtime/runtime.js +16 -17
- package/agentcore/runtime/types.d.ts +5 -1
- package/agentcore/runtime/types.js +5 -1
- package/agentcore/tools/browser.js +2 -2
- package/agentcore/tools/code-interpreter.js +2 -2
- package/package.json +14 -7
- package/rosetta/default.ts-fixture +4 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
|
|
5
|
+
* with the License. A copy of the License is located at
|
|
6
|
+
*
|
|
7
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES
|
|
10
|
+
* OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions
|
|
11
|
+
* and limitations under the License.
|
|
12
|
+
*/
|
|
13
|
+
import { Duration, IResource, Resource } from 'aws-cdk-lib';
|
|
14
|
+
import { Construct } from 'constructs';
|
|
15
|
+
import { DimensionsMap, Metric, MetricOptions } from 'aws-cdk-lib/aws-cloudwatch';
|
|
16
|
+
import * as iam from 'aws-cdk-lib/aws-iam';
|
|
17
|
+
import * as kms from 'aws-cdk-lib/aws-kms';
|
|
18
|
+
import { IMemoryStrategy } from './memory-strategy';
|
|
19
|
+
/******************************************************************************
|
|
20
|
+
* Interface
|
|
21
|
+
*****************************************************************************/
|
|
22
|
+
/**
|
|
23
|
+
* Interface for Memory resources
|
|
24
|
+
*/
|
|
25
|
+
export interface IMemory extends IResource, iam.IGrantable {
|
|
26
|
+
/**
|
|
27
|
+
* The ARN of the memory resource
|
|
28
|
+
* @attribute
|
|
29
|
+
*/
|
|
30
|
+
readonly memoryArn: string;
|
|
31
|
+
/**
|
|
32
|
+
* The id of the memory
|
|
33
|
+
* @attribute
|
|
34
|
+
*/
|
|
35
|
+
readonly memoryId: string;
|
|
36
|
+
/**
|
|
37
|
+
* The IAM role that provides permissions for the memory to access AWS services.
|
|
38
|
+
*/
|
|
39
|
+
readonly executionRole?: iam.IRole;
|
|
40
|
+
/**
|
|
41
|
+
* Custom KMS key for encryption (if provided)
|
|
42
|
+
*/
|
|
43
|
+
readonly kmsKey?: kms.IKey;
|
|
44
|
+
/**
|
|
45
|
+
* The status of the memory
|
|
46
|
+
* @attribute
|
|
47
|
+
*/
|
|
48
|
+
readonly status?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Timestamp when the memory was last updated
|
|
51
|
+
* @attribute
|
|
52
|
+
*/
|
|
53
|
+
readonly updatedAt?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Timestamp when the memory was created
|
|
56
|
+
* @attribute
|
|
57
|
+
*/
|
|
58
|
+
readonly createdAt?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Grant the given principal identity permissions to perform actions on this memory.
|
|
61
|
+
*/
|
|
62
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
63
|
+
/**
|
|
64
|
+
* Grant the given principal identity permissions to write content to this memory.
|
|
65
|
+
*/
|
|
66
|
+
grantWrite(grantee: iam.IGrantable): iam.Grant;
|
|
67
|
+
/**
|
|
68
|
+
* Grant the given principal identity permissions to read the contents of this memory.
|
|
69
|
+
* Both Short-Term Memory (STM) and Long-Term Memory (LTM).
|
|
70
|
+
*/
|
|
71
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
72
|
+
/**
|
|
73
|
+
* Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.
|
|
74
|
+
*/
|
|
75
|
+
grantReadShortTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
76
|
+
/**
|
|
77
|
+
* Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.
|
|
78
|
+
*/
|
|
79
|
+
grantReadLongTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
80
|
+
/**
|
|
81
|
+
* Grant the given principal identity permissions to delete content on this memory.
|
|
82
|
+
*/
|
|
83
|
+
grantDelete(grantee: iam.IGrantable): iam.Grant;
|
|
84
|
+
/**
|
|
85
|
+
* Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.
|
|
86
|
+
*/
|
|
87
|
+
grantDeleteShortTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
88
|
+
/**
|
|
89
|
+
* Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.
|
|
90
|
+
*/
|
|
91
|
+
grantDeleteLongTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
92
|
+
/**
|
|
93
|
+
* Grant the given principal identity permissions to manage the control plane of this memory.
|
|
94
|
+
*/
|
|
95
|
+
grantAdmin(grantee: iam.IGrantable): iam.Grant;
|
|
96
|
+
/**
|
|
97
|
+
* Grant the given principal identity permissions to do every action on this memory.
|
|
98
|
+
*/
|
|
99
|
+
grantFullAccess(grantee: iam.IGrantable): iam.Grant;
|
|
100
|
+
/**
|
|
101
|
+
* Return the given named metric for this memory.
|
|
102
|
+
*/
|
|
103
|
+
metric(metricName: string, dimensions: DimensionsMap, props?: MetricOptions): Metric;
|
|
104
|
+
/**
|
|
105
|
+
* Return the given named metric related to the API operation performed on this memory.
|
|
106
|
+
*/
|
|
107
|
+
metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric;
|
|
108
|
+
/**
|
|
109
|
+
* Return a metric measuring the latency of a specific API operation performed on this memory.
|
|
110
|
+
*/
|
|
111
|
+
metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
112
|
+
/**
|
|
113
|
+
* Return a metric containing the total number of API requests made for a specific memory operation.
|
|
114
|
+
*/
|
|
115
|
+
metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
116
|
+
/**
|
|
117
|
+
* Return a metric containing the number of errors for a specific API operation performed on this memory.
|
|
118
|
+
*/
|
|
119
|
+
metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the metric containing the number of created memory events and memory records.
|
|
122
|
+
*/
|
|
123
|
+
metricEventCreationCount(props?: MetricOptions): Metric;
|
|
124
|
+
}
|
|
125
|
+
/******************************************************************************
|
|
126
|
+
* ABSTRACT BASE CLASS
|
|
127
|
+
*****************************************************************************/
|
|
128
|
+
/**
|
|
129
|
+
* Abstract base class for a Memory.
|
|
130
|
+
* Contains methods and attributes valid for Memories either created with CDK or imported.
|
|
131
|
+
*/
|
|
132
|
+
export declare abstract class MemoryBase extends Resource implements IMemory {
|
|
133
|
+
abstract readonly memoryArn: string;
|
|
134
|
+
abstract readonly memoryId: string;
|
|
135
|
+
abstract readonly status?: string;
|
|
136
|
+
abstract readonly updatedAt?: string;
|
|
137
|
+
abstract readonly createdAt?: string;
|
|
138
|
+
abstract readonly executionRole?: iam.IRole;
|
|
139
|
+
abstract readonly kmsKey?: kms.IKey;
|
|
140
|
+
/**
|
|
141
|
+
* The principal to grant permissions to
|
|
142
|
+
*/
|
|
143
|
+
abstract readonly grantPrincipal: iam.IPrincipal;
|
|
144
|
+
constructor(scope: Construct, id: string);
|
|
145
|
+
/**
|
|
146
|
+
* Grants IAM actions to the IAM Principal
|
|
147
|
+
* @param grantee - The IAM principal to grant permissions to
|
|
148
|
+
* @param actions - The actions to grant
|
|
149
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
150
|
+
*/
|
|
151
|
+
grant(grantee: iam.IGrantable, ...actions: string[]): iam.Grant;
|
|
152
|
+
/**
|
|
153
|
+
* Grant the given principal identity permissions to write content to short-term memory.
|
|
154
|
+
*
|
|
155
|
+
* @param grantee - The IAM principal to grant read permissions to
|
|
156
|
+
* @default - Default grant configuration:
|
|
157
|
+
* - actions: ['bedrock-agentcore:CreateEvent'] on this.memoryArn
|
|
158
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
159
|
+
*/
|
|
160
|
+
grantWrite(grantee: iam.IGrantable): iam.Grant;
|
|
161
|
+
/**
|
|
162
|
+
* Grant the given principal identity permissions to read the contents of this memory.
|
|
163
|
+
* Both Short-Term Memory (STM) and Long-Term Memory (LTM).
|
|
164
|
+
*
|
|
165
|
+
* @param grantee - The IAM principal to grant read permissions to
|
|
166
|
+
* @default - Default grant configuration:
|
|
167
|
+
* - actions: ['bedrock-agentcore:GetMemoryRecord',
|
|
168
|
+
'bedrock-agentcore:RetrieveMemoryRecords',
|
|
169
|
+
'bedrock-agentcore:ListMemoryRecords',
|
|
170
|
+
'bedrock-agentcore:ListActors',
|
|
171
|
+
'bedrock-agentcore:ListSessions] on this.memoryArn
|
|
172
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
173
|
+
*/
|
|
174
|
+
grantRead(grantee: iam.IGrantable): iam.Grant;
|
|
175
|
+
/**
|
|
176
|
+
* Grant the given principal identity permissions to read the Short-Term Memory (STM) contents of this memory.
|
|
177
|
+
*
|
|
178
|
+
* @param grantee - The IAM principal to grant read permissions to
|
|
179
|
+
* @default - Default grant configuration:
|
|
180
|
+
* - actions: ['bedrock-agentcore:GetEvent',
|
|
181
|
+
'bedrock-agentcore:ListEvents',
|
|
182
|
+
'bedrock-agentcore:ListActors',
|
|
183
|
+
'bedrock-agentcore:ListSessions',] on this.memoryArn
|
|
184
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
185
|
+
*/
|
|
186
|
+
grantReadShortTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
187
|
+
/**
|
|
188
|
+
* Grant the given principal identity permissions to read the Long-Term Memory (LTM) contents of this memory.
|
|
189
|
+
*
|
|
190
|
+
* @param grantee - The IAM principal to grant read permissions to
|
|
191
|
+
* @default - Default grant configuration:
|
|
192
|
+
* - actions: ['bedrock-agentcore:GetMemoryRecord',
|
|
193
|
+
'bedrock-agentcore:RetrieveMemoryRecords',
|
|
194
|
+
'bedrock-agentcore:ListMemoryRecords',
|
|
195
|
+
'bedrock-agentcore:ListActors',
|
|
196
|
+
'bedrock-agentcore:ListSessions',] on this.memoryArn
|
|
197
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
198
|
+
*/
|
|
199
|
+
grantReadLongTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
200
|
+
/**
|
|
201
|
+
* Grant the given principal identity permissions to delete content on this memory.
|
|
202
|
+
*
|
|
203
|
+
* Both Short-Term Memory (STM) and Long-Term Memory (LTM).
|
|
204
|
+
*
|
|
205
|
+
* @param grantee - The IAM principal to grant delete permissions to
|
|
206
|
+
* @default - Default grant configuration:
|
|
207
|
+
* - actions: ['bedrock-agentcore:DeleteEvent',
|
|
208
|
+
'bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn
|
|
209
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
210
|
+
*/
|
|
211
|
+
grantDelete(grantee: iam.IGrantable): iam.Grant;
|
|
212
|
+
/**
|
|
213
|
+
* Grant the given principal identity permissions to delete Short-Term Memory (STM) content on this memory.
|
|
214
|
+
*
|
|
215
|
+
* @param grantee - The IAM principal to grant delete permissions to
|
|
216
|
+
* @default - Default grant configuration:
|
|
217
|
+
* - actions: ['bedrock-agentcore:DeleteEvent'] on this.memoryArn
|
|
218
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
219
|
+
*/
|
|
220
|
+
grantDeleteShortTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
221
|
+
/**
|
|
222
|
+
* Grant the given principal identity permissions to delete Long-Term Memory (LTM) content on this memory.
|
|
223
|
+
*
|
|
224
|
+
* @param grantee - The IAM principal to grant delete permissions to
|
|
225
|
+
* @default - Default grant configuration:
|
|
226
|
+
* - actions: ['bedrock-agentcore:DeleteMemoryRecord'] on this.memoryArn
|
|
227
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
228
|
+
*/
|
|
229
|
+
grantDeleteLongTermMemory(grantee: iam.IGrantable): iam.Grant;
|
|
230
|
+
/**
|
|
231
|
+
* Grant the given principal identity permissions to manage the control plane of this memory.
|
|
232
|
+
*
|
|
233
|
+
* @param grantee - The IAM principal to grant admin permissions to
|
|
234
|
+
* @default - Default grant configuration:
|
|
235
|
+
* - actions: ['bedrock-agentcore:CreateMemory',
|
|
236
|
+
'bedrock-agentcore:GetMemory',
|
|
237
|
+
'bedrock-agentcore:DeleteMemory',
|
|
238
|
+
'bedrock-agentcore:UpdateMemory'] on this.memoryArn
|
|
239
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
240
|
+
*/
|
|
241
|
+
grantAdmin(grantee: iam.IGrantable): iam.Grant;
|
|
242
|
+
/**
|
|
243
|
+
* Grant the given principal identity permissions to do every action on this memory.
|
|
244
|
+
*
|
|
245
|
+
* @param grantee - The IAM principal to grant full access permissions to
|
|
246
|
+
* @default - Default grant configuration:
|
|
247
|
+
* - actions: ['bedrock-agentcore:CreateEvent',
|
|
248
|
+
'bedrock-agentcore:GetEvent',
|
|
249
|
+
'bedrock-agentcore:DeleteEvent',
|
|
250
|
+
'bedrock-agentcore:GetMemoryRecord',
|
|
251
|
+
'bedrock-agentcore:RetrieveMemoryRecords',
|
|
252
|
+
'bedrock-agentcore:ListMemoryRecords',
|
|
253
|
+
'bedrock-agentcore:ListActors',
|
|
254
|
+
'bedrock-agentcore:ListSessions',
|
|
255
|
+
'bedrock-agentcore:CreateMemory',
|
|
256
|
+
'bedrock-agentcore:GetMemory',
|
|
257
|
+
'bedrock-agentcore:DeleteMemory',
|
|
258
|
+
'bedrock-agentcore:UpdateMemory'] on this.memoryArn
|
|
259
|
+
* @returns An IAM Grant object representing the granted permissions
|
|
260
|
+
*/
|
|
261
|
+
grantFullAccess(grantee: iam.IGrantable): iam.Grant;
|
|
262
|
+
/**
|
|
263
|
+
* Return the given named metric for this memory.
|
|
264
|
+
*
|
|
265
|
+
* By default, the metric will be calculated as a sum over a period of 5 minutes.
|
|
266
|
+
* You can customize this by using the `statistic` and `period` properties.
|
|
267
|
+
*/
|
|
268
|
+
metric(metricName: string, dimensions: DimensionsMap, props?: MetricOptions): Metric;
|
|
269
|
+
/**
|
|
270
|
+
* Return the given named metric related to the API operation performed on this memory.
|
|
271
|
+
*/
|
|
272
|
+
metricForApiOperation(metricName: string, operation: string, props?: MetricOptions): Metric;
|
|
273
|
+
/**
|
|
274
|
+
* Return a metric measuring the latency of a specific API operation performed on this memory.
|
|
275
|
+
*
|
|
276
|
+
* The latency metric represents the total time elapsed between receiving the request and sending
|
|
277
|
+
* the final response token, measuring complete end-to-end processing time.
|
|
278
|
+
*
|
|
279
|
+
* For memory creation events specifically, this measures the time from the last CreateEvent
|
|
280
|
+
* that met strategy criteria until memory storage is completed.
|
|
281
|
+
*
|
|
282
|
+
*/
|
|
283
|
+
metricLatencyForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
284
|
+
/**
|
|
285
|
+
* Return a metric containing the total number of API requests made for a specific memory operation like
|
|
286
|
+
* `CreateEvent`, `ListEvents`, `RetrieveMemoryRecords` ...
|
|
287
|
+
*/
|
|
288
|
+
metricInvocationsForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
289
|
+
/**
|
|
290
|
+
* Return a metric containing the number of errors for a specific API operation performed on this memory.
|
|
291
|
+
*/
|
|
292
|
+
metricErrorsForApiOperation(operation: string, props?: MetricOptions): Metric;
|
|
293
|
+
/**
|
|
294
|
+
* Returns the metric containing the number of short-term memory events.
|
|
295
|
+
*/
|
|
296
|
+
metricEventCreationCount(props?: MetricOptions): Metric;
|
|
297
|
+
/**
|
|
298
|
+
* Returns the metric containing the number of long-term memory records
|
|
299
|
+
* created by the long-term extraction strategies.
|
|
300
|
+
*/
|
|
301
|
+
metricMemoryRecordCreationCount(props?: MetricOptions): Metric;
|
|
302
|
+
/**
|
|
303
|
+
* Internal method to create a metric.
|
|
304
|
+
*/
|
|
305
|
+
private configureMetric;
|
|
306
|
+
}
|
|
307
|
+
/******************************************************************************
|
|
308
|
+
* PROPS FOR NEW CONSTRUCT
|
|
309
|
+
*****************************************************************************/
|
|
310
|
+
/**
|
|
311
|
+
* Properties for creating a Memory resource
|
|
312
|
+
*/
|
|
313
|
+
export interface MemoryProps {
|
|
314
|
+
/**
|
|
315
|
+
* The name of the memory
|
|
316
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore)
|
|
317
|
+
* The name must start with a letter and can be up to 48 characters long
|
|
318
|
+
* Pattern: [a-zA-Z][a-zA-Z0-9_]{0,47}
|
|
319
|
+
* @required - No
|
|
320
|
+
*/
|
|
321
|
+
readonly memoryName: string;
|
|
322
|
+
/**
|
|
323
|
+
* Short-term memory expiration in days (between 7 and 365).
|
|
324
|
+
* Sets the short-term (raw event) memory retention.
|
|
325
|
+
* Events older than the specified duration will expire and no longer be stored.
|
|
326
|
+
* @default 90
|
|
327
|
+
* @required - No
|
|
328
|
+
*/
|
|
329
|
+
readonly expirationDuration?: Duration;
|
|
330
|
+
/**
|
|
331
|
+
* Optional description for the memory
|
|
332
|
+
* Valid characters are a-z, A-Z, 0-9, _ (underscore), - (hyphen) and spaces
|
|
333
|
+
* The description can have up to 200 characters
|
|
334
|
+
* @default No description
|
|
335
|
+
* @required - No
|
|
336
|
+
*/
|
|
337
|
+
readonly description?: string;
|
|
338
|
+
/**
|
|
339
|
+
* Custom KMS key to use for encryption.
|
|
340
|
+
* @default Your data is encrypted with a key that AWS owns and manages for you
|
|
341
|
+
* @required - No
|
|
342
|
+
*/
|
|
343
|
+
readonly kmsKey?: kms.IKey;
|
|
344
|
+
/**
|
|
345
|
+
* If you need long-term memory for context recall across sessions,
|
|
346
|
+
* you can setup memory extraction strategies to extract the relevant memory from the raw events.
|
|
347
|
+
* @default No extraction strategies (short term memory only)
|
|
348
|
+
* @required - No
|
|
349
|
+
*/
|
|
350
|
+
readonly memoryStrategies?: IMemoryStrategy[];
|
|
351
|
+
/**
|
|
352
|
+
* The IAM role that provides permissions for the memory to access AWS services
|
|
353
|
+
* when using custom strategies.
|
|
354
|
+
*
|
|
355
|
+
* @default A new role will be created.
|
|
356
|
+
* @required - No
|
|
357
|
+
*/
|
|
358
|
+
readonly executionRole?: iam.IRole;
|
|
359
|
+
/**
|
|
360
|
+
* Tags (optional)
|
|
361
|
+
* A list of key:value pairs of tags to apply to this memory resource
|
|
362
|
+
*
|
|
363
|
+
* @default {} no tags
|
|
364
|
+
* @required - No
|
|
365
|
+
*/
|
|
366
|
+
readonly tags?: {
|
|
367
|
+
[key: string]: string;
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
/******************************************************************************
|
|
371
|
+
* ATTRS FOR IMPORTED CONSTRUCT
|
|
372
|
+
*****************************************************************************/
|
|
373
|
+
/**
|
|
374
|
+
* Attributes for specifying an imported Memory.
|
|
375
|
+
*/
|
|
376
|
+
export interface MemoryAttributes {
|
|
377
|
+
/**
|
|
378
|
+
* The ARN of the memory.
|
|
379
|
+
* @attribute
|
|
380
|
+
*/
|
|
381
|
+
readonly memoryArn: string;
|
|
382
|
+
/**
|
|
383
|
+
* The ARN of the IAM role associated to the memory.
|
|
384
|
+
* @attribute
|
|
385
|
+
*/
|
|
386
|
+
readonly roleArn: string;
|
|
387
|
+
/**
|
|
388
|
+
* When this memory was last updated.
|
|
389
|
+
* @default undefined - No last updated timestamp is provided
|
|
390
|
+
*/
|
|
391
|
+
readonly updatedAt?: string;
|
|
392
|
+
/**
|
|
393
|
+
* Optional KMS encryption key associated with this memory
|
|
394
|
+
* @default undefined - An AWS managed key is used
|
|
395
|
+
*/
|
|
396
|
+
readonly kmsKeyArn?: string;
|
|
397
|
+
/**
|
|
398
|
+
* The status of the memory.
|
|
399
|
+
* @default undefined - No status is provided
|
|
400
|
+
*/
|
|
401
|
+
readonly status?: string;
|
|
402
|
+
/**
|
|
403
|
+
* The created timestamp of the memory.
|
|
404
|
+
* @default undefined - No created timestamp is provided
|
|
405
|
+
*/
|
|
406
|
+
readonly createdAt?: string;
|
|
407
|
+
}
|
|
408
|
+
/******************************************************************************
|
|
409
|
+
* Class
|
|
410
|
+
*****************************************************************************/
|
|
411
|
+
/**
|
|
412
|
+
* Long-term memory store for extracted insights like user preferences, semantic facts and summaries.
|
|
413
|
+
* Enables knowledge retention across sessions by storing user preferences (e.g. coding style),
|
|
414
|
+
* semantic facts (e.g. learned info) and interaction summaries for context optimization.
|
|
415
|
+
*
|
|
416
|
+
* @see https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/memory.html
|
|
417
|
+
* @resource AWS::BedrockAgentCore::Memory
|
|
418
|
+
*/
|
|
419
|
+
export declare class Memory extends MemoryBase {
|
|
420
|
+
/** Uniquely identifies this class. */
|
|
421
|
+
static readonly PROPERTY_INJECTION_ID: string;
|
|
422
|
+
/**
|
|
423
|
+
* Static Method for importing an existing Bedrock AgentCore Memory.
|
|
424
|
+
*/
|
|
425
|
+
/**
|
|
426
|
+
* Creates an Memory reference from an existing memory's attributes.
|
|
427
|
+
*
|
|
428
|
+
* @param scope - The construct scope
|
|
429
|
+
* @param id - Identifier of the construct
|
|
430
|
+
* @param attrs - Attributes of the existing browser custom
|
|
431
|
+
* @returns An IBrowserCustom reference to the existing browser
|
|
432
|
+
*/
|
|
433
|
+
static fromMemoryAttributes(scope: Construct, id: string, attrs: MemoryAttributes): IMemory;
|
|
434
|
+
/**
|
|
435
|
+
* The ARN of the memory resource.
|
|
436
|
+
* @attribute
|
|
437
|
+
*/
|
|
438
|
+
readonly memoryArn: string;
|
|
439
|
+
/**
|
|
440
|
+
* The name of the memory.
|
|
441
|
+
* @attribute
|
|
442
|
+
*/
|
|
443
|
+
readonly memoryName: string;
|
|
444
|
+
/**
|
|
445
|
+
* The id of the memory.
|
|
446
|
+
* @attribute
|
|
447
|
+
*/
|
|
448
|
+
readonly memoryId: string;
|
|
449
|
+
/**
|
|
450
|
+
* The expiration days of the memory.
|
|
451
|
+
*/
|
|
452
|
+
readonly expirationDuration?: Duration;
|
|
453
|
+
/**
|
|
454
|
+
* The failure reason of the browser
|
|
455
|
+
* @attribute
|
|
456
|
+
*/
|
|
457
|
+
readonly failureReason?: string;
|
|
458
|
+
/**
|
|
459
|
+
* The description of the memory.
|
|
460
|
+
*/
|
|
461
|
+
readonly description?: string;
|
|
462
|
+
/**
|
|
463
|
+
* The execution role of the memory.
|
|
464
|
+
*/
|
|
465
|
+
readonly executionRole?: iam.IRole;
|
|
466
|
+
/**
|
|
467
|
+
* The status of the memory.
|
|
468
|
+
*/
|
|
469
|
+
readonly status?: string;
|
|
470
|
+
/**
|
|
471
|
+
* The created timestamp of the memory.
|
|
472
|
+
*/
|
|
473
|
+
readonly createdAt?: string;
|
|
474
|
+
/**
|
|
475
|
+
* The updated at timestamp of the memory.
|
|
476
|
+
*/
|
|
477
|
+
readonly updatedAt?: string;
|
|
478
|
+
/**
|
|
479
|
+
* Tags applied to this browser resource
|
|
480
|
+
* A map of key-value pairs for resource tagging
|
|
481
|
+
* @default - No tags applied
|
|
482
|
+
*/
|
|
483
|
+
readonly tags?: {
|
|
484
|
+
[key: string]: string;
|
|
485
|
+
};
|
|
486
|
+
/**
|
|
487
|
+
* The principal to grant permissions to
|
|
488
|
+
*/
|
|
489
|
+
readonly grantPrincipal: iam.IPrincipal;
|
|
490
|
+
/**
|
|
491
|
+
* The KMS key used to encrypt the memory.
|
|
492
|
+
*/
|
|
493
|
+
readonly kmsKey?: kms.IKey;
|
|
494
|
+
/**
|
|
495
|
+
* The memory strategies used by the memory.
|
|
496
|
+
* @attribute
|
|
497
|
+
*/
|
|
498
|
+
readonly memoryStrategies: IMemoryStrategy[];
|
|
499
|
+
private readonly __resource;
|
|
500
|
+
constructor(scope: Construct, id: string, props: MemoryProps);
|
|
501
|
+
/**
|
|
502
|
+
* Add memory strategy to the memory.
|
|
503
|
+
* @default - No memory strategies.
|
|
504
|
+
*/
|
|
505
|
+
addMemoryStrategy(memoryStrategy: IMemoryStrategy): void;
|
|
506
|
+
/**
|
|
507
|
+
* Creates execution role needed for the memory to access AWS services
|
|
508
|
+
* @returns The created role
|
|
509
|
+
* @internal This is an internal core function and should not be called directly.
|
|
510
|
+
*/
|
|
511
|
+
private _createMemoryRole;
|
|
512
|
+
/**
|
|
513
|
+
* Validates the memory tags format
|
|
514
|
+
* @param tags The tags object to validate
|
|
515
|
+
* @returns Array of validation error messages, empty if valid
|
|
516
|
+
*/
|
|
517
|
+
private _validateMemoryTags;
|
|
518
|
+
/**
|
|
519
|
+
* Validates the memory name format
|
|
520
|
+
* @param name The memory name to validate
|
|
521
|
+
* @returns Array of validation error messages, empty if valid
|
|
522
|
+
*/
|
|
523
|
+
private _validateMemoryName;
|
|
524
|
+
/**
|
|
525
|
+
* Validates the memory expiration days
|
|
526
|
+
* @param expirationDays The memory expiration days to validate
|
|
527
|
+
* @returns Array of validation error messages, empty if valid
|
|
528
|
+
*/
|
|
529
|
+
private _validateMemoryExpirationDays;
|
|
530
|
+
/**
|
|
531
|
+
* Render the memory strategies.
|
|
532
|
+
*
|
|
533
|
+
* @returns Array of MemoryStrategyProperty objects in CloudFormation format, or undefined if no strategies are defined
|
|
534
|
+
* @default - undefined if no strategies are defined or array is empty
|
|
535
|
+
* @internal This is an internal core function and should not be called directly.
|
|
536
|
+
*/
|
|
537
|
+
private _renderMemoryStrategies;
|
|
538
|
+
}
|