agentfootprint 6.42.0 → 6.43.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/dist/adapters/memory/bedrockAgentMemory.js +142 -0
- package/dist/adapters/memory/bedrockAgentMemory.js.map +1 -0
- package/dist/esm/adapters/memory/bedrockAgentMemory.js +138 -0
- package/dist/esm/adapters/memory/bedrockAgentMemory.js.map +1 -0
- package/dist/esm/memory-providers.js +3 -0
- package/dist/esm/memory-providers.js.map +1 -1
- package/dist/memory-providers.js +5 -1
- package/dist/memory-providers.js.map +1 -1
- package/dist/types/adapters/memory/bedrockAgentMemory.d.ts +96 -0
- package/dist/types/adapters/memory/bedrockAgentMemory.d.ts.map +1 -0
- package/dist/types/memory-providers.d.ts +1 -0
- package/dist/types/memory-providers.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* BedrockAgentMemory — read the **auto-generated session-summary memory** of a
|
|
4
|
+
* (legacy) Amazon **Bedrock Agents** agent (peer-dep `@aws-sdk/client-bedrock-agent-runtime`).
|
|
5
|
+
*
|
|
6
|
+
* import { BedrockAgentMemory } from 'agentfootprint/memory-providers';
|
|
7
|
+
*
|
|
8
|
+
* const mem = new BedrockAgentMemory({ agentId, agentAliasId, region: 'us-west-2' });
|
|
9
|
+
* const summaries = await mem.readSummaries(userMemoryId); // string summaries Bedrock wrote
|
|
10
|
+
*
|
|
11
|
+
* **This is NOT a `MemoryStore`** — and intentionally so. Bedrock Agents *owns the writes*:
|
|
12
|
+
* the agent generates `SESSION_SUMMARY` records itself (`GetAgentMemory` reads them,
|
|
13
|
+
* `DeleteAgentMemory` clears them). There is no "put an arbitrary entry" operation, so wrapping
|
|
14
|
+
* it as a `defineMemory({ store })` would be a "store that can't store." Instead it's a small
|
|
15
|
+
* **reader** you use to *surface* Bedrock's built-in memory — e.g. inject the summaries as a
|
|
16
|
+
* Fact/context block into an agentfootprint agent.
|
|
17
|
+
*
|
|
18
|
+
* For a real read/write agent memory store on AWS, use `AgentCoreStore` (the newer
|
|
19
|
+
* Bedrock **AgentCore** platform) — that's the go-forward path; this targets the prior-gen
|
|
20
|
+
* Bedrock Agents product and exists for teams migrating off it.
|
|
21
|
+
*
|
|
22
|
+
* Role: Outer ring. Lazy-requires the AWS SDK; zero cost when unused.
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.BedrockAgentMemory = void 0;
|
|
26
|
+
const lazyRequire_js_1 = require("../../lib/lazyRequire.js");
|
|
27
|
+
/**
|
|
28
|
+
* Read-only reader for Bedrock Agents' auto session-summary memory.
|
|
29
|
+
*
|
|
30
|
+
* @throws when `@aws-sdk/client-bedrock-agent-runtime` is not installed and no
|
|
31
|
+
* `_client`/`_sdk` is supplied.
|
|
32
|
+
*/
|
|
33
|
+
class BedrockAgentMemory {
|
|
34
|
+
client;
|
|
35
|
+
agentId;
|
|
36
|
+
agentAliasId;
|
|
37
|
+
maxItems;
|
|
38
|
+
constructor(options) {
|
|
39
|
+
if (!options.agentId || !options.agentAliasId) {
|
|
40
|
+
throw new Error('BedrockAgentMemory requires `agentId` and `agentAliasId`.');
|
|
41
|
+
}
|
|
42
|
+
this.agentId = options.agentId;
|
|
43
|
+
this.agentAliasId = options.agentAliasId;
|
|
44
|
+
this.maxItems = options.maxItems ?? 20;
|
|
45
|
+
this.client =
|
|
46
|
+
options._client ?? options.client ?? createBedrockAgentClient(options.region, options._sdk);
|
|
47
|
+
}
|
|
48
|
+
/** All session summaries Bedrock generated for `memoryId` (paginated). */
|
|
49
|
+
async readSummaries(memoryId, opts = {}) {
|
|
50
|
+
const out = [];
|
|
51
|
+
let nextToken;
|
|
52
|
+
do {
|
|
53
|
+
const page = await this.client.getSessionSummaries({
|
|
54
|
+
agentId: this.agentId,
|
|
55
|
+
agentAliasId: this.agentAliasId,
|
|
56
|
+
memoryId,
|
|
57
|
+
maxItems: opts.maxItems ?? this.maxItems,
|
|
58
|
+
...(nextToken !== undefined && { nextToken }),
|
|
59
|
+
});
|
|
60
|
+
out.push(...page.summaries);
|
|
61
|
+
nextToken = page.nextToken;
|
|
62
|
+
} while (nextToken);
|
|
63
|
+
return out;
|
|
64
|
+
}
|
|
65
|
+
/** The concatenated summary text — handy to inject as a single context/Fact block. */
|
|
66
|
+
async readText(memoryId) {
|
|
67
|
+
return (await this.readSummaries(memoryId)).map((s) => s.summaryText).join('\n\n');
|
|
68
|
+
}
|
|
69
|
+
/** Clear Bedrock's memory for `memoryId` (optionally a single `sessionId`). */
|
|
70
|
+
async forget(memoryId, sessionId) {
|
|
71
|
+
await this.client.deleteMemory({
|
|
72
|
+
agentId: this.agentId,
|
|
73
|
+
agentAliasId: this.agentAliasId,
|
|
74
|
+
memoryId,
|
|
75
|
+
...(sessionId !== undefined && { sessionId }),
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.BedrockAgentMemory = BedrockAgentMemory;
|
|
80
|
+
function toIso(v) {
|
|
81
|
+
if (v instanceof Date)
|
|
82
|
+
return v.toISOString();
|
|
83
|
+
return typeof v === 'string' ? v : undefined;
|
|
84
|
+
}
|
|
85
|
+
function createBedrockAgentClient(region, injected) {
|
|
86
|
+
let mod;
|
|
87
|
+
if (injected) {
|
|
88
|
+
mod = injected;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
try {
|
|
92
|
+
mod = (0, lazyRequire_js_1.lazyRequire)('@aws-sdk/client-bedrock-agent-runtime');
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
throw new Error('BedrockAgentMemory requires the `@aws-sdk/client-bedrock-agent-runtime` peer dependency.\n' +
|
|
96
|
+
' Install: npm install @aws-sdk/client-bedrock-agent-runtime\n' +
|
|
97
|
+
' Or pass `client` / `_client`.');
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (!mod.BedrockAgentRuntimeClient) {
|
|
101
|
+
throw new Error('BedrockAgentMemory: `@aws-sdk/client-bedrock-agent-runtime` is installed but ' +
|
|
102
|
+
'`BedrockAgentRuntimeClient` was not found. Update the SDK.');
|
|
103
|
+
}
|
|
104
|
+
const sdk = new mod.BedrockAgentRuntimeClient({ ...(region && { region }) });
|
|
105
|
+
const send = async (Ctor, name, input) => {
|
|
106
|
+
if (!Ctor) {
|
|
107
|
+
throw new Error(`BedrockAgentMemory: \`@aws-sdk/client-bedrock-agent-runtime\` is missing ${name}. Upgrade the SDK.`);
|
|
108
|
+
}
|
|
109
|
+
return sdk.send(new Ctor(input));
|
|
110
|
+
};
|
|
111
|
+
return {
|
|
112
|
+
async getSessionSummaries({ agentId, agentAliasId, memoryId, maxItems, nextToken }) {
|
|
113
|
+
const r = (await send(mod.GetAgentMemoryCommand, 'GetAgentMemoryCommand', {
|
|
114
|
+
agentId,
|
|
115
|
+
agentAliasId,
|
|
116
|
+
memoryType: 'SESSION_SUMMARY',
|
|
117
|
+
memoryId,
|
|
118
|
+
...(maxItems !== undefined && { maxItems }),
|
|
119
|
+
...(nextToken !== undefined && { nextToken }),
|
|
120
|
+
}));
|
|
121
|
+
const summaries = (r?.memoryContents ?? [])
|
|
122
|
+
.map((m) => m.sessionSummary)
|
|
123
|
+
.filter((s) => !!s)
|
|
124
|
+
.map((s) => ({
|
|
125
|
+
sessionId: s.sessionId ?? '',
|
|
126
|
+
summaryText: s.summaryText ?? '',
|
|
127
|
+
...(toIso(s.sessionStartTime) && { sessionStartTime: toIso(s.sessionStartTime) }),
|
|
128
|
+
...(toIso(s.sessionExpiryTime) && { sessionExpiryTime: toIso(s.sessionExpiryTime) }),
|
|
129
|
+
}));
|
|
130
|
+
return r?.nextToken ? { summaries, nextToken: r.nextToken } : { summaries };
|
|
131
|
+
},
|
|
132
|
+
async deleteMemory({ agentId, agentAliasId, memoryId, sessionId }) {
|
|
133
|
+
await send(mod.DeleteAgentMemoryCommand, 'DeleteAgentMemoryCommand', {
|
|
134
|
+
agentId,
|
|
135
|
+
agentAliasId,
|
|
136
|
+
memoryId,
|
|
137
|
+
...(sessionId !== undefined && { sessionId }),
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=bedrockAgentMemory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrockAgentMemory.js","sourceRoot":"","sources":["../../../src/adapters/memory/bedrockAgentMemory.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,6DAAuD;AA6CvD;;;;;GAKG;AACH,MAAa,kBAAkB;IACZ,MAAM,CAA+B;IACrC,OAAO,CAAS;IAChB,YAAY,CAAS;IACrB,QAAQ,CAAS;IAElC,YAAY,OAAkC;QAC5C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC;QACvC,IAAI,CAAC,MAAM;YACT,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,IAAI,wBAAwB,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAChG,CAAC;IAED,0EAA0E;IAC1E,KAAK,CAAC,aAAa,CACjB,QAAgB,EAChB,OAA8B,EAAE;QAEhC,MAAM,GAAG,GAA0B,EAAE,CAAC;QACtC,IAAI,SAA6B,CAAC;QAClC,GAAG,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;gBACjD,OAAO,EAAE,IAAI,C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ory — read the **auto-generated session-summary memory** of a
|
|
3
|
+
* (legacy) Amazon **Bedrock Agents** agent (peer-dep `@aws-sdk/client-bedrock-agent-runtime`).
|
|
4
|
+
*
|
|
5
|
+
* import { BedrockAgentMemory } from 'agentfootprint/memory-providers';
|
|
6
|
+
*
|
|
7
|
+
* const mem = new BedrockAgentMemory({ agentId, agentAliasId, region: 'us-west-2' });
|
|
8
|
+
* const summaries = await mem.readSummaries(userMemoryId); // string summaries Bedrock wrote
|
|
9
|
+
*
|
|
10
|
+
* **This is NOT a `MemoryStore`** — and intentionally so. Bedrock Agents *owns the writes*:
|
|
11
|
+
* the agent generates `SESSION_SUMMARY` records itself (`GetAgentMemory` reads them,
|
|
12
|
+
* `DeleteAgentMemory` clears them). There is no "put an arbitrary entry" operation, so wrapping
|
|
13
|
+
* it as a `defineMemory({ store })` would be a "store that can't store." Instead it's a small
|
|
14
|
+
* **reader** you use to *surface* Bedrock's built-in memory — e.g. inject the summaries as a
|
|
15
|
+
* Fact/context block into an agentfootprint agent.
|
|
16
|
+
*
|
|
17
|
+
* For a real read/write agent memory store on AWS, use `AgentCoreStore` (the newer
|
|
18
|
+
* Bedrock **AgentCore** platform) — that's the go-forward path; this targets the prior-gen
|
|
19
|
+
* Bedrock Agents product and exists for teams migrating off it.
|
|
20
|
+
*
|
|
21
|
+
* Role: Outer ring. Lazy-requires the AWS SDK; zero cost when unused.
|
|
22
|
+
*/
|
|
23
|
+
import { lazyRequire } from '../../lib/lazyRequire.js';
|
|
24
|
+
/**
|
|
25
|
+
* Read-only reader for Bedrock Agents' auto session-summary memory.
|
|
26
|
+
*
|
|
27
|
+
* @throws when `@aws-sdk/client-bedrock-agent-runtime` is not installed and no
|
|
28
|
+
* `_client`/`_sdk` is supplied.
|
|
29
|
+
*/
|
|
30
|
+
export class BedrockAgentMemory {
|
|
31
|
+
client;
|
|
32
|
+
agentId;
|
|
33
|
+
agentAliasId;
|
|
34
|
+
maxItems;
|
|
35
|
+
constructor(options) {
|
|
36
|
+
if (!options.agentId || !options.agentAliasId) {
|
|
37
|
+
throw new Error('BedrockAgentMemory requires `agentId` and `agentAliasId`.');
|
|
38
|
+
}
|
|
39
|
+
this.agentId = options.agentId;
|
|
40
|
+
this.agentAliasId = options.agentAliasId;
|
|
41
|
+
this.maxItems = options.maxItems ?? 20;
|
|
42
|
+
this.client =
|
|
43
|
+
options._client ?? options.client ?? createBedrockAgentClient(options.region, options._sdk);
|
|
44
|
+
}
|
|
45
|
+
/** All session summaries Bedrock generated for `memoryId` (paginated). */
|
|
46
|
+
async readSummaries(memoryId, opts = {}) {
|
|
47
|
+
const out = [];
|
|
48
|
+
let nextToken;
|
|
49
|
+
do {
|
|
50
|
+
const page = await this.client.getSessionSummaries({
|
|
51
|
+
agentId: this.agentId,
|
|
52
|
+
agentAliasId: this.agentAliasId,
|
|
53
|
+
memoryId,
|
|
54
|
+
maxItems: opts.maxItems ?? this.maxItems,
|
|
55
|
+
...(nextToken !== undefined && { nextToken }),
|
|
56
|
+
});
|
|
57
|
+
out.push(...page.summaries);
|
|
58
|
+
nextToken = page.nextToken;
|
|
59
|
+
} while (nextToken);
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
/** The concatenated summary text — handy to inject as a single context/Fact block. */
|
|
63
|
+
async readText(memoryId) {
|
|
64
|
+
return (await this.readSummaries(memoryId)).map((s) => s.summaryText).join('\n\n');
|
|
65
|
+
}
|
|
66
|
+
/** Clear Bedrock's memory for `memoryId` (optionally a single `sessionId`). */
|
|
67
|
+
async forget(memoryId, sessionId) {
|
|
68
|
+
await this.client.deleteMemory({
|
|
69
|
+
agentId: this.agentId,
|
|
70
|
+
agentAliasId: this.agentAliasId,
|
|
71
|
+
memoryId,
|
|
72
|
+
...(sessionId !== undefined && { sessionId }),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function toIso(v) {
|
|
77
|
+
if (v instanceof Date)
|
|
78
|
+
return v.toISOString();
|
|
79
|
+
return typeof v === 'string' ? v : undefined;
|
|
80
|
+
}
|
|
81
|
+
function createBedrockAgentClient(region, injected) {
|
|
82
|
+
let mod;
|
|
83
|
+
if (injected) {
|
|
84
|
+
mod = injected;
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
try {
|
|
88
|
+
mod = lazyRequire('@aws-sdk/client-bedrock-agent-runtime');
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
throw new Error('BedrockAgentMemory requires the `@aws-sdk/client-bedrock-agent-runtime` peer dependency.\n' +
|
|
92
|
+
' Install: npm install @aws-sdk/client-bedrock-agent-runtime\n' +
|
|
93
|
+
' Or pass `client` / `_client`.');
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (!mod.BedrockAgentRuntimeClient) {
|
|
97
|
+
throw new Error('BedrockAgentMemory: `@aws-sdk/client-bedrock-agent-runtime` is installed but ' +
|
|
98
|
+
'`BedrockAgentRuntimeClient` was not found. Update the SDK.');
|
|
99
|
+
}
|
|
100
|
+
const sdk = new mod.BedrockAgentRuntimeClient({ ...(region && { region }) });
|
|
101
|
+
const send = async (Ctor, name, input) => {
|
|
102
|
+
if (!Ctor) {
|
|
103
|
+
throw new Error(`BedrockAgentMemory: \`@aws-sdk/client-bedrock-agent-runtime\` is missing ${name}. Upgrade the SDK.`);
|
|
104
|
+
}
|
|
105
|
+
return sdk.send(new Ctor(input));
|
|
106
|
+
};
|
|
107
|
+
return {
|
|
108
|
+
async getSessionSummaries({ agentId, agentAliasId, memoryId, maxItems, nextToken }) {
|
|
109
|
+
const r = (await send(mod.GetAgentMemoryCommand, 'GetAgentMemoryCommand', {
|
|
110
|
+
agentId,
|
|
111
|
+
agentAliasId,
|
|
112
|
+
memoryType: 'SESSION_SUMMARY',
|
|
113
|
+
memoryId,
|
|
114
|
+
...(maxItems !== undefined && { maxItems }),
|
|
115
|
+
...(nextToken !== undefined && { nextToken }),
|
|
116
|
+
}));
|
|
117
|
+
const summaries = (r?.memoryContents ?? [])
|
|
118
|
+
.map((m) => m.sessionSummary)
|
|
119
|
+
.filter((s) => !!s)
|
|
120
|
+
.map((s) => ({
|
|
121
|
+
sessionId: s.sessionId ?? '',
|
|
122
|
+
summaryText: s.summaryText ?? '',
|
|
123
|
+
...(toIso(s.sessionStartTime) && { sessionStartTime: toIso(s.sessionStartTime) }),
|
|
124
|
+
...(toIso(s.sessionExpiryTime) && { sessionExpiryTime: toIso(s.sessionExpiryTime) }),
|
|
125
|
+
}));
|
|
126
|
+
return r?.nextToken ? { summaries, nextToken: r.nextToken } : { summaries };
|
|
127
|
+
},
|
|
128
|
+
async deleteMemory({ agentId, agentAliasId, memoryId, sessionId }) {
|
|
129
|
+
await send(mod.DeleteAgentMemoryCommand, 'DeleteAgentMemoryCommand', {
|
|
130
|
+
agentId,
|
|
131
|
+
agentAliasId,
|
|
132
|
+
memoryId,
|
|
133
|
+
...(sessionId !== undefined && { sessionId }),
|
|
134
|
+
});
|
|
135
|
+
},
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=bedrockAgentMemory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrockAgentMemory.js","sourceRoot":"","sources":["../../../../src/adapters/memory/bedrockAgentMemory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AA6CvD;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IACZ,MAAM,CAA+B;IACrC,OAAO,CAAS;IAChB,YAAY,CAAS;IACrB,QAAQ,CAAS;IAElC,YAAY,OAAkC;QAC5C,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;QAC/E,CAAC;QACD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;QAC/B,IAAI,CA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AC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC;QAC9E,CAAC;QACD,KAAK,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE;YAC/D,MAAM,IAAI,CAAC,GAAG,CAAC,wBAAwB,EAAE,0BAA0B,EAAE;gBACnE,OAAO;gBACP,YAAY;gBACZ,QAAQ;gBACR,GAAG,CAAC,SAAS,KAAK,SAAS,IAAI,EAAE,SAAS,EAAE,CAAC;aAC9C,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -37,4 +37,7 @@
|
|
|
37
37
|
// `ioredis` or `@aws-sdk/client-bedrock-agent-runtime`.
|
|
38
38
|
export { RedisStore, } from './adapters/memory/redis.js';
|
|
39
39
|
export { AgentCoreStore, } from './adapters/memory/agentcore.js';
|
|
40
|
+
// Read-only reader for the legacy Bedrock Agents auto session-summary memory.
|
|
41
|
+
// NOT a MemoryStore (Bedrock owns the writes) — see the class docstring.
|
|
42
|
+
export { BedrockAgentMemory, } from './adapters/memory/bedrockAgentMemory.js';
|
|
40
43
|
//# sourceMappingURL=memory-providers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,OAAO,EACL,UAAU,GAIX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,GAGf,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,OAAO,EACL,UAAU,GAIX,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,GAGf,MAAM,gCAAgC,CAAC;AAExC,8EAA8E;AAC9E,yEAAyE;AACzE,OAAO,EACL,kBAAkB,GAInB,MAAM,yCAAyC,CAAC"}
|
package/dist/memory-providers.js
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* import { RedisStore, AgentCoreStore } from 'agentfootprint/memory-providers';
|
|
35
35
|
*/
|
|
36
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.AgentCoreStore = exports.RedisStore = void 0;
|
|
37
|
+
exports.BedrockAgentMemory = exports.AgentCoreStore = exports.RedisStore = void 0;
|
|
38
38
|
// Lazy-required peer-dep stores. Both adapters defer their vendor SDK
|
|
39
39
|
// `require()` to constructor time; importing this barrel doesn't load
|
|
40
40
|
// `ioredis` or `@aws-sdk/client-bedrock-agent-runtime`.
|
|
@@ -42,4 +42,8 @@ var redis_js_1 = require("./adapters/memory/redis.js");
|
|
|
42
42
|
Object.defineProperty(exports, "RedisStore", { enumerable: true, get: function () { return redis_js_1.RedisStore; } });
|
|
43
43
|
var agentcore_js_1 = require("./adapters/memory/agentcore.js");
|
|
44
44
|
Object.defineProperty(exports, "AgentCoreStore", { enumerable: true, get: function () { return agentcore_js_1.AgentCoreStore; } });
|
|
45
|
+
// Read-only reader for the legacy Bedrock Agents auto session-summary memory.
|
|
46
|
+
// NOT a MemoryStore (Bedrock owns the writes) — see the class docstring.
|
|
47
|
+
var bedrockAgentMemory_js_1 = require("./adapters/memory/bedrockAgentMemory.js");
|
|
48
|
+
Object.defineProperty(exports, "BedrockAgentMemory", { enumerable: true, get: function () { return bedrockAgentMemory_js_1.BedrockAgentMemory; } });
|
|
45
49
|
//# sourceMappingURL=memory-providers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../src/memory-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,uDAKoC;AAJlC,sGAAA,UAAU,OAAA;AAMZ,+DAIwC;AAHtC,8GAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"memory-providers.js","sourceRoot":"","sources":["../src/memory-providers.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;;;AAEH,sEAAsE;AACtE,sEAAsE;AACtE,wDAAwD;AACxD,uDAKoC;AAJlC,sGAAA,UAAU,OAAA;AAMZ,+DAIwC;AAHtC,8GAAA,cAAc,OAAA;AAKhB,8EAA8E;AAC9E,yEAAyE;AACzE,iFAKiD;AAJ/C,2HAAA,kBAAkB,OAAA"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BedrockAgentMemory — read the **auto-generated session-summary memory** of a
|
|
3
|
+
* (legacy) Amazon **Bedrock Agents** agent (peer-dep `@aws-sdk/client-bedrock-agent-runtime`).
|
|
4
|
+
*
|
|
5
|
+
* import { BedrockAgentMemory } from 'agentfootprint/memory-providers';
|
|
6
|
+
*
|
|
7
|
+
* const mem = new BedrockAgentMemory({ agentId, agentAliasId, region: 'us-west-2' });
|
|
8
|
+
* const summaries = await mem.readSummaries(userMemoryId); // string summaries Bedrock wrote
|
|
9
|
+
*
|
|
10
|
+
* **This is NOT a `MemoryStore`** — and intentionally so. Bedrock Agents *owns the writes*:
|
|
11
|
+
* the agent generates `SESSION_SUMMARY` records itself (`GetAgentMemory` reads them,
|
|
12
|
+
* `DeleteAgentMemory` clears them). There is no "put an arbitrary entry" operation, so wrapping
|
|
13
|
+
* it as a `defineMemory({ store })` would be a "store that can't store." Instead it's a small
|
|
14
|
+
* **reader** you use to *surface* Bedrock's built-in memory — e.g. inject the summaries as a
|
|
15
|
+
* Fact/context block into an agentfootprint agent.
|
|
16
|
+
*
|
|
17
|
+
* For a real read/write agent memory store on AWS, use `AgentCoreStore` (the newer
|
|
18
|
+
* Bedrock **AgentCore** platform) — that's the go-forward path; this targets the prior-gen
|
|
19
|
+
* Bedrock Agents product and exists for teams migrating off it.
|
|
20
|
+
*
|
|
21
|
+
* Role: Outer ring. Lazy-requires the AWS SDK; zero cost when unused.
|
|
22
|
+
*/
|
|
23
|
+
/** One auto-generated session summary from Bedrock Agents memory. */
|
|
24
|
+
export interface BedrockAgentSummary {
|
|
25
|
+
readonly sessionId: string;
|
|
26
|
+
readonly summaryText: string;
|
|
27
|
+
/** ISO timestamps (the SDK returns Date; serialized here for portability). */
|
|
28
|
+
readonly sessionStartTime?: string;
|
|
29
|
+
readonly sessionExpiryTime?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Minimal surface the reader uses; tests inject a mock via `_client`. */
|
|
32
|
+
export interface BedrockAgentMemoryLikeClient {
|
|
33
|
+
getSessionSummaries(input: {
|
|
34
|
+
agentId: string;
|
|
35
|
+
agentAliasId: string;
|
|
36
|
+
memoryId: string;
|
|
37
|
+
maxItems?: number;
|
|
38
|
+
nextToken?: string;
|
|
39
|
+
}): Promise<{
|
|
40
|
+
summaries: readonly BedrockAgentSummary[];
|
|
41
|
+
nextToken?: string;
|
|
42
|
+
}>;
|
|
43
|
+
deleteMemory(input: {
|
|
44
|
+
agentId: string;
|
|
45
|
+
agentAliasId: string;
|
|
46
|
+
memoryId: string;
|
|
47
|
+
sessionId?: string;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
}
|
|
50
|
+
export interface BedrockAgentMemoryOptions {
|
|
51
|
+
/** The Bedrock Agent id whose memory to read. Required. */
|
|
52
|
+
readonly agentId: string;
|
|
53
|
+
/** The Bedrock Agent alias id. Required. */
|
|
54
|
+
readonly agentAliasId: string;
|
|
55
|
+
/** AWS region (when constructing the SDK client internally). */
|
|
56
|
+
readonly region?: string;
|
|
57
|
+
/** Pre-built client (shares one SDK config across the host app). */
|
|
58
|
+
readonly client?: BedrockAgentMemoryLikeClient;
|
|
59
|
+
/** Default page size for `readSummaries`. Default 20. */
|
|
60
|
+
readonly maxItems?: number;
|
|
61
|
+
/** @internal Test injection — skips the SDK require. */
|
|
62
|
+
readonly _client?: BedrockAgentMemoryLikeClient;
|
|
63
|
+
/** @internal Test injection — the AWS SDK module. */
|
|
64
|
+
readonly _sdk?: BedrockAgentRuntimeSdkModule;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Read-only reader for Bedrock Agents' auto session-summary memory.
|
|
68
|
+
*
|
|
69
|
+
* @throws when `@aws-sdk/client-bedrock-agent-runtime` is not installed and no
|
|
70
|
+
* `_client`/`_sdk` is supplied.
|
|
71
|
+
*/
|
|
72
|
+
export declare class BedrockAgentMemory {
|
|
73
|
+
private readonly client;
|
|
74
|
+
private readonly agentId;
|
|
75
|
+
private readonly agentAliasId;
|
|
76
|
+
private readonly maxItems;
|
|
77
|
+
constructor(options: BedrockAgentMemoryOptions);
|
|
78
|
+
/** All session summaries Bedrock generated for `memoryId` (paginated). */
|
|
79
|
+
readSummaries(memoryId: string, opts?: {
|
|
80
|
+
maxItems?: number;
|
|
81
|
+
}): Promise<BedrockAgentSummary[]>;
|
|
82
|
+
/** The concatenated summary text — handy to inject as a single context/Fact block. */
|
|
83
|
+
readText(memoryId: string): Promise<string>;
|
|
84
|
+
/** Clear Bedrock's memory for `memoryId` (optionally a single `sessionId`). */
|
|
85
|
+
forget(memoryId: string, sessionId?: string): Promise<void>;
|
|
86
|
+
}
|
|
87
|
+
export interface BedrockAgentRuntimeSdkModule {
|
|
88
|
+
readonly BedrockAgentRuntimeClient?: new (config: {
|
|
89
|
+
region?: string;
|
|
90
|
+
}) => {
|
|
91
|
+
send(cmd: unknown): Promise<unknown>;
|
|
92
|
+
};
|
|
93
|
+
readonly GetAgentMemoryCommand?: new (input: unknown) => unknown;
|
|
94
|
+
readonly DeleteAgentMemoryCommand?: new (input: unknown) => unknown;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=bedrockAgentMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bedrockAgentMemory.d.ts","sourceRoot":"","sources":["../../../../src/adapters/memory/bedrockAgentMemory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAIH,qEAAqE;AACrE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,0EAA0E;AAC1E,MAAM,WAAW,4BAA4B;IAC3C,mBAAmB,CAAC,KAAK,EAAE;QACzB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC;QAAE,SAAS,EAAE,SAAS,mBAAmB,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/E,YAAY,CAAC,KAAK,EAAE;QAClB,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,QAAQ,CAAC,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AC,EAAE,KAAK,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;CACrE"}
|
|
@@ -34,4 +34,5 @@
|
|
|
34
34
|
*/
|
|
35
35
|
export { RedisStore, type RedisStoreOptions, type RedisLikeClient, type RedisLikePipeline, } from './adapters/memory/redis.js';
|
|
36
36
|
export { AgentCoreStore, type AgentCoreStoreOptions, type AgentCoreLikeClient, } from './adapters/memory/agentcore.js';
|
|
37
|
+
export { BedrockAgentMemory, type BedrockAgentMemoryOptions, type BedrockAgentMemoryLikeClient, type BedrockAgentSummary, } from './adapters/memory/bedrockAgentMemory.js';
|
|
37
38
|
//# sourceMappingURL=memory-providers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-providers.d.ts","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,gCAAgC,CAAC"}
|
|
1
|
+
{"version":3,"file":"memory-providers.d.ts","sourceRoot":"","sources":["../../src/memory-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAKH,OAAO,EACL,UAAU,EACV,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EACL,cAAc,EACd,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,GACzB,MAAM,gCAAgC,CAAC;AAIxC,OAAO,EACL,kBAAkB,EAClB,KAAK,yBAAyB,EAC9B,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,GACzB,MAAM,yCAAyC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfootprint",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.43.0",
|
|
4
4
|
"description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sanjay Krishna Anbalagan",
|