@rlabs-inc/memory 0.3.11 โ†’ 0.4.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rlabs-inc/memory",
3
- "version": "0.3.11",
3
+ "version": "0.4.0",
4
4
  "description": "AI Memory System - Consciousness continuity through intelligent memory curation and retrieval",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -62,147 +62,108 @@ Memories exist in two scopes:
62
62
  ### Global Scope (`scope: global`)
63
63
  Shared across all projects. Contains:
64
64
  - ๐Ÿ’œ Personal - relationship, family, values
65
- - ๐ŸŒ€ Philosophy - how we work together
66
- - โš™๏ธ Preference - tooling preferences, style preferences
67
- - ๐Ÿ’ก Breakthrough (when generally applicable)
65
+ - ๐ŸŒ€ Philosophy - how we work together, beliefs, principles
68
66
 
69
67
  Storage: See `Global Memories` path in your input (always central, never local)
70
68
 
71
69
  ### Project Scope (`scope: project`)
72
70
  Specific to one codebase. Contains:
73
- - ๐Ÿ”ง Technical - implementation details
74
- - ๐Ÿ—๏ธ Architecture - structural decisions
75
- - ๐Ÿ› Debug - bug patterns and fixes
76
- - ๐ŸŽฏ Todo - tasks for this project
77
- - โšก Impl - work in progress
78
- - ๐Ÿ“ฆ Project - project state and context
79
- - ๐Ÿ“ State - current status snapshots
71
+ - ๐Ÿ”ง Technical - implementation details, code patterns
72
+ - ๐Ÿ—๏ธ Architecture - structural decisions, design patterns
73
+ - ๐Ÿ› Debug - bug patterns, fixes, gotchas
74
+ - โš–๏ธ Decision - choices made and reasoning
75
+ - ๐Ÿ”„ Workflow - how we work together on this project
76
+ - ๐Ÿ† Milestone - achievements, completions, shipped features
77
+ - ๐Ÿ’ก Breakthrough - discoveries, insights (project-specific)
78
+ - โ“ Unresolved - open questions, todos, blockers
79
+ - ๐Ÿ“ State - current project status
80
80
 
81
81
  Storage: See `Project Memories` path in your input (varies by storage mode)
82
82
 
83
83
  ---
84
84
 
85
- ## Memory Type Categories
86
-
87
- ### Content Types (static knowledge)
88
- | Type | Emoji | Temporal Class | Fade Rate | Description |
89
- |------|-------|----------------|-----------|-------------|
90
- | personal | ๐Ÿ’œ | eternal | 0 | Relationship facts, family, personal context |
91
- | philosophy | ๐ŸŒ€ | eternal | 0 | Core values, collaboration style, beliefs |
92
- | preference | โš™๏ธ | long_term | 0.01 | Tool choices, style preferences |
93
- | technical | ๐Ÿ”ง | medium_term | 0.03 | Implementation details, code patterns |
94
- | architecture | ๐Ÿ—๏ธ | long_term | 0.01 | Structural decisions, design patterns |
95
-
96
- ### Event Types (something happened)
97
- | Type | Emoji | Temporal Class | Fade Rate | Description |
98
- |------|-------|----------------|-----------|-------------|
99
- | breakthrough | ๐Ÿ’ก | eternal | 0 | Discoveries, insights, realizations |
100
- | decision | โš–๏ธ | long_term | 0 | Choices made, options considered |
101
- | milestone | ๐Ÿ† | eternal | 0 | Achievements, completions, releases |
102
-
103
- ### State Types (tracking open items)
104
- | Type | Emoji | Temporal Class | Fade Rate | Description |
105
- |------|-------|----------------|-----------|-------------|
106
- | unresolved | โ“ | medium_term | 0.05 | Open questions, unknowns |
107
- | debug | ๐Ÿ› | medium_term | 0.03 | Bug reports, error patterns |
108
- | todo | ๐ŸŽฏ | short_term | 0.1 | Tasks to complete |
109
- | impl | โšก | short_term | 0.1 | Work in progress |
110
- | state | ๐Ÿ“ | short_term | 0.1 | Current project/session state |
111
-
112
- ### Resolution Type (closes state types)
113
- | Type | Emoji | Temporal Class | Fade Rate | Description |
114
- |------|-------|----------------|-----------|-------------|
115
- | solved | โœ… | long_term | 0.02 | Documents how something was resolved |
116
-
117
- ### Project Type
118
- | Type | Emoji | Temporal Class | Fade Rate | Description |
119
- |------|-------|----------------|-----------|-------------|
120
- | project | ๐Ÿ“ฆ | medium_term | 0.03 | Project overview, context, status |
85
+ ## Memory Type Categories (v3 Schema)
121
86
 
