@mastra/longmemeval 0.0.0-error-handler-fix-20251020202607 → 0.0.0-execa-dynamic-import-20260304221256

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +847 -6
  2. package/LICENSE.md +15 -0
  3. package/docs/INVESTIGATION_WORKFLOW.md +314 -0
  4. package/package.json +34 -26
  5. package/scripts/download.ts +22 -1
  6. package/scripts/generate-wm-templates.ts +2 -1
  7. package/src/cli.ts +967 -155
  8. package/src/commands/__tests__/prepare.test.ts +11 -6
  9. package/src/commands/__tests__/run.test.ts +10 -8
  10. package/src/commands/clean.ts +147 -0
  11. package/src/commands/deterministic-ids.ts +126 -0
  12. package/src/commands/find-prohibited.ts +299 -0
  13. package/src/commands/investigate.ts +2437 -0
  14. package/src/commands/list-partial.ts +137 -0
  15. package/src/commands/obscure-thread-ids.ts +237 -0
  16. package/src/commands/partial-results.ts +198 -0
  17. package/src/commands/precompute-embeddings.ts +302 -0
  18. package/src/commands/prepare.ts +732 -105
  19. package/src/commands/reconcile.ts +383 -0
  20. package/src/commands/run.ts +1240 -121
  21. package/src/commands/sessions.ts +126 -0
  22. package/src/commands/sync.ts +152 -0
  23. package/src/commands/test-cleaned.ts +53 -0
  24. package/src/commands/test-incremental.ts +120 -0
  25. package/src/commands/test-messages.ts +95 -0
  26. package/src/commands/test-prohibited.ts +244 -0
  27. package/src/commands/test-thread.ts +136 -0
  28. package/src/commands/tokens.ts +625 -0
  29. package/src/config.ts +1253 -72
  30. package/src/data/types.ts +48 -6
  31. package/src/embeddings/cached-openai-embedding-model.ts +0 -1
  32. package/src/evaluation/longmemeval-metric.ts +186 -103
  33. package/src/processors/content-sanitizer.ts +153 -0
  34. package/src/processors/date-injector.ts +111 -0
  35. package/src/processors/index.ts +3 -0
  36. package/src/processors/observation-semantic-filter.ts +1142 -0
  37. package/src/retry-model.ts +5 -3
  38. package/src/storage/__tests__/benchmark-store.test.ts +18 -35
  39. package/src/storage/benchmark-store.ts +140 -153
  40. package/src/storage/benchmark-vector.ts +1 -1
  41. package/src/storage/index.ts +1 -0
  42. package/src/storage/persistable-inmemory.ts +133 -0
  43. package/src/test-utils/mock-model.ts +35 -0
