@memberjunction/ai-agents 3.2.0 ā 3.3.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/PayloadFeedbackManager.d.ts +3 -1
- package/dist/PayloadFeedbackManager.d.ts.map +1 -1
- package/dist/PayloadFeedbackManager.js +61 -7
- package/dist/PayloadFeedbackManager.js.map +1 -1
- package/dist/__tests__/agent-memory-features.test.d.ts +71 -0
- package/dist/__tests__/agent-memory-features.test.d.ts.map +1 -0
- package/dist/__tests__/agent-memory-features.test.js +513 -0
- package/dist/__tests__/agent-memory-features.test.js.map +1 -0
- package/dist/agent-context-injector.d.ts +16 -1
- package/dist/agent-context-injector.d.ts.map +1 -1
- package/dist/agent-context-injector.js +162 -11
- package/dist/agent-context-injector.js.map +1 -1
- package/dist/base-agent.d.ts.map +1 -1
- package/dist/base-agent.js +27 -1
- package/dist/base-agent.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/memory-cleanup-agent.d.ts +25 -0
- package/dist/memory-cleanup-agent.d.ts.map +1 -0
- package/dist/memory-cleanup-agent.js +237 -0
- package/dist/memory-cleanup-agent.js.map +1 -0
- package/dist/memory-manager-agent.d.ts +10 -2
- package/dist/memory-manager-agent.d.ts.map +1 -1
- package/dist/memory-manager-agent.js +647 -83
- package/dist/memory-manager-agent.js.map +1 -1
- package/package.json +12 -11
|
@@ -0,0 +1,513 @@
|
|
|
1
|
+
function determineNoteScope(note) {
|
|
2
|
+
if (note.AgentID && note.UserID && note.CompanyID) {
|
|
3
|
+
return 'Agent + User + Company specific';
|
|
4
|
+
}
|
|
5
|
+
if (note.AgentID && note.UserID) {
|
|
6
|
+
return 'Agent + User specific';
|
|
7
|
+
}
|
|
8
|
+
if (note.AgentID && note.CompanyID) {
|
|
9
|
+
return 'Agent + Company specific';
|
|
10
|
+
}
|
|
11
|
+
if (note.UserID && note.CompanyID) {
|
|
12
|
+
return 'User + Company specific';
|
|
13
|
+
}
|
|
14
|
+
if (note.AgentID) {
|
|
15
|
+
return 'Agent-specific';
|
|
16
|
+
}
|
|
17
|
+
if (note.UserID) {
|
|
18
|
+
return 'User-specific';
|
|
19
|
+
}
|
|
20
|
+
if (note.CompanyID) {
|
|
21
|
+
return 'Company-wide';
|
|
22
|
+
}
|
|
23
|
+
return 'Global';
|
|
24
|
+
}
|
|
25
|
+
function determineSaaSScope(note) {
|
|
26
|
+
if (!note.PrimaryScopeRecordID) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const hasSecondary = note.SecondaryScopes && note.SecondaryScopes !== '{}';
|
|
30
|
+
if (hasSecondary) {
|
|
31
|
+
return 'Contact-specific (most specific)';
|
|
32
|
+
}
|
|
33
|
+
return 'Organization-level';
|
|
34
|
+
}
|
|
35
|
+
function formatNotesForInjection(notes, includeMemoryPolicy = true) {
|
|
36
|
+
if (notes.length === 0)
|
|
37
|
+
return '';
|
|
38
|
+
const lines = [];
|
|
39
|
+
if (includeMemoryPolicy) {
|
|
40
|
+
lines.push('<memory_policy>');
|
|
41
|
+
lines.push('Precedence (highest to lowest):');
|
|
42
|
+
lines.push('1) Current user message overrides all stored memory');
|
|
43
|
+
lines.push('2) Contact-specific notes override organization-level');
|
|
44
|
+
lines.push('3) Organization notes override global defaults');
|
|
45
|
+
lines.push('4) When same scope, prefer most recent by date');
|
|
46
|
+
lines.push('');
|
|
47
|
+
lines.push('Conflict resolution:');
|
|
48
|
+
lines.push('- If two notes contradict, prefer the more specific scope');
|
|
49
|
+
lines.push('- Ask clarifying question only if conflict materially affects response');
|
|
50
|
+
lines.push('</memory_policy>');
|
|
51
|
+
lines.push('');
|
|
52
|
+
}
|
|
53
|
+
lines.push(`š AGENT NOTES (${notes.length})`);
|
|
54
|
+
lines.push('');
|
|
55
|
+
for (const note of notes) {
|
|
56
|
+
lines.push(`[${note.Type}] ${note.Note}`);
|
|
57
|
+
const scope = determineNoteScope(note);
|
|
58
|
+
const saasScope = determineSaaSScope(note);
|
|
59
|
+
if (saasScope) {
|
|
60
|
+
lines.push(` Scope: ${saasScope}`);
|
|
61
|
+
}
|
|
62
|
+
else if (scope) {
|
|
63
|
+
lines.push(` Scope: ${scope}`);
|
|
64
|
+
}
|
|
65
|
+
lines.push('');
|
|
66
|
+
}
|
|
67
|
+
lines.push('---');
|
|
68
|
+
return lines.join('\n');
|
|
69
|
+
}
|
|
70
|
+
function generateQuestions(warnings) {
|
|
71
|
+
const questions = [];
|
|
72
|
+
const feedbackWarnings = warnings.filter(w => w.requiresFeedback);
|
|
73
|
+
for (let i = 0; i < feedbackWarnings.length; i++) {
|
|
74
|
+
const warning = feedbackWarnings[i];
|
|
75
|
+
let question = '';
|
|
76
|
+
switch (warning.type) {
|
|
77
|
+
case 'content_truncation':
|
|
78
|
+
const truncDetails = warning.details;
|
|
79
|
+
question = `Did you intend to reduce the content at "${warning.path}" from ${truncDetails.originalLength} to ${truncDetails.newLength} characters (${truncDetails.reductionPercentage.toFixed(1)}% reduction)?`;
|
|
80
|
+
break;
|
|
81
|
+
case 'key_removal':
|
|
82
|
+
const removalDetails = warning.details;
|
|
83
|
+
question = `Did you intend to remove the non-empty key(s) at "${warning.path}": ${removalDetails.removedKeys.join(', ')}?`;
|
|
84
|
+
break;
|
|
85
|
+
case 'type_change':
|
|
86
|
+
const typeDetails = warning.details;
|
|
87
|
+
question = `Did you intend to change the type at "${warning.path}" from ${typeDetails.originalType} to ${typeDetails.newType}?`;
|
|
88
|
+
break;
|
|
89
|
+
case 'pattern_anomaly':
|
|
90
|
+
question = `Did you intend the following change at "${warning.path}": ${warning.message}?`;
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
question = `Did you intend the change at "${warning.path}": ${warning.message}?`;
|
|
94
|
+
}
|
|
95
|
+
questions.push({
|
|
96
|
+
id: `feedback_${i}_${Date.now()}`,
|
|
97
|
+
question,
|
|
98
|
+
warning,
|
|
99
|
+
context: {
|
|
100
|
+
path: warning.path,
|
|
101
|
+
changeType: warning.type,
|
|
102
|
+
details: warning.details
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return questions;
|
|
107
|
+
}
|
|
108
|
+
function mapLLMResponsesToFeedback(questions, llmResponses) {
|
|
109
|
+
return questions.map((q, index) => {
|
|
110
|
+
const questionNumber = index + 1;
|
|
111
|
+
const llmResponse = llmResponses.find(r => r.questionNumber === questionNumber);
|
|
112
|
+
if (llmResponse) {
|
|
113
|
+
return {
|
|
114
|
+
questionId: q.id,
|
|
115
|
+
intended: llmResponse.intended,
|
|
116
|
+
explanation: llmResponse.explanation
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
questionId: q.id,
|
|
121
|
+
intended: true,
|
|
122
|
+
explanation: 'No explicit response from LLM - assuming intended'
|
|
123
|
+
};
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const mockNotes = [
|
|
127
|
+
{
|
|
128
|
+
ID: 'note-1',
|
|
129
|
+
Type: 'Preference',
|
|
130
|
+
Note: 'User prefers bullet points',
|
|
131
|
+
AgentID: 'agent-1',
|
|
132
|
+
UserID: 'user-1',
|
|
133
|
+
CompanyID: null,
|
|
134
|
+
PrimaryScopeRecordID: null,
|
|
135
|
+
SecondaryScopes: null
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
ID: 'note-2',
|
|
139
|
+
Type: 'Context',
|
|
140
|
+
Note: 'Company uses metric units',
|
|
141
|
+
AgentID: null,
|
|
142
|
+
UserID: null,
|
|
143
|
+
CompanyID: 'company-1',
|
|
144
|
+
PrimaryScopeRecordID: 'org-123',
|
|
145
|
+
SecondaryScopes: null
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
ID: 'note-3',
|
|
149
|
+
Type: 'Constraint',
|
|
150
|
+
Note: 'Never share PII',
|
|
151
|
+
AgentID: null,
|
|
152
|
+
UserID: null,
|
|
153
|
+
CompanyID: null,
|
|
154
|
+
PrimaryScopeRecordID: null,
|
|
155
|
+
SecondaryScopes: null
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
ID: 'note-4',
|
|
159
|
+
Type: 'Preference',
|
|
160
|
+
Note: 'John prefers formal tone',
|
|
161
|
+
AgentID: 'agent-1',
|
|
162
|
+
UserID: null,
|
|
163
|
+
CompanyID: null,
|
|
164
|
+
PrimaryScopeRecordID: 'org-123',
|
|
165
|
+
SecondaryScopes: '{"ContactID": "contact-456"}'
|
|
166
|
+
}
|
|
167
|
+
];
|
|
168
|
+
const mockWarnings = [
|
|
169
|
+
{
|
|
170
|
+
type: 'content_truncation',
|
|
171
|
+
path: 'response.body',
|
|
172
|
+
message: 'Content was significantly reduced',
|
|
173
|
+
severity: 'high',
|
|
174
|
+
details: { originalLength: 1000, newLength: 100, reductionPercentage: 90 },
|
|
175
|
+
requiresFeedback: true
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
type: 'key_removal',
|
|
179
|
+
path: 'data.metadata',
|
|
180
|
+
message: 'Keys were removed',
|
|
181
|
+
severity: 'medium',
|
|
182
|
+
details: { removedKeys: ['timestamp', 'version'] },
|
|
183
|
+
requiresFeedback: true
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: 'type_change',
|
|
187
|
+
path: 'config.enabled',
|
|
188
|
+
message: 'Type changed',
|
|
189
|
+
severity: 'low',
|
|
190
|
+
details: { originalType: 'boolean', newType: 'string' },
|
|
191
|
+
requiresFeedback: false
|
|
192
|
+
}
|
|
193
|
+
];
|
|
194
|
+
let testsPassed = 0;
|
|
195
|
+
let testsFailed = 0;
|
|
196
|
+
function runTest(name, fn) {
|
|
197
|
+
try {
|
|
198
|
+
fn();
|
|
199
|
+
console.log(`ā
${name}`);
|
|
200
|
+
testsPassed++;
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
console.error(`ā ${name}`);
|
|
204
|
+
console.error(` Error: ${error instanceof Error ? error.message : error}`);
|
|
205
|
+
testsFailed++;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function assertEqual(actual, expected, message) {
|
|
209
|
+
if (actual !== expected) {
|
|
210
|
+
throw new Error(`${message || 'Assertion failed'}: expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
function assertTrue(condition, message) {
|
|
214
|
+
if (!condition) {
|
|
215
|
+
throw new Error(message || 'Expected condition to be true');
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
function assertContains(str, substring, message) {
|
|
219
|
+
if (!str.includes(substring)) {
|
|
220
|
+
throw new Error(`${message || 'String does not contain expected substring'}: "${substring}"`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
console.log('\n=== Agent Memory Features Tests ===\n');
|
|
224
|
+
console.log('--- Scope Determination Tests ---\n');
|
|
225
|
+
runTest('determineNoteScope: Agent + User specific', () => {
|
|
226
|
+
const note = mockNotes[0];
|
|
227
|
+
const scope = determineNoteScope(note);
|
|
228
|
+
assertEqual(scope, 'Agent + User specific');
|
|
229
|
+
});
|
|
230
|
+
runTest('determineNoteScope: Company-wide', () => {
|
|
231
|
+
const note = mockNotes[1];
|
|
232
|
+
const scope = determineNoteScope(note);
|
|
233
|
+
assertEqual(scope, 'Company-wide');
|
|
234
|
+
});
|
|
235
|
+
runTest('determineNoteScope: Global (all null)', () => {
|
|
236
|
+
const note = mockNotes[2];
|
|
237
|
+
const scope = determineNoteScope(note);
|
|
238
|
+
assertEqual(scope, 'Global');
|
|
239
|
+
});
|
|
240
|
+
runTest('determineSaaSScope: Organization-level (primary scope only)', () => {
|
|
241
|
+
const note = mockNotes[1];
|
|
242
|
+
const scope = determineSaaSScope(note);
|
|
243
|
+
assertEqual(scope, 'Organization-level');
|
|
244
|
+
});
|
|
245
|
+
runTest('determineSaaSScope: Contact-specific (has secondary scopes)', () => {
|
|
246
|
+
const note = mockNotes[3];
|
|
247
|
+
const scope = determineSaaSScope(note);
|
|
248
|
+
assertEqual(scope, 'Contact-specific (most specific)');
|
|
249
|
+
});
|
|
250
|
+
runTest('determineSaaSScope: null when no SaaS scope', () => {
|
|
251
|
+
const note = mockNotes[0];
|
|
252
|
+
const scope = determineSaaSScope(note);
|
|
253
|
+
assertEqual(scope, null);
|
|
254
|
+
});
|
|
255
|
+
console.log('\n--- Format Notes Tests ---\n');
|
|
256
|
+
runTest('formatNotesForInjection: includes memory policy by default', () => {
|
|
257
|
+
const result = formatNotesForInjection(mockNotes);
|
|
258
|
+
assertContains(result, '<memory_policy>');
|
|
259
|
+
assertContains(result, 'Precedence (highest to lowest)');
|
|
260
|
+
assertContains(result, 'Contact-specific notes override organization-level');
|
|
261
|
+
assertContains(result, '</memory_policy>');
|
|
262
|
+
});
|
|
263
|
+
runTest('formatNotesForInjection: excludes memory policy when disabled', () => {
|
|
264
|
+
const result = formatNotesForInjection(mockNotes, false);
|
|
265
|
+
assertTrue(!result.includes('<memory_policy>'), 'Should not contain memory_policy');
|
|
266
|
+
});
|
|
267
|
+
runTest('formatNotesForInjection: includes note count', () => {
|
|
268
|
+
const result = formatNotesForInjection(mockNotes);
|
|
269
|
+
assertContains(result, `š AGENT NOTES (${mockNotes.length})`);
|
|
270
|
+
});
|
|
271
|
+
runTest('formatNotesForInjection: includes note types and content', () => {
|
|
272
|
+
const result = formatNotesForInjection(mockNotes);
|
|
273
|
+
assertContains(result, '[Preference] User prefers bullet points');
|
|
274
|
+
assertContains(result, '[Context] Company uses metric units');
|
|
275
|
+
assertContains(result, '[Constraint] Never share PII');
|
|
276
|
+
});
|
|
277
|
+
runTest('formatNotesForInjection: shows SaaS scope when available', () => {
|
|
278
|
+
const result = formatNotesForInjection(mockNotes);
|
|
279
|
+
assertContains(result, 'Organization-level');
|
|
280
|
+
assertContains(result, 'Contact-specific (most specific)');
|
|
281
|
+
});
|
|
282
|
+
runTest('formatNotesForInjection: returns empty string for empty notes', () => {
|
|
283
|
+
const result = formatNotesForInjection([]);
|
|
284
|
+
assertEqual(result, '');
|
|
285
|
+
});
|
|
286
|
+
console.log('\n--- Feedback Question Tests ---\n');
|
|
287
|
+
runTest('generateQuestions: filters out non-feedback warnings', () => {
|
|
288
|
+
const questions = generateQuestions(mockWarnings);
|
|
289
|
+
assertEqual(questions.length, 2, 'Should only include warnings with requiresFeedback=true');
|
|
290
|
+
});
|
|
291
|
+
runTest('generateQuestions: formats content_truncation correctly', () => {
|
|
292
|
+
const questions = generateQuestions(mockWarnings);
|
|
293
|
+
const truncQuestion = questions[0];
|
|
294
|
+
assertContains(truncQuestion.question, 'reduce the content');
|
|
295
|
+
assertContains(truncQuestion.question, '1000 to 100');
|
|
296
|
+
assertContains(truncQuestion.question, '90.0%');
|
|
297
|
+
});
|
|
298
|
+
runTest('generateQuestions: formats key_removal correctly', () => {
|
|
299
|
+
const questions = generateQuestions(mockWarnings);
|
|
300
|
+
const removalQuestion = questions[1];
|
|
301
|
+
assertContains(removalQuestion.question, 'remove the non-empty key(s)');
|
|
302
|
+
assertContains(removalQuestion.question, 'timestamp');
|
|
303
|
+
assertContains(removalQuestion.question, 'version');
|
|
304
|
+
});
|
|
305
|
+
runTest('generateQuestions: includes context with path and type', () => {
|
|
306
|
+
const questions = generateQuestions(mockWarnings);
|
|
307
|
+
const question = questions[0];
|
|
308
|
+
assertTrue(question.context !== undefined, 'Should have context');
|
|
309
|
+
assertEqual(question.context?.path, 'response.body');
|
|
310
|
+
assertEqual(question.context?.changeType, 'content_truncation');
|
|
311
|
+
});
|
|
312
|
+
console.log('\n--- LLM Response Mapping Tests ---\n');
|
|
313
|
+
runTest('mapLLMResponsesToFeedback: maps responses correctly', () => {
|
|
314
|
+
const questions = generateQuestions(mockWarnings);
|
|
315
|
+
const llmResponses = [
|
|
316
|
+
{ questionNumber: 1, intended: false, explanation: 'This was a mistake' },
|
|
317
|
+
{ questionNumber: 2, intended: true, explanation: 'Intended cleanup' }
|
|
318
|
+
];
|
|
319
|
+
const result = mapLLMResponsesToFeedback(questions, llmResponses);
|
|
320
|
+
assertEqual(result.length, 2);
|
|
321
|
+
assertEqual(result[0].intended, false);
|
|
322
|
+
assertEqual(result[0].explanation, 'This was a mistake');
|
|
323
|
+
assertEqual(result[1].intended, true);
|
|
324
|
+
});
|
|
325
|
+
runTest('mapLLMResponsesToFeedback: defaults to intended when no response', () => {
|
|
326
|
+
const questions = generateQuestions(mockWarnings);
|
|
327
|
+
const llmResponses = [];
|
|
328
|
+
const result = mapLLMResponsesToFeedback(questions, llmResponses);
|
|
329
|
+
assertTrue(result.every(r => r.intended === true), 'All should default to intended');
|
|
330
|
+
assertContains(result[0].explanation || '', 'No explicit response');
|
|
331
|
+
});
|
|
332
|
+
console.log('\n--- Memory Cleanup Agent Tests ---\n');
|
|
333
|
+
function getCutoffDate(retentionDays) {
|
|
334
|
+
const cutoff = new Date();
|
|
335
|
+
cutoff.setDate(cutoff.getDate() - retentionDays);
|
|
336
|
+
return cutoff.toISOString();
|
|
337
|
+
}
|
|
338
|
+
function getNoteRetentionDays(agent) {
|
|
339
|
+
const DEFAULT_NOTE_RETENTION_DAYS = 90;
|
|
340
|
+
if (typeof agent.NoteRetentionDays === 'number' && agent.NoteRetentionDays > 0) {
|
|
341
|
+
return agent.NoteRetentionDays;
|
|
342
|
+
}
|
|
343
|
+
return DEFAULT_NOTE_RETENTION_DAYS;
|
|
344
|
+
}
|
|
345
|
+
function getExampleRetentionDays(agent) {
|
|
346
|
+
const DEFAULT_EXAMPLE_RETENTION_DAYS = 180;
|
|
347
|
+
if (typeof agent.ExampleRetentionDays === 'number' && agent.ExampleRetentionDays > 0) {
|
|
348
|
+
return agent.ExampleRetentionDays;
|
|
349
|
+
}
|
|
350
|
+
return DEFAULT_EXAMPLE_RETENTION_DAYS;
|
|
351
|
+
}
|
|
352
|
+
function getAutoArchiveEnabled(agent) {
|
|
353
|
+
return agent.AutoArchiveEnabled !== false;
|
|
354
|
+
}
|
|
355
|
+
function buildCleanupSummary(result) {
|
|
356
|
+
const parts = [];
|
|
357
|
+
if (result.notesArchived > 0) {
|
|
358
|
+
parts.push(`${result.notesArchived} stale notes archived`);
|
|
359
|
+
}
|
|
360
|
+
if (result.examplesArchived > 0) {
|
|
361
|
+
parts.push(`${result.examplesArchived} stale examples archived`);
|
|
362
|
+
}
|
|
363
|
+
if (result.notesExpired > 0) {
|
|
364
|
+
parts.push(`${result.notesExpired} expired notes archived`);
|
|
365
|
+
}
|
|
366
|
+
if (result.examplesExpired > 0) {
|
|
367
|
+
parts.push(`${result.examplesExpired} expired examples archived`);
|
|
368
|
+
}
|
|
369
|
+
if (parts.length === 0) {
|
|
370
|
+
parts.push('No items needed archiving');
|
|
371
|
+
}
|
|
372
|
+
if (result.errors.length > 0) {
|
|
373
|
+
parts.push(`${result.errors.length} errors encountered`);
|
|
374
|
+
}
|
|
375
|
+
return parts.join(', ');
|
|
376
|
+
}
|
|
377
|
+
runTest('getCutoffDate: calculates correct date for 90 days', () => {
|
|
378
|
+
const now = new Date();
|
|
379
|
+
const cutoffStr = getCutoffDate(90);
|
|
380
|
+
const cutoffDate = new Date(cutoffStr);
|
|
381
|
+
const expectedDate = new Date(now);
|
|
382
|
+
expectedDate.setDate(expectedDate.getDate() - 90);
|
|
383
|
+
const diff = Math.abs(cutoffDate.getTime() - expectedDate.getTime());
|
|
384
|
+
assertTrue(diff < 1000, 'Cutoff date should be approximately 90 days ago');
|
|
385
|
+
});
|
|
386
|
+
runTest('getNoteRetentionDays: returns agent value when set', () => {
|
|
387
|
+
const agent = { NoteRetentionDays: 60 };
|
|
388
|
+
assertEqual(getNoteRetentionDays(agent), 60);
|
|
389
|
+
});
|
|
390
|
+
runTest('getNoteRetentionDays: returns default when null', () => {
|
|
391
|
+
const agent = { NoteRetentionDays: null };
|
|
392
|
+
assertEqual(getNoteRetentionDays(agent), 90);
|
|
393
|
+
});
|
|
394
|
+
runTest('getNoteRetentionDays: returns default when not set', () => {
|
|
395
|
+
const agent = {};
|
|
396
|
+
assertEqual(getNoteRetentionDays(agent), 90);
|
|
397
|
+
});
|
|
398
|
+
runTest('getExampleRetentionDays: returns agent value when set', () => {
|
|
399
|
+
const agent = { ExampleRetentionDays: 120 };
|
|
400
|
+
assertEqual(getExampleRetentionDays(agent), 120);
|
|
401
|
+
});
|
|
402
|
+
runTest('getExampleRetentionDays: returns default when not set', () => {
|
|
403
|
+
const agent = {};
|
|
404
|
+
assertEqual(getExampleRetentionDays(agent), 180);
|
|
405
|
+
});
|
|
406
|
+
runTest('getAutoArchiveEnabled: returns true by default', () => {
|
|
407
|
+
const agent = {};
|
|
408
|
+
assertEqual(getAutoArchiveEnabled(agent), true);
|
|
409
|
+
});
|
|
410
|
+
runTest('getAutoArchiveEnabled: returns false when explicitly disabled', () => {
|
|
411
|
+
const agent = { AutoArchiveEnabled: false };
|
|
412
|
+
assertEqual(getAutoArchiveEnabled(agent), false);
|
|
413
|
+
});
|
|
414
|
+
runTest('getAutoArchiveEnabled: returns true when explicitly enabled', () => {
|
|
415
|
+
const agent = { AutoArchiveEnabled: true };
|
|
416
|
+
assertEqual(getAutoArchiveEnabled(agent), true);
|
|
417
|
+
});
|
|
418
|
+
runTest('buildCleanupSummary: reports stale notes', () => {
|
|
419
|
+
const result = { notesArchived: 5, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: [] };
|
|
420
|
+
const summary = buildCleanupSummary(result);
|
|
421
|
+
assertContains(summary, '5 stale notes archived');
|
|
422
|
+
});
|
|
423
|
+
runTest('buildCleanupSummary: reports expired items', () => {
|
|
424
|
+
const result = { notesArchived: 0, examplesArchived: 0, notesExpired: 2, examplesExpired: 3, errors: [] };
|
|
425
|
+
const summary = buildCleanupSummary(result);
|
|
426
|
+
assertContains(summary, '2 expired notes archived');
|
|
427
|
+
assertContains(summary, '3 expired examples archived');
|
|
428
|
+
});
|
|
429
|
+
runTest('buildCleanupSummary: reports errors', () => {
|
|
430
|
+
const result = { notesArchived: 1, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: ['error1', 'error2'] };
|
|
431
|
+
const summary = buildCleanupSummary(result);
|
|
432
|
+
assertContains(summary, '2 errors encountered');
|
|
433
|
+
});
|
|
434
|
+
runTest('buildCleanupSummary: reports nothing needed when all zero', () => {
|
|
435
|
+
const result = { notesArchived: 0, examplesArchived: 0, notesExpired: 0, examplesExpired: 0, errors: [] };
|
|
436
|
+
const summary = buildCleanupSummary(result);
|
|
437
|
+
assertEqual(summary, 'No items needed archiving');
|
|
438
|
+
});
|
|
439
|
+
console.log('\n--- Extraction Guardrails Tests ---\n');
|
|
440
|
+
function containsEphemeralPhrase(content) {
|
|
441
|
+
const ephemeralPatterns = [
|
|
442
|
+
/this time/i,
|
|
443
|
+
/just for now/i,
|
|
444
|
+
/today only/i,
|
|
445
|
+
/for this call/i,
|
|
446
|
+
/temporarily/i,
|
|
447
|
+
/one-time/i,
|
|
448
|
+
/exception/i,
|
|
449
|
+
/just once/i
|
|
450
|
+
];
|
|
451
|
+
return ephemeralPatterns.some(pattern => pattern.test(content));
|
|
452
|
+
}
|
|
453
|
+
function containsDurablePhrase(content) {
|
|
454
|
+
const durablePatterns = [
|
|
455
|
+
/always/i,
|
|
456
|
+
/never/i,
|
|
457
|
+
/company policy/i,
|
|
458
|
+
/all customers/i,
|
|
459
|
+
/standard practice/i,
|
|
460
|
+
/we typically/i,
|
|
461
|
+
/our preference/i,
|
|
462
|
+
/every time/i,
|
|
463
|
+
/by default/i,
|
|
464
|
+
/as a rule/i
|
|
465
|
+
];
|
|
466
|
+
return durablePatterns.some(pattern => pattern.test(content));
|
|
467
|
+
}
|
|
468
|
+
function containsPII(content) {
|
|
469
|
+
const piiPatterns = [
|
|
470
|
+
/\b\d{3}-\d{2}-\d{4}\b/,
|
|
471
|
+
/\b\d{16}\b/,
|
|
472
|
+
/password[:\s]+\S+/i,
|
|
473
|
+
/\bssn\b/i,
|
|
474
|
+
/passport\s*#?\s*\d+/i
|
|
475
|
+
];
|
|
476
|
+
return piiPatterns.some(pattern => pattern.test(content));
|
|
477
|
+
}
|
|
478
|
+
runTest('containsEphemeralPhrase: detects "just for now"', () => {
|
|
479
|
+
assertTrue(containsEphemeralPhrase('Just for now, use bullet points'));
|
|
480
|
+
});
|
|
481
|
+
runTest('containsEphemeralPhrase: detects "this time"', () => {
|
|
482
|
+
assertTrue(containsEphemeralPhrase('This time I want a shorter response'));
|
|
483
|
+
});
|
|
484
|
+
runTest('containsEphemeralPhrase: returns false for durable content', () => {
|
|
485
|
+
assertTrue(!containsEphemeralPhrase('We always use metric units'));
|
|
486
|
+
});
|
|
487
|
+
runTest('containsDurablePhrase: detects "always"', () => {
|
|
488
|
+
assertTrue(containsDurablePhrase('We always use formal tone'));
|
|
489
|
+
});
|
|
490
|
+
runTest('containsDurablePhrase: detects "company policy"', () => {
|
|
491
|
+
assertTrue(containsDurablePhrase('Company policy requires approval'));
|
|
492
|
+
});
|
|
493
|
+
runTest('containsDurablePhrase: returns false for ephemeral content', () => {
|
|
494
|
+
assertTrue(!containsDurablePhrase('Just this once, skip the greeting'));
|
|
495
|
+
});
|
|
496
|
+
runTest('containsPII: detects SSN pattern', () => {
|
|
497
|
+
assertTrue(containsPII('My SSN is 123-45-6789'));
|
|
498
|
+
});
|
|
499
|
+
runTest('containsPII: detects password mention', () => {
|
|
500
|
+
assertTrue(containsPII('The password is: secret123'));
|
|
501
|
+
});
|
|
502
|
+
runTest('containsPII: returns false for safe content', () => {
|
|
503
|
+
assertTrue(!containsPII('User prefers bullet points'));
|
|
504
|
+
});
|
|
505
|
+
console.log('\n=== Test Summary ===\n');
|
|
506
|
+
console.log(`Total: ${testsPassed + testsFailed}`);
|
|
507
|
+
console.log(`Passed: ${testsPassed}`);
|
|
508
|
+
console.log(`Failed: ${testsFailed}`);
|
|
509
|
+
if (testsFailed > 0) {
|
|
510
|
+
process.exit(1);
|
|
511
|
+
}
|
|
512
|
+
console.log('\nā
All tests passed!\n');
|
|
513
|
+
//# sourceMappingURL=agent-memory-features.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-memory-features.test.js","sourceRoot":"","sources":["../../src/__tests__/agent-memory-features.test.ts"],"names":[],"mappings":"AAyDA,SAAS,kBAAkB,CAAC,IAAc;IACtC,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChD,OAAO,iCAAiC,CAAC;IAC7C,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAC9B,OAAO,uBAAuB,CAAC;IACnC,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACjC,OAAO,0BAA0B,CAAC;IACtC,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,yBAAyB,CAAC;IACrC,CAAC;IACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACd,OAAO,eAAe,CAAC;IAC3B,CAAC;IACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACjB,OAAO,cAAc,CAAC;IAC1B,CAAC;IACD,OAAO,QAAQ,CAAC;AACpB,CAAC;AAKD,SAAS,kBAAkB,CAAC,IAAc;IACtC,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,CAAC;IAE3E,IAAI,YAAY,EAAE,CAAC;QACf,OAAO,kCAAkC,CAAC;IAC9C,CAAC;IAED,OAAO,oBAAoB,CAAC;AAChC,CAAC;AAKD,SAAS,uBAAuB,CAAC,KAAiB,EAAE,sBAA+B,IAAI;IACnF,IAAI,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AAC,GAAG,CAAC,WAAW,WAAW,EAAE,CAAC,CAAC;AAEtC,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC"}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { UserInfo } from "@memberjunction/core";
|
|
2
2
|
import { AIAgentNoteEntity, AIAgentExampleEntity } from "@memberjunction/core-entities";
|
|
3
|
+
import { UserScope } from "@memberjunction/ai-core-plus";
|
|
4
|
+
import { RerankerConfiguration } from "@memberjunction/ai-reranker";
|
|
5
|
+
export interface NotesObservabilityOptions {
|
|
6
|
+
agentRunID: string;
|
|
7
|
+
parentStepID?: string;
|
|
8
|
+
stepNumber?: number;
|
|
9
|
+
}
|
|
3
10
|
export interface GetNotesParams {
|
|
4
11
|
agentId: string;
|
|
5
12
|
userId?: string;
|
|
@@ -8,6 +15,9 @@ export interface GetNotesParams {
|
|
|
8
15
|
strategy: 'Relevant' | 'Recent' | 'All';
|
|
9
16
|
maxNotes: number;
|
|
10
17
|
contextUser: UserInfo;
|
|
18
|
+
userScope?: UserScope;
|
|
19
|
+
rerankerConfig?: RerankerConfiguration | null;
|
|
20
|
+
observability?: NotesObservabilityOptions;
|
|
11
21
|
}
|
|
12
22
|
export interface GetExamplesParams {
|
|
13
23
|
agentId: string;
|
|
@@ -17,6 +27,7 @@ export interface GetExamplesParams {
|
|
|
17
27
|
strategy: 'Semantic' | 'Recent' | 'Rated';
|
|
18
28
|
maxExamples: number;
|
|
19
29
|
contextUser: UserInfo;
|
|
30
|
+
userScope?: UserScope;
|
|
20
31
|
}
|
|
21
32
|
export declare class AgentContextInjector {
|
|
22
33
|
GetNotesForContext(params: GetNotesParams): Promise<AIAgentNoteEntity[]>;
|
|
@@ -26,9 +37,13 @@ export declare class AgentContextInjector {
|
|
|
26
37
|
private queryNotesWithScoping;
|
|
27
38
|
private queryExamplesWithScoping;
|
|
28
39
|
private buildNotesScopingFilter;
|
|
40
|
+
private buildSaasScopeFilter;
|
|
29
41
|
private filterExamplesByScoping;
|
|
42
|
+
private matchesSaasScope;
|
|
30
43
|
private sortExamples;
|
|
31
|
-
|
|
44
|
+
private sortNotes;
|
|
45
|
+
FormatNotesForInjection(notes: AIAgentNoteEntity[], includeMemoryPolicy?: boolean): string;
|
|
46
|
+
private determineSaaSScope;
|
|
32
47
|
FormatExamplesForInjection(examples: AIAgentExampleEntity[]): string;
|
|
33
48
|
private determineNoteScope;
|
|
34
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-context-injector.d.ts","sourceRoot":"","sources":["../src/agent-context-injector.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"agent-context-injector.d.ts","sourceRoot":"","sources":["../src/agent-context-injector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAyB,MAAM,+BAA+B,CAAC;AAE/G,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAmB,MAAM,6BAA6B,CAAC;AAKrF,MAAM,WAAW,yBAAyB;IAItC,UAAU,EAAE,MAAM,CAAC;IAInB,YAAY,CAAC,EAAE,MAAM,CAAC;IAItB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAKD,MAAM,WAAW,cAAc;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,UAAU,GAAG,QAAQ,GAAG,KAAK,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,QAAQ,CAAC;IAQtB,SA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