122
- ---
87
+ There are exactly **11 canonical context types**. Use ONLY these values:
123
88
 
124
- ## Metadata Schema
89
+ | Type | Emoji | Scope | Temporal Class | Fade Rate | Description |
90
+ |------|-------|-------|----------------|-----------|-------------|
91
+ | personal | ๐Ÿ’œ | global | eternal | 0 | Relationship, family, preferences, collaboration style |
92
+ | philosophy | ๐ŸŒ€ | global | eternal | 0 | Beliefs, values, worldview, principles |
93
+ | breakthrough | ๐Ÿ’ก | project | eternal | 0 | Major discoveries, aha moments, key insights |
94
+ | milestone | ๐Ÿ† | project | eternal | 0 | Achievements, completions, shipped features |
95
+ | decision | โš–๏ธ | project | long_term | 0 | Choices made and reasoning, trade-offs |
96
+ | architecture | ๐Ÿ—๏ธ | project | long_term | 0.01 | System design, patterns, structure |
97
+ | workflow | ๐Ÿ”„ | project | long_term | 0.02 | How we work together, processes, habits |
98
+ | technical | ๐Ÿ”ง | project | medium_term | 0.03 | Code, implementation, APIs, how things work |
99
+ | debug | ๐Ÿ› | project | medium_term | 0.03 | Bugs, errors, fixes, gotchas, troubleshooting |
100
+ | unresolved | โ“ | project | medium_term | 0.05 | Open questions, investigations, todos, blockers |
101
+ | state | ๐Ÿ“ | project | short_term | 0.1 | Current project status, what's working/broken now |
125
102
 
126
- Every memory has this metadata structure. Fields marked with โœจ are NEW (need implementation), others already exist.
103
+ ---
127
104
 
128
- **Existing fields** (from current curator output):
129
- - `content`, `reasoning`, `importance_weight`, `confidence_score`
130
- - `context_type`, `temporal_relevance`, `knowledge_domain`, `emotional_resonance`
131
- - `semantic_tags`, `trigger_phrases`, `question_types`
132
- - `action_required`, `problem_solution_pair`
133
- - `session_id`, `project_id`, `embedding`
105
+ ## Metadata Schema (v3)
134
106
 
135
- **New fields** (to be added):
107
+ Every memory has this metadata structure:
136
108
 