package/src/config.ts CHANGED
@@ -1,4 +1,282 @@
1
- import { MemoryConfigOptions } from './data/types';
1
+ import { MemoryConfig } from '@mastra/core/memory';
2
+ import { DatasetType, MemoryConfigOptions } from './data/types';
3
+
4
+ // ============================================================================
5
+ // Run Variants - Define operational parameters
6
+ // ============================================================================
7
+
8
+ /**
9
+ * A run variant defines operational parameters like concurrency and subset size.
10
+ * These are separate from memory configs to allow mixing and matching.
11
+ */
12
+ export interface RunVariant {
13
+ /** Variant name */
14
+ name: string;
15
+ /** Description for help text */
16
+ description: string;
17
+ /** Dataset to use */
18
+ dataset: DatasetType;
19
+ /** Number of questions to process (undefined = all) */
20
+ subset?: number;
21
+ /** Number of questions per type for stratified sampling (overrides subset) */
22
+ perTypeCount?: number;
23
+ /** Comb sampling: number of questions to select per type */
24
+ combSampleSize?: number;
25
+ /** Comb sampling: stride between selected questions */
26
+ combOffset?: number;
27
+ /** Comb sampling: starting index (default 0) */
28
+ combStartOffset?: number;
29
+ /** Concurrency for prepare command */
30
+ prepareConcurrency: number;
31
+ /** Concurrency for bench command */
32
+ benchConcurrency: number;
33
+ }
34
+
35
+ /**
36
+ * All available run variants.
37
+ */
38
+ export const RUN_VARIANTS: Record<string, RunVariant> = {
39
+ quick: {
40
+ name: 'quick',
41
+ description: 'Quick test run with 10 questions',
42
+ dataset: 'longmemeval_s',
43
+ subset: 10,
44
+ prepareConcurrency: 1,
45
+ benchConcurrency: 5,
46
+ },
47
+ full: {
48
+ name: 'full',
49
+ description: 'Full benchmark run with all questions',
50
+ dataset: 'longmemeval_s',
51
+ subset: undefined,
52
+ prepareConcurrency: 5,
53
+ benchConcurrency: 10,
54
+ },
55
+ 'full-fast': {
56
+ name: 'full-fast',
57
+ description: 'Full benchmark run with all questions',
58
+ dataset: 'longmemeval_s',
59
+ subset: undefined,
60
+ prepareConcurrency: 10,
61
+ benchConcurrency: 15,
62
+ },
63
+ 'full-slow': {
64
+ name: 'full',
65
+ description: 'Full benchmark run with all questions but with low concurrency',
66
+ dataset: 'longmemeval_s',
67
+ subset: undefined,
68
+ prepareConcurrency: 2,
69
+ benchConcurrency: 4,
70
+ },
71
+ rip: {
72
+ name: 'rip',
73
+ description: 'Full benchmark run with all questions, high concurrency',
74
+ dataset: 'longmemeval_s',
75
+ subset: undefined,
76
+ prepareConcurrency: 20,
77
+ benchConcurrency: 20,
78
+ },
79
+ sample: {
80
+ name: 'sample',
81
+ description: 'Stratified sample: 10 questions per type (60 total)',
82
+ dataset: 'longmemeval_s',
83
+ perTypeCount: 10,
84
+ prepareConcurrency: 20,
85
+ benchConcurrency: 10,
86
+ },
87
+ 'sample-comb': {
88
+ name: 'sample-comb',
89
+ description: 'Comb sample: 10 questions per type, spaced throughout (use --comb-offset, --start-offset)',
90
+ dataset: 'longmemeval_s',
91
+ combSampleSize: 10,
92
+ combOffset: 10,
93
+ combStartOffset: 0,
94
+ prepareConcurrency: 2,
95
+ benchConcurrency: 10,
96
+ },
97
+ };
98
+
99
+ /**
100
+ * Get a run variant by name.
101
+ */
102
+ export function getRunVariant(name: string): RunVariant {
103
+ const variant = RUN_VARIANTS[name];
104
+ if (!variant) {
105
+ throw new Error(`Unknown run variant: ${name}. Available: ${Object.keys(RUN_VARIANTS).join(', ')}`);
106
+ }
107
+ return variant;
108
+ }
109
+
110
+ /**
111
+ * Get all available run variant names.
112
+ */
113
+ export function getAvailableVariants(): string[] {
114
+ return Object.keys(RUN_VARIANTS);
115
+ }
116
+
117
+ /**
118
+ * Apply stratified sampling to a list of questions.
119
+ * Sorts questions by ID (deterministic) and takes the first N of each type.
120
+ */
121
+ export function applyStratifiedSampling<T extends { question_id: string; question_type: string }>(
122
+ questions: T[],
123
+ perTypeCount: number,
124
+ ): T[] {
125
+ // Sort by question_id for deterministic ordering
126
+ const sorted = [...questions].sort((a, b) => a.question_id.localeCompare(b.question_id));
127
+
128
+ // Group by question type
129
+ const byType = new Map<string, T[]>();
130
+ for (const q of sorted) {
131
+ const existing = byType.get(q.question_type) || [];
132
+ existing.push(q);
133
+ byType.set(q.question_type, existing);
134
+ }
135
+
136
+ // Take first N of each type
137
+ const result: T[] = [];
138
+ for (const [type, typeQuestions] of byType) {
139
+ const selected = typeQuestions.slice(0, perTypeCount);
140
+ result.push(...selected);
141
+ console.log(` ${type}: ${selected.length}/${typeQuestions.length} questions`);
142
+ }
143
+
144
+ // Sort final result by question_id for consistent ordering
145
+ return result.sort((a, b) => a.question_id.localeCompare(b.question_id));
146
+ }
147
+
148
+ /**
149
+ * Apply comb sampling to a list of questions.
150
+ * Selects questions at regular intervals (combOffset) starting from startOffset,
151
+ * wrapping around to the beginning if needed.
152
+ */
153
+ export function applyCombSampling<T extends { question_id: string; question_type: string }>(
154
+ questions: T[],
155
+ sampleSize: number,
156
+ combOffset: number,
157
+ startOffset: number = 0,
158
+ ): T[] {
159
+ // Sort by question_id for deterministic ordering
160
+ const sorted = [...questions].sort((a, b) => a.question_id.localeCompare(b.question_id));
161
+
162
+ // Group by question type
163
+ const byType = new Map<string, T[]>();
164
+ for (const q of sorted) {
165
+ const existing = byType.get(q.question_type) || [];
166
+ existing.push(q);
167
+ byType.set(q.question_type, existing);
168
+ }
169
+
170
+ // Comb through each type
171
+ const result: T[] = [];
172
+ for (const [type, typeQuestions] of byType) {
173
+ const total = typeQuestions.length;
174
+ const selected: T[] = [];
175
+ const selectedIndices: number[] = [];
176
+
177
+ let currentIndex = startOffset % total;
178
+ for (let i = 0; i < sampleSize && i < total; i++) {
179
+ selected.push(typeQuestions[currentIndex]);
180
+ selectedIndices.push(currentIndex);
181
+ currentIndex = (currentIndex + combOffset) % total;
182
+ }
183
+
184
+ result.push(...selected);
185
+ console.log(` ${type}: ${selected.length}/${total} questions (indices: ${selectedIndices.join(', ')})`);
186
+ }
187
+
188
+ // Sort final result by question_id for consistent ordering
189
+ return result.sort((a, b) => a.question_id.localeCompare(b.question_id));
190
+ }
191
+
192
+ // ============================================================================
193
+ // Memory Configuration Definitions
194
+ // ============================================================================
195
+
196
+ /**
197
+ * Static definition of a memory configuration's properties.
198
+ * All derived flags are computed once here, not scattered across prepare/run.
199
+ */
200
+ export interface MemoryConfigDefinition {
201
+ /** The config type identifier */
202
+ type: string;
203
+
204
+ /** Human-readable description of this config */
205
+ description: string;
206
+
207
+ /** Memory options passed to Mastra Memory */
208
+ memoryOptions: MemoryConfig;
209
+
210
+ // --- Derived flags ---
211
+
212
+ /** Requires a real LLM model (not mock) */
213
+ needsRealModel: boolean;
214
+
215
+ /** Uses semantic recall for embeddings */
216
+ usesSemanticRecall: boolean;
217
+
218
+ /** Uses working memory */
219
+ usesWorkingMemory: boolean;
220
+
221
+ /** Uses tailored (per-question) templates */
222
+ usesTailored: boolean;
223
+
224
+ /** Uses observational memory */
225
+ usesObservationalMemory: boolean;
226
+
227
+ /** Uses shortcut OM (finalize at end) */
228
+ usesShortcutOM: boolean;
229
+
230
+ /** Uses Cerebras GLM model for OM */
231
+ usesGlmModel: boolean;
232
+
233
+ /** Model to use for OM Observer/Reflector (null = use default) */
234
+ omModel: string | null;
235
+
236
+ /** Max input tokens for finalize (null = no limit) */
237
+ omMaxInputTokens: number | null;
238
+
239
+ /** Requires sequential processing (no concurrency) */
240
+ requiresSequential: boolean;
241
+
242
+ /** Model to use for the main agent (defaults to openai/gpt-4o) */
243
+ agentModel?: string;
244
+
245
+ /** Model to use for the eval agent (defaults to openai/gpt-4o) */
246
+ evalModel?: string;
247
+
248
+ /** Base config to inherit prepared data from (for derived configs) */
249
+ baseConfig?: string;
250
+
251
+ /** If true, read directly from baseConfig's data at runtime (no copy/modification) */
252
+ readOnlyConfig?: boolean;
253
+
254
+ /** Enable the recall tool at runtime */
255
+ recallToolEnabled?: boolean;
256
+
257
+ /** Enable pattern recognition during observation */
258
+ recognizePatterns?: boolean;
259
+
260
+ /** Enable observation RAG filtering at runtime */
261
+ usesObservationRag?: boolean;
262
+
263
+ /** TopK for RAG retrieval (default: 50) */
264
+ ragTopK?: number;
265
+
266
+ /** Enable preference boost queries for RAG (default: false) */
267
+ ragPreferenceBoost?: boolean;
268
+
269
+ /** Max tokens per batch for Observer (default: 5000) */
270
+ observerMaxTokensPerBatch?: number;
271
+
272
+ /** Use legacy (Jan 7) Observer prompt for A/B testing (default: false) */
273
+ observerUseLegacyPrompt?: boolean;
274
+
275
+ /** Use condensed V3 Observer prompt for A/B testing (default: false) */
276
+ observerUseCondensedPrompt?: boolean;
277
+ }
278
+
279
+ // --- Shared config values ---
2
280
 
