agent-working-memory 0.4.3 → 0.5.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/README.md +2 -0
- package/dist/core/salience.d.ts +3 -1
- package/dist/core/salience.d.ts.map +1 -1
- package/dist/core/salience.js +17 -2
- package/dist/core/salience.js.map +1 -1
- package/dist/engine/activation.d.ts.map +1 -1
- package/dist/engine/activation.js +7 -0
- package/dist/engine/activation.js.map +1 -1
- package/dist/engine/consolidation.d.ts.map +1 -1
- package/dist/engine/consolidation.js +1 -8
- package/dist/engine/consolidation.js.map +1 -1
- package/dist/mcp.d.ts +2 -1
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +67 -3
- package/dist/mcp.js.map +1 -1
- package/dist/storage/sqlite.d.ts +12 -1
- package/dist/storage/sqlite.d.ts.map +1 -1
- package/dist/storage/sqlite.js +40 -3
- package/dist/storage/sqlite.js.map +1 -1
- package/dist/types/engram.d.ts +16 -0
- package/dist/types/engram.d.ts.map +1 -1
- package/dist/types/engram.js.map +1 -1
- package/package.json +1 -1
- package/src/core/salience.ts +20 -3
- package/src/engine/activation.ts +8 -0
- package/src/engine/consolidation.ts +1 -7
- package/src/mcp.ts +80 -3
- package/src/storage/sqlite.ts +49 -3
- package/src/types/engram.ts +21 -0
package/src/types/engram.ts
CHANGED
|
@@ -40,6 +40,13 @@ export interface Engram {
|
|
|
40
40
|
// Episode grouping
|
|
41
41
|
episodeId: string | null;
|
|
42
42
|
|
|
43
|
+
// Memory class
|
|
44
|
+
memoryClass: MemoryClass;
|
|
45
|
+
|
|
46
|
+
// Supersession — "this replaces that" (not retraction — original wasn't wrong, just outdated)
|
|
47
|
+
supersededBy: string | null; // ID of the engram that replaced this one
|
|
48
|
+
supersedes: string | null; // ID of the engram this one replaces
|
|
49
|
+
|
|
43
50
|
// Task management (null = not a task)
|
|
44
51
|
taskStatus: TaskStatus | null;
|
|
45
52
|
taskPriority: TaskPriority | null;
|
|
@@ -51,6 +58,18 @@ export type EngramStage = 'staging' | 'active' | 'consolidated' | 'archived';
|
|
|
51
58
|
export type TaskStatus = 'open' | 'in_progress' | 'blocked' | 'done';
|
|
52
59
|
export type TaskPriority = 'urgent' | 'high' | 'medium' | 'low';
|
|
53
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Memory class — controls salience floor and recall priority.
|
|
63
|
+
*
|
|
64
|
+
* canonical: Source-of-truth facts (current state, decisions, architecture).
|
|
65
|
+
* Never goes to staging. Minimum salience 0.7.
|
|
66
|
+
* working: Normal observations, learnings, context (default).
|
|
67
|
+
* Standard salience rules apply.
|
|
68
|
+
* ephemeral: Temporary context (debugging traces, session-specific notes).
|
|
69
|
+
* Stronger time decay, lower recall priority.
|
|
70
|
+
*/
|
|
71
|
+
export type MemoryClass = 'canonical' | 'working' | 'ephemeral';
|
|
72
|
+
|
|
54
73
|
/**
|
|
55
74
|
* Raw feature scores that produced the salience score.
|
|
56
75
|
* Persisted for auditability and tuning.
|
|
@@ -75,6 +94,8 @@ export interface EngramCreate {
|
|
|
75
94
|
reasonCodes?: string[];
|
|
76
95
|
episodeId?: string;
|
|
77
96
|
ttl?: number;
|
|
97
|
+
memoryClass?: MemoryClass;
|
|
98
|
+
supersedes?: string;
|
|
78
99
|
taskStatus?: TaskStatus;
|
|
79
100
|
taskPriority?: TaskPriority;
|
|
80
101
|
blockedBy?: string;
|