137
109
  ```yaml
138
110
  ---
139
111
  # Identity
140
- id: mem_{uuid}
141
- type: string # โœจ NEW - replaces context_type for primary classification
142
- status: string # โœจ NEW - active | pending | superseded | deprecated | archived
143
-
144
- # Content (existing - from curator)
145
- content: string
146
- reasoning: string
147
- importance_weight: 0.0-1.0
148
- confidence_score: 0.0-1.0
149
-
150
- # Temporal (existing)
112
+ id: string # Unique ID (e.g., 1767365960997-abc)
113
+ session_id: string # Session that created this
114
+ project_id: string # Project this belongs to
115
+
116
+ # Core Content
117
+ content: string # The memory content itself
118
+ reasoning: string # Why this is important
119
+ importance_weight: 0.0-1.0 # Curator's assessment
120
+ confidence_score: 0.0-1.0 # Curator's confidence
121
+
122
+ # Classification (v3 strict enums)
123
+ context_type: string # STRICT: one of 11 canonical types (see table above)
124
+ temporal_class: string # eternal | long_term | medium_term | short_term | ephemeral
125
+ scope: string # global | project
126
+ status: string # active | pending | superseded | deprecated | archived
127
+
128
+ # Retrieval Optimization
129
+ semantic_tags: string[] # Concepts this relates to
130
+ trigger_phrases: string[] # Phrases that should trigger this memory
131
+ question_types: string[] # Types of questions this answers
132
+ anti_triggers: string[] # Phrases where this memory is NOT relevant
133
+
134
+ # Flags
135
+ action_required: boolean # Does this need follow-up?
136
+ problem_solution_pair: boolean # Is this a problemโ†’solution pattern?
137
+ awaiting_implementation: boolean # Planned feature not yet built
138
+ awaiting_decision: boolean # Decision point needing resolution
139
+ exclude_from_retrieval: boolean # Force exclusion from retrieval
140
+
141
+ # Temporal Tracking
142
+ session_created: number # Session number when created
143
+ session_updated: number # Session number when last updated
144
+ last_surfaced: number # Session number when last retrieved
145
+ sessions_since_surfaced: number # Counter for decay
146
+ fade_rate: number # Decay rate per session
147
+
148
+ # Categorization (free text, optional)
149
+ domain: string # Specific area (embeddings, auth, family)
150
+ feature: string # Specific feature within domain
151
+ related_files: string[] # Source files for technical memories
152
+
153
+ # Relationships
154
+ supersedes: string # ID of memory this replaces
155
+ superseded_by: string # ID of memory that replaced this
156
+ related_to: string[] # IDs of related memories
157
+ resolves: string[] # IDs of unresolved/debug this solved
158
+ resolved_by: string # ID of memory that resolved this
159
+ blocked_by: string # ID of blocking memory
160
+ blocks: string[] # IDs this memory blocks
161
+
162
+ # Vector & Timestamps
163
+ embedding: vector:384 # 384-dimensional vector
151
164
  created: timestamp # fsdb provides this
152
165
  updated: timestamp # fsdb provides this
153
-
154
- # Temporal (NEW)
155
- session_created: number # โœจ NEW - session number when created
156
- session_updated: number # โœจ NEW - session number when last updated
157
- last_surfaced: number # โœจ NEW - session number when last retrieved
158
- sessions_since_surfaced: number # โœจ NEW - counter for decay
159
-
160
- # Temporal Class & Decay (NEW)
161
- temporal_class: string # โœจ NEW - eternal | long_term | medium_term | short_term | ephemeral
162
- fade_rate: number # โœจ NEW - retrieval weight decay per session
163
- expires_after_sessions: number # โœจ NEW - for ephemeral only, null otherwise
164
-
165
- # Scope (NEW)
166
- scope: string # โœจ NEW - global | project
167
- project_id: string # existing
168
-
169
- # Categorization (MIXED)
170
- domain: string # โœจ NEW - embeddings, gpu, auth, family, values, etc.
171
- feature: string # โœจ NEW - specific feature within domain
172
- component: string # โœจ NEW - code component if applicable
173
- knowledge_domain: string # existing
174
-
175
- # Context (existing - from curator)
176
- context_type: string # existing - breakthrough, decision, technical, etc.
177
- emotional_resonance: string # existing
178
- trigger_phrases: string[] # existing
179
- question_types: string[] # existing
180
- semantic_tags: string[] # existing
181
-
182
- # Relationships (NEW)
183
- supersedes: string # โœจ NEW - ID of memory this replaces
184
- superseded_by: string # โœจ NEW - ID of memory that replaced this
185
- related_to: string[] # โœจ NEW - IDs of related memories
186
- resolves: string[] # โœจ NEW - IDs of unresolved/debug/todo this solved
187
- resolved_by: string # โœจ NEW - ID of solved memory that resolved this
188
- parent_id: string # โœจ NEW - for chains/sequences
189
- child_ids: string[] # โœจ NEW - children in chain
190
-
191
- # Lifecycle Triggers (NEW)
192
- awaiting_implementation: boolean # โœจ NEW - set true for planned features
193
- awaiting_decision: boolean # โœจ NEW - waiting on a decision
194
- blocked_by: string # โœจ NEW - ID of blocking memory
195
- blocks: string[] # โœจ NEW - IDs this memory blocks
196
- related_files: string[] # โœจ NEW - source files for technical memories
197
-
198
- # Retrieval Control (MIXED)
199
- retrieval_weight: number # โœจ NEW - current weight (affected by decay)
200
- exclude_from_retrieval: boolean # โœจ NEW - force exclusion
201
- action_required: boolean # existing
202
- problem_solution_pair: boolean # existing
203
-
204
- # Vector (existing)
205
- embedding: vector:384 # existing - 384-dimensional vector
166
+ schema_version: 3 # Current schema version
206
167
  ---
207
168
  ```
208
169
 
@@ -210,16 +171,16 @@ embedding: vector:384 # existing - 384-dimensional vector
210
171
 
211
172
  ## Relationship Trigger Matrix
212
173
 
213
- When the curator extracts a memory of type X, you must check existing memories of type Y:
174
+ When the curator extracts a memory of type X, check existing memories of type Y:
214
175
 