3
281
  const semanticRecall = {
4
282
  topK: 10,
@@ -8,76 +286,979 @@ const semanticRecall = {
8
286
 
9
287
  const lastMessages = 10;
10
288
 
11
- export function getMemoryOptions(memoryConfig: string): MemoryConfigOptions {
12
- switch (memoryConfig) {
13
- case 'semantic-recall':
14
- return {
15
- type: 'semantic-recall',
16
- options: {
17
- lastMessages,
18
- semanticRecall,
19
- workingMemory: { enabled: false },
20
- },
21
- };
22
-
23
- case 'working-memory':
24
- return {
25
- type: 'working-memory',
26
- options: {
27
- lastMessages,
28
- semanticRecall: false,
29
- workingMemory: {
30
- enabled: true,
31
- scope: 'resource',
32
- version: 'vnext',
33
- },
34
- },
35
- };
36
-
37
- // tailored means a custom working memory template is passed in per-question - to align with how working memory is intended to be used to track specific relevant information.
38
- case 'working-memory-tailored':
39
- return {
40
- type: 'working-memory',
41
- options: {
42
- lastMessages,
43
- semanticRecall: false,
44
- workingMemory: {
45
- enabled: true,
46
- scope: 'resource',
47
- version: 'vnext',
48
- },
49
- },
50
- };
51
-
52
- // Combined means semantic recall + working memory
53
- case 'combined':
54
- return {
55
- type: 'combined',
56
- options: {
57
- lastMessages,
58
- semanticRecall,
59
- workingMemory: {
60
- enabled: true,
61
- scope: 'resource',
62
- },
63
- },
64
- };
65
-
66
- case 'combined-tailored':
67
- return {
68
- type: 'combined-tailored',
69
- options: {
70
- lastMessages,
71
- semanticRecall,
72
- workingMemory: {
73
- enabled: true,
74
- scope: 'resource',
75
- version: 'vnext',
76
- },
77
- },
78
- };
79
-
80
- default:
81
- throw new Error(`Unknown memory config: ${memoryConfig}`);
289
+ // Cerebras GLM model config
290
+ export const CEREBRAS_GLM_MODEL = 'cerebras/zai-glm-4.6';
291
+ export const CEREBRAS_GLM_MAX_TOKENS = 200000;
292
+
293
+ // ============================================================================
294
+ // Config Aliases - Short names for memory configs
295
+ // ============================================================================
296
+
297
+ /**
298
+ * Short aliases for memory config types.
299
+ * Allows using 'om' instead of 'observational-memory', etc.
300
+ */
301
+ export const CONFIG_ALIASES: Record<string, MemoryConfigType> = {
302
+ // Short aliases
303
+ semantic: 'semantic-recall',
304
+ working: 'working-memory',
305
+ 'working-tailored': 'working-memory-tailored',
306
+ combined: 'combined',
307
+ 'combined-tailored': 'combined-tailored',
308
+ om: 'observational-memory',
309
+ 'om-shortcut': 'observational-memory-shortcut',
310
+ 'om-shortcut-glm': 'observational-memory-shortcut-glm',
311
+ 'om-patterns-observed': 'om-patterns-observed',
312
+ 'om-patterns-tool': 'om-patterns-tool',
313
+ 'om-glm': 'om-glm',
314
+ 'om-glm-patterns-observed': 'om-glm-patterns-observed',
315
+ 'om-glm-patterns-tool': 'om-glm-patterns-tool',
316
+ 'om-rag': 'om-rag',
317
+ 'om-glm-rag': 'om-glm-rag',
318
+ 'om-glm-rag-topk100': 'om-glm-rag-topk100',
319
+ 'om-glm-rag-prefboost': 'om-glm-rag-prefboost',
320
+ 'om-gemini-3-pro': 'om-gemini-3-pro',
321
+ 'om-gemini-3-flash': 'om-gemini-3-flash',
322
+ 'om-gpt5': 'om-gpt5',
323
+ 'om-gpt5-mini': 'om-gpt5-mini',
324
+ // om2 variants
325
+ om2: 'om2',
326
+ 'om2-gpt5': 'om2-gpt5',
327
+ 'om2-gpt5-mini': 'om2-gpt5-mini',
328
+ 'om2-glm': 'om2-glm',
329
+ 'om2-gemini-3-pro': 'om2-gemini-3-pro',
330
+ 'om2-gemini-3-flash': 'om2-gemini-3-flash',
331
+
332
+ // Full names (for completeness)
333
+ 'semantic-recall': 'semantic-recall',
334
+ 'working-memory': 'working-memory',
335
+ 'working-memory-tailored': 'working-memory-tailored',
336
+ 'observational-memory': 'observational-memory',
337
+ 'om-batch-10k': 'om-batch-10k',
338
+ 'om-legacy-prompt': 'om-legacy-prompt',
339
+ 'om-legacy-prompt-gpt5-mini': 'om-legacy-prompt-gpt5-mini',
340
+ 'om-batch-10k-gpt5-mini': 'om-batch-10k-gpt5-mini',
341
+ 'om-batch-10k-sequential': 'om-batch-10k-sequential',
342
+ 'om-batch-10k-sequential-gpt5-mini': 'om-batch-10k-sequential-gpt5-mini',
343
+ 'om-condensed-prompt': 'om-condensed-prompt',
344
+ 'om-condensed-prompt-gpt5-mini': 'om-condensed-prompt-gpt5-mini',
345
+ 'observational-memory-shortcut': 'observational-memory-shortcut',
346
+ 'observational-memory-shortcut-glm': 'observational-memory-shortcut-glm',
347
+ };
348
+
349
+ /**
350
+ * Resolve a config name (alias or full) to the canonical MemoryConfigType.
351
+ */
352
+ export function resolveConfigAlias(nameOrAlias: string): MemoryConfigType {
353
+ const resolved = CONFIG_ALIASES[nameOrAlias];
354
+ if (!resolved) {
355
+ throw new Error(`Unknown memory config: ${nameOrAlias}. Available: ${Object.keys(CONFIG_ALIASES).join(', ')}`);
82
356
  }
357
+ return resolved;
358
+ }
359
+
360
+ /**
361
+ * Get all available config aliases (short names only).
362
+ */
363
+ export function getConfigAliases(): string[] {
364
+ // Return all config keys from MEMORY_CONFIGS
365
+ return Object.keys(MEMORY_CONFIGS);
366
+ }
367
+
368
+ // ============================================================================
369
+ // Config Definitions Map
370
+ // ============================================================================
371
+
372
+ const MEMORY_CONFIGS = {
373
+ 'semantic-recall': {
374
+ type: 'semantic-recall',
375
+ description: 'Vector similarity search over message history',
376
+ memoryOptions: {
377
+ lastMessages,
378
+ semanticRecall,
379
+ workingMemory: { enabled: false },
380
+ },
381
+ needsRealModel: false,
382
+ usesSemanticRecall: true,
383
+ usesWorkingMemory: false,
384
+ usesTailored: false,
385
+ usesObservationalMemory: false,
386
+ usesShortcutOM: false,
387
+ usesGlmModel: false,
388
+ omModel: null,
389
+ omMaxInputTokens: null,
390
+ requiresSequential: false,
391
+ },
392
+
393
+ 'working-memory': {
394
+ type: 'working-memory',
395
+ description: 'LLM-maintained working memory (markdown scratchpad)',
396
+ memoryOptions: {
397
+ lastMessages,
398
+ semanticRecall: false,
399
+ workingMemory: {
400
+ enabled: true,
401
+ scope: 'resource',
402
+ version: 'vnext',
403
+ },
404
+ },
405
+ needsRealModel: true,
406
+ usesSemanticRecall: false,
407
+ usesWorkingMemory: true,
408
+ usesTailored: false,
409
+ usesObservationalMemory: false,
410
+ usesShortcutOM: false,
411
+ usesGlmModel: false,
412
+ omModel: null,
413
+ omMaxInputTokens: null,
414
+ requiresSequential: true,
415
+ agentModel: 'openai/gpt-4o',
416
+ evalModel: 'openai/gpt-4o',
417
+ },
418
+
419
+ 'working-memory-tailored': {
420
+ type: 'working-memory-tailored',
421
+ description: 'Working memory with per-question tailored templates',
422
+ memoryOptions: {
423
+ lastMessages,
424
+ semanticRecall: false,
425
+ workingMemory: {
426
+ enabled: true,
427
+ scope: 'resource',
428
+ version: 'vnext',
429
+ },
430
+ },
431
+ needsRealModel: true,
432
+ usesSemanticRecall: false,
433
+ usesWorkingMemory: true,
434
+ usesTailored: true,
435
+ usesObservationalMemory: false,
436
+ usesShortcutOM: false,
437
+ usesGlmModel: false,
438
+ omModel: null,
439
+ omMaxInputTokens: null,
440
+ requiresSequential: true,
441
+ agentModel: 'gpt-4o',
442
+ },
443
+
444
+ combined: {
445
+ type: 'combined',
446
+ description: 'Semantic recall + working memory combined',
447
+ memoryOptions: {
448
+ lastMessages,
449
+ semanticRecall,
450
+ workingMemory: {
451
+ enabled: true,
452
+ scope: 'resource',
453
+ },
454
+ },
455
+ needsRealModel: true,
456
+ usesSemanticRecall: true,
457
+ usesWorkingMemory: true,
458
+ usesTailored: false,
459
+ usesObservationalMemory: false,
460
+ usesShortcutOM: false,
461
+ usesGlmModel: false,
462
+ omModel: null,
463
+ omMaxInputTokens: null,
464
+ requiresSequential: true,
465
+ agentModel: 'openai/gpt-4o',
466
+ evalModel: 'openai/gpt-4o',
467
+ },
468
+
469
+ 'combined-tailored': {
470
+ type: 'combined-tailored',
471
+ description: 'Semantic recall + working memory with tailored templates',
472
+ memoryOptions: {
473
+ lastMessages,
474
+ semanticRecall,
475
+ workingMemory: {
476
+ enabled: true,
477
+ scope: 'resource',
478
+ version: 'vnext',
479
+ },
480
+ },
481
+ needsRealModel: true,
482
+ usesSemanticRecall: true,
483
+ usesWorkingMemory: true,
484
+ usesTailored: true,
485
+ usesObservationalMemory: false,
486
+ usesShortcutOM: false,
487
+ usesGlmModel: false,
488
+ omModel: null,
489
+ omMaxInputTokens: null,
490
+ requiresSequential: true,
491
+ agentModel: 'openai/gpt-4o',
492
+ evalModel: 'openai/gpt-4o',
493
+ },
494
+
495
+ 'observational-memory': {
496
+ type: 'observational-memory',
497
+ description: 'Observational Memory with GPT-4o (baseline OM config)',
498
+ memoryOptions: {
499
+ lastMessages: 0,
500
+ semanticRecall: false,
501
+ workingMemory: { enabled: false },
502
+ },
503
+ needsRealModel: true,
504
+ usesSemanticRecall: false,
505
+ usesWorkingMemory: false,
506
+ usesTailored: false,
507
+ usesObservationalMemory: true,
508
+ usesShortcutOM: false,
509
+ usesGlmModel: false,
510
+ omModel: null,
511
+ omMaxInputTokens: null,
512
+ requiresSequential: true,
513
+ agentModel: 'openai/gpt-4o',
514
+ evalModel: 'openai/gpt-4o',
515
+ },
516
+
517
+ 'om-batch-10k': {
518
+ type: 'om-batch-10k',
519
+ description: 'OM with 10k tokens per batch (vs default 5k) for comparison',
520
+ memoryOptions: {
521
+ lastMessages: 0,
522
+ semanticRecall: false,
523
+ workingMemory: { enabled: false },
524
+ },
525
+ needsRealModel: true,
526
+ usesSemanticRecall: false,
527
+ usesWorkingMemory: false,
528
+ usesTailored: false,
529
+ usesObservationalMemory: true,
530
+ usesShortcutOM: false,
531
+ usesGlmModel: false,
532
+ omModel: null,
533
+ omMaxInputTokens: null,
534
+ requiresSequential: true,
535
+ agentModel: 'openai/gpt-4o',
536
+ evalModel: 'openai/gpt-4o',
537
+ observerMaxTokensPerBatch: 10000,
538
+ },
539
+
540
+ 'om-batch-10k-sequential': {
541
+ type: 'om-batch-10k-sequential',
542
+ description: 'OM with 10k tokens per batch processed SEQUENTIALLY (batches see previous batch observations)',
543
+ memoryOptions: {
544
+ lastMessages: 0,
545
+ semanticRecall: false,
546
+ workingMemory: { enabled: false },
547
+ },
548
+ needsRealModel: true,
549
+ usesSemanticRecall: false,
550
+ usesWorkingMemory: false,
551
+ usesTailored: false,
552
+ usesObservationalMemory: true,
553
+ usesShortcutOM: false,
554
+ usesGlmModel: false,
555
+ omModel: null,
556
+ omMaxInputTokens: null,
557
+ requiresSequential: true,
558
+ agentModel: 'openai/gpt-4o',
559
+ evalModel: 'openai/gpt-4o',
560
+ observerMaxTokensPerBatch: 10000,
561
+ },
562
+
563
+ // ============================================================================
564
+ // Legacy Prompt Testing - A/B test to isolate prompt size impact
565
+ // ============================================================================
566
+
567
+ 'om-legacy-prompt': {
568
+ type: 'om-legacy-prompt',
569
+ description: 'OM with Jan 7 legacy Observer prompt (smaller, ~574 lines vs ~873 lines)',
570
+ memoryOptions: {
571
+ lastMessages: 0,
572
+ semanticRecall: false,
573
+ workingMemory: { enabled: false },
574
+ },
575
+ needsRealModel: true,
576
+ usesSemanticRecall: false,
577
+ usesWorkingMemory: false,
578
+ usesTailored: false,
579
+ usesObservationalMemory: true,
580
+ usesShortcutOM: false,
581
+ usesGlmModel: false,
582
+ omModel: null,
583
+ omMaxInputTokens: null,
584
+ requiresSequential: true,
585
+ agentModel: 'openai/gpt-4o',
586
+ evalModel: 'openai/gpt-4o',
587
+ observerUseLegacyPrompt: true,
588
+ },
589
+
590
+ 'om-legacy-prompt-gpt5-mini': {
591
+ type: 'om-legacy-prompt-gpt5-mini',
592
+ description: 'OM with legacy Observer prompt + GPT-5 Mini agent',
593
+ memoryOptions: {
594
+ lastMessages: 0,
595
+ semanticRecall: false,
596
+ workingMemory: { enabled: false },
597
+ },
598
+ needsRealModel: true,
599
+ usesSemanticRecall: false,
600
+ usesWorkingMemory: false,
601
+ usesTailored: false,
602
+ usesObservationalMemory: true,
603
+ usesShortcutOM: false,
604
+ usesGlmModel: false,
605
+ omModel: null,
606
+ omMaxInputTokens: null,
607
+ requiresSequential: true,
608
+ agentModel: 'openai/gpt-5-mini',
609
+ evalModel: 'openai/gpt-4o',
610
+ baseConfig: 'om-legacy-prompt',
611
+ readOnlyConfig: true,
612
+ },
613
+
614
+ 'om-condensed-prompt': {
615
+ type: 'om-condensed-prompt',
616
+ description: 'OM with condensed V3 Observer prompt - principle-based, shorter',
617
+ memoryOptions: {
618
+ lastMessages: 0,
619
+ semanticRecall: false,
620
+ workingMemory: { enabled: false },
621
+ },
622
+ needsRealModel: true,
623
+ usesSemanticRecall: false,
624
+ usesWorkingMemory: false,
625
+ usesTailored: false,
626
+ usesObservationalMemory: true,
627
+ usesShortcutOM: false,
628
+ usesGlmModel: false,
629
+ omModel: null,
630
+ omMaxInputTokens: null,
631
+ requiresSequential: true,
632
+ agentModel: 'openai/gpt-4o',
633
+ evalModel: 'openai/gpt-4o',
634
+ observerUseCondensedPrompt: true,
635
+ },
636
+
637
+ 'om-condensed-prompt-gpt5-mini': {
638
+ type: 'om-condensed-prompt-gpt5-mini',
639
+ description: 'OM with condensed V3 Observer prompt + GPT-5 Mini agent',
640
+ memoryOptions: {
641
+ lastMessages: 0,
642
+ semanticRecall: false,
643
+ workingMemory: { enabled: false },
644
+ },
645
+ needsRealModel: true,
646
+ usesSemanticRecall: false,
647
+ usesWorkingMemory: false,
648
+ usesTailored: false,
649
+ usesObservationalMemory: true,
650
+ usesShortcutOM: false,
651
+ usesGlmModel: false,
652
+ omModel: null,
653
+ omMaxInputTokens: null,
654
+ requiresSequential: true,
655
+ agentModel: 'openai/gpt-5-mini',
656
+ evalModel: 'openai/gpt-4o',
657
+ baseConfig: 'om-condensed-prompt',
658
+ readOnlyConfig: true,
659
+ },
660
+
661
+ 'observational-memory-shortcut': {
662
+ type: 'observational-memory-shortcut',
663
+ description: 'OM shortcut mode - single finalize() pass at end',
664
+ memoryOptions: {
665
+ lastMessages: 5,
666
+ semanticRecall: false,
667
+ workingMemory: { enabled: false },
668
+ },
669
+ needsRealModel: true,
670
+ usesSemanticRecall: false,
671
+ usesWorkingMemory: false,
672
+ usesTailored: false,
673
+ usesObservationalMemory: true,
674
+ usesShortcutOM: true,
675
+ usesGlmModel: false,
676
+ omModel: null,
677
+ omMaxInputTokens: null,
678
+ requiresSequential: true,
679
+ agentModel: 'gpt-4o',
680
+ },
681
+
682
+ 'observational-memory-shortcut-glm': {
683
+ type: 'observational-memory-shortcut-glm',
684
+ description: 'OM shortcut mode using Cerebras GLM for Observer/Reflector',
685
+ memoryOptions: {
686
+ lastMessages: 5,
687
+ semanticRecall: false,
688
+ workingMemory: { enabled: false },
689
+ },
690
+ needsRealModel: true,
691
+ usesSemanticRecall: false,
692
+ usesWorkingMemory: false,
693
+ usesTailored: false,
694
+ usesObservationalMemory: true,
695
+ usesShortcutOM: true,
696
+ usesGlmModel: true,
697
+ omModel: CEREBRAS_GLM_MODEL,
698
+ omMaxInputTokens: CEREBRAS_GLM_MAX_TOKENS,
699
+ requiresSequential: true,
700
+ agentModel: 'gpt-4o',
701
+ },
702
+
703
+ 'om-patterns-observed': {
704
+ type: 'om-patterns-observed',
705
+ description: 'OM with pattern recognition during observation',
706
+ memoryOptions: {
707
+ lastMessages: 5,
708
+ semanticRecall: false,
709
+ workingMemory: { enabled: false },
710
+ },
711
+ needsRealModel: true,
712
+ usesSemanticRecall: false,
713
+ usesWorkingMemory: false,
714
+ usesTailored: false,
715
+ usesObservationalMemory: true,
716
+ usesShortcutOM: false,
717
+ usesGlmModel: false,
718
+ omModel: null,
719
+ omMaxInputTokens: null,
720
+ requiresSequential: true,
721
+ agentModel: 'openai/gpt-4o',
722
+ evalModel: 'openai/gpt-4o',
723
+ baseConfig: 'observational-memory',
724
+ recognizePatterns: true,
725
+ },
726
+
727
+ 'om-patterns-tool': {
728
+ type: 'om-patterns-tool',
729
+ description: 'OM with recall tool for on-demand pattern recognition',
730
+ memoryOptions: {
731
+ lastMessages: 5,
732
+ semanticRecall: false,
733
+ workingMemory: { enabled: false },
734
+ },
735
+ needsRealModel: true,
736
+ usesSemanticRecall: false,
737
+ usesWorkingMemory: false,
738
+ usesTailored: false,
739
+ usesObservationalMemory: true,
740
+ usesShortcutOM: false,
741
+ usesGlmModel: false,
742
+ omModel: null,
743
+ omMaxInputTokens: null,
744
+ requiresSequential: true,
745
+ agentModel: 'openai/gpt-4o',
746
+ evalModel: 'openai/gpt-4o',
747
+ baseConfig: 'observational-memory',
748
+ readOnlyConfig: true, // Just enables recall tool, doesn't modify data
749
+ recallToolEnabled: true,
750
+ },
751
+
752
+ // GLM-4.7 variants - use Cerebras GLM for the main agent
753
+ 'om-glm': {
754
+ type: 'om-glm',
755
+ description: 'OM with Cerebras GLM as main agent',
756
+ memoryOptions: {
757
+ lastMessages: 5,
758
+ semanticRecall: false,
759
+ workingMemory: { enabled: false },
760
+ },
761
+ needsRealModel: true,
762
+ usesSemanticRecall: false,
763
+ usesWorkingMemory: false,
764
+ usesTailored: false,
765
+ usesObservationalMemory: true,
766
+ usesShortcutOM: false,
767
+ usesGlmModel: false, // This is for Observer/Reflector, not the main agent
768
+ omModel: null,
769
+ omMaxInputTokens: null,
770
+ requiresSequential: true,
771
+ agentModel: CEREBRAS_GLM_MODEL, // Main agent uses GLM-4.7
772
+ evalModel: 'openai/gpt-4o', // Eval stays on GPT-4o
773
+ baseConfig: 'observational-memory',
774
+ readOnlyConfig: true, // Uses same prepared data as observational-memory
775
+ },
776
+
777
+ 'om-glm-patterns-observed': {
778
+ type: 'om-glm-patterns-observed',
779
+ description: 'OM + GLM agent + pattern recognition during observation',
780
+ memoryOptions: {
781
+ lastMessages: 5,
782
+ semanticRecall: false,
783
+ workingMemory: { enabled: false },
784
+ },
785
+ needsRealModel: true,
786
+ usesSemanticRecall: false,
787
+ usesWorkingMemory: false,
788
+ usesTailored: false,
789
+ usesObservationalMemory: true,
790
+ usesShortcutOM: false,
791
+ usesGlmModel: false,
792
+ omModel: null,
793
+ omMaxInputTokens: null,
794
+ requiresSequential: true,
795
+ agentModel: CEREBRAS_GLM_MODEL,
796
+ evalModel: 'openai/gpt-4o',
797
+ baseConfig: 'om-patterns-observed', // Inherits from patterns-observed
798
+ readOnlyConfig: true,
799
+ recognizePatterns: true,
800
+ },
801
+
802
+ 'om-glm-patterns-tool': {
803
+ type: 'om-glm-patterns-tool',
804
+ description: 'OM + GLM agent + recall tool for pattern recognition',
805
+ memoryOptions: {
806
+ lastMessages: 5,
807
+ semanticRecall: false,
808
+ workingMemory: { enabled: false },
809
+ },
810
+ needsRealModel: true,
811
+ usesSemanticRecall: false,
812
+ usesWorkingMemory: false,
813
+ usesTailored: false,
814
+ usesObservationalMemory: true,
815
+ usesShortcutOM: false,
816
+ usesGlmModel: false,
817
+ omModel: null,
818
+ omMaxInputTokens: null,
819
+ requiresSequential: true,
820
+ agentModel: CEREBRAS_GLM_MODEL,
821
+ evalModel: 'openai/gpt-4o',
822
+ baseConfig: 'observational-memory', // Uses base OM data
823
+ readOnlyConfig: true,
824
+ recallToolEnabled: true,
825
+ },
826
+
827
+ // RAG variants - use semantic filtering on observations
828
+ 'om-rag': {
829
+ type: 'om-rag',
830
+ description: 'OM with RAG filtering on observations at runtime',
831
+ memoryOptions: {
832
+ lastMessages: 5,
833
+ semanticRecall: false,
834
+ workingMemory: { enabled: false },
835
+ },
836
+ needsRealModel: true,
837
+ usesSemanticRecall: false,
838
+ usesWorkingMemory: false,
839
+ usesTailored: false,
840
+ usesObservationalMemory: true,
841
+ usesShortcutOM: false,
842
+ usesGlmModel: false,
843
+ omModel: null,
844
+ omMaxInputTokens: null,
845
+ requiresSequential: true,
846
+ agentModel: 'openai/gpt-4o',
847
+ evalModel: 'openai/gpt-4o',
848
+ baseConfig: 'observational-memory',
849
+ readOnlyConfig: true, // Uses same prepared data, just filters at runtime
850
+ usesObservationRag: true, // Enable the ObservationSemanticFilter processor
851
+ },
852
+
853
+ 'om-glm-rag': {
854
+ type: 'om-glm-rag',
855
+ description: 'OM + GLM agent + RAG filtering',
856
+ memoryOptions: {
857
+ lastMessages: 5,
858
+ semanticRecall: false,
859
+ workingMemory: { enabled: false },
860
+ },
861
+ needsRealModel: true,
862
+ usesSemanticRecall: false,
863
+ usesWorkingMemory: false,
864
+ usesTailored: false,
865
+ usesObservationalMemory: true,
866
+ usesShortcutOM: false,
867
+ usesGlmModel: false,
868
+ omModel: null,
869
+ omMaxInputTokens: null,
870
+ requiresSequential: true,
871
+ agentModel: CEREBRAS_GLM_MODEL,
872
+ // evalModel: CEREBRAS_GLM_MODEL,
873
+ baseConfig: 'observational-memory',
874
+ readOnlyConfig: true,
875
+ usesObservationRag: true,
876
+ },
877
+
878
+ 'om-glm-rag-topk100': {
879
+ type: 'om-glm-rag-topk100',
880
+ description: 'OM + GLM + RAG with topK=100 (experimental)',
881
+ memoryOptions: {
882
+ lastMessages: 5,
883
+ semanticRecall: false,
884
+ workingMemory: { enabled: false },
885
+ },
886
+ needsRealModel: true,
887
+ usesSemanticRecall: false,
888
+ usesWorkingMemory: false,
889
+ usesTailored: false,
890
+ usesObservationalMemory: true,
891
+ usesShortcutOM: false,
892
+ usesGlmModel: false,
893
+ omModel: null,
894
+ omMaxInputTokens: null,
895
+ requiresSequential: true,
896
+ agentModel: CEREBRAS_GLM_MODEL,
897
+ evalModel: CEREBRAS_GLM_MODEL,
898
+ baseConfig: 'observational-memory',
899
+ readOnlyConfig: true,
900
+ usesObservationRag: true,
901
+ ragTopK: 100, // Override default topK of 50
902
+ },
903
+ 'om-glm-rag-prefboost': {
904
+ type: 'om-glm-rag-prefboost',
905
+ description: 'OM + GLM + RAG with preference boost queries (experimental)',
906
+ memoryOptions: {
907
+ lastMessages: 5,
908
+ semanticRecall: false,
909
+ workingMemory: { enabled: false },
910
+ },
911
+ needsRealModel: true,
912
+ usesSemanticRecall: false,
913
+ usesWorkingMemory: false,
914
+ usesTailored: false,
915
+ usesObservationalMemory: true,
916
+ usesShortcutOM: false,
917
+ usesGlmModel: false,
918
+ omModel: null,
919
+ omMaxInputTokens: null,
920
+ requiresSequential: true,
921
+ agentModel: CEREBRAS_GLM_MODEL,
922
+ evalModel: CEREBRAS_GLM_MODEL,
923
+ baseConfig: 'observational-memory',
924
+ readOnlyConfig: true,
925
+ usesObservationRag: true,
926
+ ragPreferenceBoost: true, // Enable preference boost queries
927
+ },
928
+
929
+ 'om-gemini-3-pro': {
930
+ type: 'om-gemini-3-pro',
931
+ description: 'OM with Gemini 3 Pro as main agent',
932
+ memoryOptions: {
933
+ lastMessages: 0,
934
+ semanticRecall: false,
935
+ workingMemory: { enabled: false },
936
+ },
937
+ needsRealModel: true,
938
+ usesSemanticRecall: false,
939
+ usesWorkingMemory: false,
940
+ usesTailored: false,
941
+ usesObservationalMemory: true,
942
+ usesShortcutOM: false,
943
+ usesGlmModel: false,
944
+ omModel: null,
945
+ omMaxInputTokens: null,
946
+ requiresSequential: true,
947
+ agentModel: 'google/gemini-3-pro-preview',
948
+ evalModel: 'openai/gpt-4o',
949
+ baseConfig: 'observational-memory',
950
+ readOnlyConfig: true,
951
+ },
952
+
953
+ 'om-gemini-3-flash': {
954
+ type: 'om-gemini-3-flash',
955
+ description: 'OM with Gemini 3 Flash as main agent',
956
+ memoryOptions: {
957
+ lastMessages: 0,
958
+ semanticRecall: false,
959
+ workingMemory: { enabled: false },
960
+ },
961
+ needsRealModel: true,
962
+ usesSemanticRecall: false,
963
+ usesWorkingMemory: false,
964
+ usesTailored: false,
965
+ usesObservationalMemory: true,
966
+ usesShortcutOM: false,
967
+ usesGlmModel: false,
968
+ omModel: null,
969
+ omMaxInputTokens: null,
970
+ requiresSequential: true,
971
+ agentModel: 'google/gemini-3-flash-preview',
972
+ evalModel: 'openai/gpt-4o',
973
+ baseConfig: 'observational-memory',
974
+ readOnlyConfig: true,
975
+ },
976
+
977
+ // ============================================================================
978
+ // om2 - Fresh preparation with latest Observer/Reflector improvements
979
+ // ============================================================================
980
+
981
+ om2: {
982
+ type: 'om2',
983
+ description: 'OM v2 - fresh data with latest Observer/Reflector improvements',
984
+ memoryOptions: {
985
+ lastMessages: 0,
986
+ semanticRecall: false,
987
+ workingMemory: { enabled: false },
988
+ },
989
+ needsRealModel: true,
990
+ usesSemanticRecall: false,
991
+ usesWorkingMemory: false,
992
+ usesTailored: false,
993
+ usesObservationalMemory: true,
994
+ usesShortcutOM: false,
995
+ usesGlmModel: false,
996
+ omModel: null,
997
+ omMaxInputTokens: null,
998
+ requiresSequential: true,
999
+ agentModel: 'openai/gpt-4o',
1000
+ evalModel: 'openai/gpt-4o',
1001
+ },
1002
+
1003
+ 'om2-gpt5': {
1004
+ type: 'om2-gpt5',
1005
+ description: 'OM v2 with GPT-5 as main agent',
1006
+ memoryOptions: {
1007
+ lastMessages: 0,
1008
+ semanticRecall: false,
1009
+ workingMemory: { enabled: false },
1010
+ },
1011
+ needsRealModel: true,
1012
+ usesSemanticRecall: false,
1013
+ usesWorkingMemory: false,
1014
+ usesTailored: false,
1015
+ usesObservationalMemory: true,
1016
+ usesShortcutOM: false,
1017
+ usesGlmModel: false,
1018
+ omModel: null,
1019
+ omMaxInputTokens: null,
1020
+ requiresSequential: true,
1021
+ agentModel: 'openai/gpt-5',
1022
+ evalModel: 'openai/gpt-4o',
1023
+ baseConfig: 'om2',
1024
+ readOnlyConfig: true,
1025
+ },
1026
+
1027
+ 'om2-gpt5-mini': {
1028
+ type: 'om2-gpt5-mini',
1029
+ description: 'OM v2 with GPT-5 Mini as main agent',
1030
+ memoryOptions: {
1031
+ lastMessages: 0,
1032
+ semanticRecall: false,
1033
+ workingMemory: { enabled: false },
1034
+ },
1035
+ needsRealModel: true,
1036
+ usesSemanticRecall: false,
1037
+ usesWorkingMemory: false,
1038
+ usesTailored: false,
1039
+ usesObservationalMemory: true,
1040
+ usesShortcutOM: false,
1041
+ usesGlmModel: false,
1042
+ omModel: null,
1043
+ omMaxInputTokens: null,
1044
+ requiresSequential: true,
1045
+ agentModel: 'openai/gpt-5-mini',
1046
+ evalModel: 'openai/gpt-4o',
1047
+ baseConfig: 'om2',
1048
+ readOnlyConfig: true,
1049
+ },
1050
+
1051
+ 'om2-glm': {
1052
+ type: 'om2-glm',
1053
+ description: 'OM v2 with Cerebras GLM as main agent',
1054
+ memoryOptions: {
1055
+ lastMessages: 0,
1056
+ semanticRecall: false,
1057
+ workingMemory: { enabled: false },
1058
+ },
1059
+ needsRealModel: true,
1060
+ usesSemanticRecall: false,
1061
+ usesWorkingMemory: false,
1062
+ usesTailored: false,
1063
+ usesObservationalMemory: true,
1064
+ usesShortcutOM: false,
1065
+ usesGlmModel: false,
1066
+ omModel: null,
1067
+ omMaxInputTokens: null,
1068
+ requiresSequential: true,
1069
+ agentModel: CEREBRAS_GLM_MODEL,
1070
+ evalModel: 'openai/gpt-4o',
1071
+ baseConfig: 'om2',
1072
+ readOnlyConfig: true,
1073
+ },
1074
+
1075
+ 'om2-gemini-3-pro': {
1076
+ type: 'om2-gemini-3-pro',
1077
+ description: 'OM v2 with Gemini 3 Pro as main agent',
1078
+ memoryOptions: {
1079
+ lastMessages: 0,
1080
+ semanticRecall: false,
1081
+ workingMemory: { enabled: false },
1082
+ },
1083
+ needsRealModel: true,
1084
+ usesSemanticRecall: false,
1085
+ usesWorkingMemory: false,
1086
+ usesTailored: false,
1087
+ usesObservationalMemory: true,
1088
+ usesShortcutOM: false,
1089
+ usesGlmModel: false,
1090
+ omModel: null,
1091
+ omMaxInputTokens: null,
1092
+ requiresSequential: true,
1093
+ agentModel: 'google/gemini-3-pro-preview',
1094
+ evalModel: 'openai/gpt-4o',
1095
+ baseConfig: 'om2',
1096
+ readOnlyConfig: true,
1097
+ },
1098
+
1099
+ 'om2-gemini-3-flash': {
1100
+ type: 'om2-gemini-3-flash',
1101
+ description: 'OM v2 with Gemini 3 Flash as main agent',
1102
+ memoryOptions: {
1103
+ lastMessages: 0,
1104
+ semanticRecall: false,
1105
+ workingMemory: { enabled: false },
1106
+ },
1107
+ needsRealModel: true,
1108
+ usesSemanticRecall: false,
1109
+ usesWorkingMemory: false,
1110
+ usesTailored: false,
1111
+ usesObservationalMemory: true,
1112
+ usesShortcutOM: false,
1113
+ usesGlmModel: false,
1114
+ omModel: null,
1115
+ omMaxInputTokens: null,
1116
+ requiresSequential: true,
1117
+ agentModel: 'google/gemini-3-flash-preview',
1118
+ evalModel: 'openai/gpt-4o',
1119
+ baseConfig: 'om2',
1120
+ readOnlyConfig: true,
1121
+ },
1122
+
1123
+ // GPT-5 variants
1124
+ 'om-gpt5': {
1125
+ type: 'om-gpt5',
1126
+ description: 'OM with GPT-5 as main agent',
1127
+ memoryOptions: {
1128
+ lastMessages: 0,
1129
+ semanticRecall: false,
1130
+ workingMemory: { enabled: false },
1131
+ },
1132
+ needsRealModel: true,
1133
+ usesSemanticRecall: false,
1134
+ usesWorkingMemory: false,
1135
+ usesTailored: false,
1136
+ usesObservationalMemory: true,
1137
+ usesShortcutOM: false,
1138
+ usesGlmModel: false,
1139
+ omModel: null,
1140
+ omMaxInputTokens: null,
1141
+ requiresSequential: true,
1142
+ agentModel: 'openai/gpt-5',
1143
+ evalModel: 'openai/gpt-4o',
1144
+ baseConfig: 'observational-memory',
1145
+ readOnlyConfig: true,
1146
+ },
1147
+
1148
+ 'om-gpt5-mini': {
1149
+ type: 'om-gpt5-mini',
1150
+ description: 'OM with GPT-5 Mini as main agent',
1151
+ memoryOptions: {
1152
+ lastMessages: 0,
1153
+ semanticRecall: false,
1154
+ workingMemory: { enabled: false },
1155
+ },
1156
+ needsRealModel: true,
1157
+ usesSemanticRecall: false,
1158
+ usesWorkingMemory: false,
1159
+ usesTailored: false,
1160
+ usesObservationalMemory: true,
1161
+ usesShortcutOM: false,
1162
+ usesGlmModel: false,
1163
+ omModel: null,
1164
+ omMaxInputTokens: null,
1165
+ requiresSequential: true,
1166
+ agentModel: 'openai/gpt-5-mini',
1167
+ evalModel: 'openai/gpt-4o',
1168
+ baseConfig: 'observational-memory',
1169
+ readOnlyConfig: true,
1170
+ },
1171
+
1172
+ // Batch size comparison variant
1173
+ 'om-batch-10k-gpt5-mini': {
1174
+ type: 'om-batch-10k-gpt5-mini',
1175
+ description: 'OM with 10k tokens per batch, GPT-5 Mini agent (for batch size comparison)',
1176
+ memoryOptions: {
1177
+ lastMessages: 0,
1178
+ semanticRecall: false,
1179
+ workingMemory: { enabled: false },
1180
+ },
1181
+ needsRealModel: true,
1182
+ usesSemanticRecall: false,
1183
+ usesWorkingMemory: false,
1184
+ usesTailored: false,
1185
+ usesObservationalMemory: true,
1186
+ usesShortcutOM: false,
1187
+ usesGlmModel: false,
1188
+ omModel: null,
1189
+ omMaxInputTokens: null,
1190
+ requiresSequential: true,
1191
+ agentModel: 'openai/gpt-5-mini',
1192
+ evalModel: 'openai/gpt-4o',
1193
+ baseConfig: 'om-batch-10k',
1194
+ readOnlyConfig: true,
1195
+ },
1196
+
1197
+ // Sequential batch processing variants (batches see previous batch observations)
1198
+ 'om-batch-10k-sequential-gpt5-mini': {
1199
+ type: 'om-batch-10k-sequential-gpt5-mini',
1200
+ description: 'OM with 10k sequential batches, GPT-5 Mini agent (batches see previous observations)',
1201
+ memoryOptions: {
1202
+ lastMessages: 0,
1203
+ semanticRecall: false,
1204
+ workingMemory: { enabled: false },
1205
+ },
1206
+ needsRealModel: true,
1207
+ usesSemanticRecall: false,
1208
+ usesWorkingMemory: false,
1209
+ usesTailored: false,
1210
+ usesObservationalMemory: true,
1211
+ usesShortcutOM: false,
1212
+ usesGlmModel: false,
1213
+ omModel: null,
1214
+ omMaxInputTokens: null,
1215
+ requiresSequential: true,
1216
+ agentModel: 'openai/gpt-5-mini',
1217
+ evalModel: 'openai/gpt-4o',
1218
+ baseConfig: 'om-batch-10k-sequential',
1219
+ readOnlyConfig: true,
1220
+ },
1221
+ } satisfies Record<string, MemoryConfigDefinition>;
1222
+
1223
+ // Derive MemoryConfigType from the keys of MEMORY_CONFIGS
1224
+ export type MemoryConfigType = keyof typeof MEMORY_CONFIGS;
1225
+
1226
+ // ============================================================================
1227
+ // Public API
1228
+ // ============================================================================
1229
+
1230
+ /**
1231
+ * Get the full config definition for a memory config type.
1232
+ */
1233
+ export function getMemoryConfig(memoryConfig: MemoryConfigType): MemoryConfigDefinition {
1234
+ const config = MEMORY_CONFIGS[memoryConfig];
1235
+ if (!config) {
1236
+ throw new Error(`Unknown memory config: ${memoryConfig}`);
1237
+ }
1238
+ return config;
1239
+ }
1240
+
1241
+ /**
1242
+ * Get memory options in the legacy format (for backwards compatibility).
1243
+ */
1244
+ export function getMemoryOptions(memoryConfig: string): MemoryConfigOptions {
1245
+ const config = getMemoryConfig(memoryConfig as MemoryConfigType);
1246
+ return {
1247
+ type: config.type,
1248
+ options: config.memoryOptions,
1249
+ };
1250
+ }
1251
+
1252
+ /**
1253
+ * Check if a string is a valid memory config type.
1254
+ */
1255
+ export function isValidMemoryConfig(memoryConfig: string): memoryConfig is MemoryConfigType {
1256
+ return memoryConfig in MEMORY_CONFIGS;
1257
+ }
1258
+
1259
+ /**
1260
+ * Get all available memory config types.
1261
+ */
1262
+ export function getAvailableConfigs(): MemoryConfigType[] {
1263
+ return Object.keys(MEMORY_CONFIGS) as MemoryConfigType[];
83
1264
  }