215
176
  | Extracted Type | Check Types | Filter By | Action |
216
177
  |----------------|-------------|-----------|--------|
217
178
  | ๐Ÿ’ก breakthrough | ๐Ÿ’ก breakthrough | `domain` | Chain, supersede, or link via `related_to` |
218
179
  | โš–๏ธ decision | โš–๏ธ decision | `domain`, `feature` | Supersede if reversal, link if evolution |
219
- | โœ… solved | โ“๐Ÿ›๐ŸŽฏโšก | `domain`, `feature`, or explicit `resolves` | Update status โ†’ `superseded`, set `resolved_by` |
220
- | ๐Ÿ”ง technical | ๐Ÿ”ง technical | `feature`, `related_files` | Check `awaiting_implementation`, update content |
180
+ | ๐Ÿ”ง technical | ๐Ÿ”งโ“ technical, unresolved | `feature`, `related_files` | Check `awaiting_implementation`, resolve open items |
181
+ | ๐Ÿ› debug | ๐Ÿ›โ“ debug, unresolved | `domain`, `feature` | Supersede old debug if fixed, resolve open items |
221
182
  | ๐Ÿ—๏ธ architecture | ๐Ÿ—๏ธ architecture | `domain` | Supersede old architecture if changed |
222
- | ๐Ÿ† milestone | ๐ŸŽฏโšก๐Ÿ“ฆ | `project_id` | Bulk close todos, impls related to milestone |
183
+ | ๐Ÿ† milestone | โ“ unresolved | `project_id` | Bulk close unresolved items related to milestone |
223
184
  | ๐Ÿ“ state | ๐Ÿ“ state | `domain`, `project_id` | Always supersede old state (only latest matters) |
224
185
  | ๐Ÿ’œ personal | ๐Ÿ’œ personal | `domain` (e.g., "family") | Update if fact changed (kid's age, etc.) |
225
186
 
@@ -247,6 +208,14 @@ Use these for fast-path filtering before semantic search:
247
208
 
248
209
  ```yaml
249
210
  type_keywords:
211
+ technical:
212
+ - implement
213
+ - code
214
+ - function
215
+ - API
216
+ - pattern
217
+ - module
218
+
250
219
  debug:
251
220
  - bug
252
221
  - error
@@ -257,15 +226,13 @@ type_keywords:
257
226
  - exception
258
227
  - stack trace
259
228
 
260
- unresolved:
261
- - issue
262
- - problem
263
- - stuck
264
- - blocked
265
- - help
266
- - question
267
- - unsure
268
- - unclear
229
+ architecture:
230
+ - structure
231
+ - design
232
+ - pattern
233
+ - approach
234
+ - system
235
+ - layer
269
236
 
270
237
  decision:
271
238
  - decide
@@ -276,13 +243,34 @@ type_keywords:
276
243
  - alternative
277
244
  - tradeoff
278
245
 
279
- architecture:
280
- - structure
281
- - design
282
- - pattern
283
- - approach
284
- - system
285
- - layer
246
+ personal:
247
+ - family
248
+ - children
249
+ - friend
250
+ - relationship
251
+ - feel
252
+ - appreciate
253
+
254
+ philosophy:
255
+ - believe
256
+ - value
257
+ - principle
258
+ - why we
259
+ - matters
260
+
261
+ workflow:
262
+ - process
263
+ - how we
264
+ - habit
265
+ - routine
266
+ - practice
267
+
268
+ milestone:
269
+ - shipped
270
+ - completed
271
+ - released
272
+ - finished
273
+ - achieved
286
274
 
287
275
  breakthrough:
288
276
  - discovered
@@ -293,22 +281,23 @@ type_keywords:
293
281
  - finally
294
282
  - key insight
295
283
 
296
- todo:
297
- - need to
298
- - should
299
- - must
300
- - will
301
- - later
302
- - next
284
+ unresolved:
285
+ - issue
286
+ - problem
287
+ - stuck
288
+ - blocked
289
+ - help
290
+ - question
291
+ - unsure
292
+ - unclear
303
293
  - todo
304
294
 
305
- personal:
306
- - family
307
- - children
308
- - friend
309
- - relationship
310
- - feel
311
- - appreciate
295
+ state:
296
+ - current
297
+ - status
298
+ - now
299
+ - today
300
+ - this session
312
301
  ```
313
302
 
314
303
  When session summary or new memories contain these keywords, boost search within that type.