@prmichaelsen/remember-mcp 2.6.7 → 2.6.9

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/CHANGELOG.md CHANGED
@@ -5,6 +5,61 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.6.9] - 2026-02-17
9
+
10
+ ### Fixed
11
+
12
+ - **`remember_update_memory` Query Issue**: Fixed "Memory not found" error for existing memories
13
+ - Reduced property query from 6 properties to only 3 essential properties (`user_id`, `doc_type`, `version`)
14
+ - Removed queries for optional properties (`type`, `weight`, `base_weight`) that may not exist on all records
15
+ - Weaviate gRPC fails when querying properties that exist in schema but not on specific records
16
+ - Only fetch properties actually needed for validation (ownership, doc type, version)
17
+ - Fixes issue where memories with missing optional properties were reported as "not found"
18
+
19
+ ### Added
20
+
21
+ - **Task 67: Migrate Memory_public Schema**
22
+ - Created migration plan documentation for updating production `Memory_public` collection
23
+ - Addresses schema mismatch: only `moderation_flags` present, missing `parent_id` and `thread_root_id`
24
+ - Documents safe migration approach using `Memory_public_v2` with zero data loss
25
+
26
+ ---
27
+
28
+ ## [2.6.8] - 2026-02-17
29
+
30
+ ### 🐛 Fixed
31
+
32
+ - **Critical Build Error**: Added missing `poetry` content type metadata to `src/constants/content-types.ts`
33
+ - Fixed TypeScript compilation error: "Property 'poetry' is missing in type Record<ContentType, ContentTypeMetadata>"
34
+ - Added poetry definition with category, description, examples, and common fields
35
+ - Updated `CONTENT_TYPE_CATEGORIES` to include poetry in creative category
36
+ - Build now successful
37
+
38
+ ### ✨ Added
39
+
40
+ - **Task 66: Comment Field Initialization in Tools**
41
+ - Updated `remember_create_memory` tool to initialize comment fields
42
+ - Added `parent_id`, `thread_root_id`, `moderation_flags` to `CreateMemoryArgs` interface
43
+ - New memories created with `parent_id: null`, `thread_root_id: null`, `moderation_flags: []`
44
+ - Updated `remember_update_memory` tool to support comment field updates
45
+ - Added comment fields to tool schema and `UpdateMemoryArgs` interface
46
+ - Can now update `parent_id`, `thread_root_id`, and `moderation_flags`
47
+ - Space memory tools automatically include comment fields via spread operator
48
+ - Created task documentation: `agent/tasks/task-66-initialize-comment-fields-in-tools.md`
49
+
50
+ ### 📝 Changed
51
+
52
+ - Updated `agent/progress.yaml` with Task 66 completion and build fix details
53
+ - All new memories now have consistent schema with comment fields initialized
54
+
55
+ ### 🎯 Impact
56
+
57
+ - **Schema Consistency**: All new memories have comment fields, matching migrated old memories
58
+ - **Comment System Ready**: Can create comments, nested comments, and manage moderation flags
59
+ - **Build Stability**: TypeScript compiles without errors, all 81 tests passing
60
+
61
+ ---
62
+
8
63
  ## [2.6.6] - 2026-02-16
9
64
 
10
65
  ### 🔧 Improved
@@ -523,6 +523,42 @@ progress:
523
523
  overall: 50%
524
524
 
525
525
  recent_work:
526
+ - date: 2026-02-17
527
+ description: Fixed Build Error & Completed Task 66 - Comment Field Initialization
528
+ items:
529
+ - ✅ Fixed critical TypeScript build error in content-types.ts
530
+ - ✅ Added missing 'poetry' content type metadata
531
+ - ✅ Build now successful - TypeScript compiles without errors
532
+ - ✅ Task 66 COMPLETED: Initialize comment fields in create/update tools
533
+ - ✅ Updated remember_create_memory tool schema with comment fields
534
+ - ✅ Updated CreateMemoryArgs interface with parent_id, thread_root_id, moderation_flags
535
+ - ✅ Initialized comment fields to defaults in handleCreateMemory (null, null, [])
536
+ - ✅ Updated remember_update_memory tool schema with comment fields
537
+ - ✅ Updated UpdateMemoryArgs interface with comment fields
538
+ - ✅ Added comment field update logic in handleUpdateMemory
539
+ - ✅ All 81 tests passing (1 skipped integration test)
540
+ - ✅ Test coverage: 33.12% overall
541
+ - ✅ New memories now created with comment fields initialized
542
+ - ✅ Can create comments with parent_id and thread_root_id set
543
+ - ✅ Can update comment fields via remember_update_memory
544
+ - 📋 Ready for M12 completion: Tasks 58-59 remaining
545
+
546
+ - date: 2026-02-17
547
+ description: ACP Initialization Complete - Project Context Loaded
548
+ items:
549
+ - ✅ ACP initialization workflow executed via @acp.init command
550
+ - ⚠️ ACP updates available (v1.4.3 with improved script color output)
551
+ - ✅ All agent documentation reviewed (23 design docs, 11 milestones, 66 tasks, 5 patterns)
552
+ - ✅ Project status verified: M1-M4, M10-M11 complete (100%), M12 in progress (60%)
553
+ - ✅ Version 2.6.7 confirmed (latest release)
554
+ - ✅ 53 unit tests passing (1 skipped integration test)
555
+ - ⚠️ TypeScript compilation error: Missing 'poetry' in content-types.ts
556
+ - ✅ All 17 MCP tools implemented and working
557
+ - ✅ M12 Comment System: 3/5 tasks complete (schema, search, query updates)
558
+ - 📋 Remaining M12 tasks: Task 58 (unit tests), Task 59 (documentation)
559
+ - 📋 Build blocked by TypeScript error in content-types.ts
560
+ - 📋 Need to fix 'poetry' content type metadata
561
+
526
562
  - date: 2026-02-16
527
563
  description: Comment System, Structured Logging, and Safety Guidelines (v2.6.0-v2.6.2)
528
564
  items:
@@ -0,0 +1,431 @@
1
+ # Task 65: Migrate Old Memories to Include New Schema Fields
2
+
3
+ **Milestone**: M12 (Schema Migration)
4
+ **Estimated Time**: 3 hours
5
+ **Dependencies**: Task 63 (fetchMemoryWithAllProperties utility)
6
+ **Status**: Not Started
7
+ **Priority**: CRITICAL 🚨
8
+
9
+ ---
10
+
11
+ ## Objective
12
+
13
+ Migrate all existing memories in user collections to include new schema fields added in v2.6.0 (comment fields) and ensure schema uniformity. This prevents fetch failures when requesting properties that don't exist on old memory objects.
14
+
15
+ ---
16
+
17
+ ## Context
18
+
19
+ **Problem**:
20
+ Old memories created before v2.6.0 don't have the new comment fields:
21
+ - `parent_id` (added in v2.6.0)
22
+ - `thread_root_id` (added in v2.6.0)
23
+ - `moderation_flags` (added in v2.6.0)
24
+
25
+ When `fetchMemoryWithAllProperties()` tries to fetch these properties from old memories, Weaviate fails because the properties don't exist on those objects.
26
+
27
+ **Impact**:
28
+ - ❌ Cannot publish old memories (fetch fails)
29
+ - ❌ Cannot update old memories
30
+ - ❌ Cannot search old memories with new property filters
31
+ - ❌ Schema inconsistency across memory objects
32
+
33
+ **Root Cause**:
34
+ Weaviate doesn't automatically backfill new schema properties on existing objects. When you add a new property to the schema, existing objects don't get that property until they're updated.
35
+
36
+ ---
37
+
38
+ ## Steps
39
+
40
+ ### 1. Create Migration Script
41
+
42
+ Create a migration script in `/home/prmichaelsen/scripts/`:
43
+
44
+ ```bash
45
+ #!/bin/bash
46
+ # migrate-memory-schema.sh
47
+ # Migrates old memories to include new schema fields
48
+
49
+ set -e
50
+
51
+ echo "🔄 Starting memory schema migration..."
52
+ echo "This will add missing fields to all memories in all user collections"
53
+ echo ""
54
+
55
+ # Run the TypeScript migration script
56
+ cd /home/prmichaelsen/remember-mcp
57
+ npx tsx scripts/migrate-schema.ts
58
+
59
+ echo ""
60
+ echo "✅ Migration complete!"
61
+ ```
62
+
63
+ ### 2. Create TypeScript Migration Script
64
+
65
+ Create `scripts/migrate-schema.ts`:
66
+
67
+ ```typescript
68
+ /**
69
+ * Schema Migration Script
70
+ *
71
+ * Adds missing fields to all existing memories:
72
+ * - parent_id: null (for non-comment memories)
73
+ * - thread_root_id: null (for non-comment memories)
74
+ * - moderation_flags: [] (empty array)
75
+ */
76
+
77
+ import { initWeaviateClient, getWeaviateClient } from '../src/weaviate/client.js';
78
+ import { config } from '../src/config.js';
79
+
80
+ interface MigrationStats {
81
+ collectionsProcessed: number;
82
+ memoriesUpdated: number;
83
+ memoriesSkipped: number;
84
+ errors: number;
85
+ }
86
+
87
+ async function migrateCollection(collectionName: string): Promise<{ updated: number; skipped: number; errors: number }> {
88
+ console.log(`\n📦 Processing collection: ${collectionName}`);
89
+
90
+ const client = getWeaviateClient();
91
+ const collection = client.collections.get(collectionName);
92
+
93
+ let updated = 0;
94
+ let skipped = 0;
95
+ let errors = 0;
96
+
97
+ try {
98
+ // Fetch all objects in batches
99
+ let offset = 0;
100
+ const batchSize = 100;
101
+ let hasMore = true;
102
+
103
+ while (hasMore) {
104
+ console.log(` Fetching batch at offset ${offset}...`);
105
+
106
+ const results = await collection.query.fetchObjects({
107
+ limit: batchSize,
108
+ offset,
109
+ });
110
+
111
+ if (!results.objects || results.objects.length === 0) {
112
+ hasMore = false;
113
+ break;
114
+ }
115
+
116
+ console.log(` Processing ${results.objects.length} memories...`);
117
+
118
+ for (const obj of results.objects) {
119
+ try {
120
+ const props = obj.properties;
121
+
122
+ // Check if migration needed
123
+ const needsMigration =
124
+ props.parent_id === undefined ||
125
+ props.thread_root_id === undefined ||
126
+ props.moderation_flags === undefined;
127
+
128
+ if (!needsMigration) {
129
+ skipped++;
130
+ continue;
131
+ }
132
+
133
+ // Update with missing fields
134
+ await collection.data.update({
135
+ id: obj.uuid,
136
+ properties: {
137
+ parent_id: props.parent_id ?? null,
138
+ thread_root_id: props.thread_root_id ?? null,
139
+ moderation_flags: props.moderation_flags ?? [],
140
+ },
141
+ });
142
+
143
+ updated++;
144
+
145
+ if (updated % 10 === 0) {
146
+ console.log(` ✅ Updated ${updated} memories...`);
147
+ }
148
+ } catch (error) {
149
+ errors++;
150
+ console.error(` ❌ Error updating ${obj.uuid}:`, error);
151
+ }
152
+ }
153
+
154
+ offset += batchSize;
155
+ }
156
+ } catch (error) {
157
+ console.error(` ❌ Error processing collection:`, error);
158
+ errors++;
159
+ }
160
+
161
+ return { updated, skipped, errors };
162
+ }
163
+
164
+ async function main() {
165
+ console.log('🚀 Memory Schema Migration');
166
+ console.log('==========================\n');
167
+
168
+ // Initialize Weaviate
169
+ await initWeaviateClient();
170
+ const client = getWeaviateClient();
171
+
172
+ // Get all collections
173
+ const collections = await client.collections.listAll();
174
+
175
+ // Filter to Memory_ collections only
176
+ const memoryCollections = collections
177
+ .map(c => c.name)
178
+ .filter(name => name.startsWith('Memory_') && name !== 'Memory_public');
179
+
180
+ console.log(`Found ${memoryCollections.length} user memory collections\n`);
181
+
182
+ const stats: MigrationStats = {
183
+ collectionsProcessed: 0,
184
+ memoriesUpdated: 0,
185
+ memoriesSkipped: 0,
186
+ errors: 0,
187
+ };
188
+
189
+ // Migrate each collection
190
+ for (const collectionName of memoryCollections) {
191
+ const result = await migrateCollection(collectionName);
192
+ stats.collectionsProcessed++;
193
+ stats.memoriesUpdated += result.updated;
194
+ stats.memoriesSkipped += result.skipped;
195
+ stats.errors += result.errors;
196
+ }
197
+
198
+ // Also migrate Memory_public if it exists
199
+ const publicExists = await client.collections.exists('Memory_public');
200
+ if (publicExists) {
201
+ console.log('\n📦 Processing Memory_public collection...');
202
+ const result = await migrateCollection('Memory_public');
203
+ stats.collectionsProcessed++;
204
+ stats.memoriesUpdated += result.updated;
205
+ stats.memoriesSkipped += result.skipped;
206
+ stats.errors += result.errors;
207
+ }
208
+
209
+ // Print summary
210
+ console.log('\n\n📊 Migration Summary');
211
+ console.log('===================');
212
+ console.log(`Collections processed: ${stats.collectionsProcessed}`);
213
+ console.log(`Memories updated: ${stats.memoriesUpdated}`);
214
+ console.log(`Memories skipped (already migrated): ${stats.memoriesSkipped}`);
215
+ console.log(`Errors: ${stats.errors}`);
216
+
217
+ if (stats.errors > 0) {
218
+ console.log('\n⚠️ Some errors occurred. Check logs above.');
219
+ process.exit(1);
220
+ } else {
221
+ console.log('\n✅ Migration completed successfully!');
222
+ process.exit(0);
223
+ }
224
+ }
225
+
226
+ main().catch(error => {
227
+ console.error('💥 Migration failed:', error);
228
+ process.exit(1);
229
+ });
230
+ ```
231
+
232
+ ### 3. Make Script Executable
233
+
234
+ ```bash
235
+ chmod +x /home/prmichaelsen/scripts/migrate-memory-schema.sh
236
+ ```
237
+
238
+ ### 4. Run Migration
239
+
240
+ ```bash
241
+ # Dry run first (optional - add --dry-run flag to script)
242
+ /home/prmichaelsen/scripts/migrate-memory-schema.sh
243
+
244
+ # Or run directly with tsx
245
+ cd /home/prmichaelsen/remember-mcp
246
+ npx tsx scripts/migrate-schema.ts
247
+ ```
248
+
249
+ ### 5. Verify Migration
250
+
251
+ Check that old memories now have the new fields:
252
+
253
+ ```typescript
254
+ // Test with an old memory ID
255
+ remember_search_memory({
256
+ query: "",
257
+ limit: 1
258
+ })
259
+
260
+ // Verify returned memory has:
261
+ // - parent_id: null
262
+ // - thread_root_id: null
263
+ // - moderation_flags: []
264
+ ```
265
+
266
+ ### 6. Test Publish After Migration
267
+
268
+ ```bash
269
+ # Try publishing an old memory
270
+ remember_publish({
271
+ memory_id: "84edf86d-579d-4cb3-8b5f-2e19462d8c68",
272
+ spaces: ["the_void"]
273
+ })
274
+
275
+ # Should succeed now
276
+ ```
277
+
278
+ ---
279
+
280
+ ## Verification
281
+
282
+ - [ ] Migration script created in `/home/prmichaelsen/scripts/`
283
+ - [ ] TypeScript migration script created in `scripts/migrate-schema.ts`
284
+ - [ ] Script is executable
285
+ - [ ] Dry run completed successfully (optional)
286
+ - [ ] Migration executed on all user collections
287
+ - [ ] Migration executed on Memory_public collection
288
+ - [ ] All old memories have `parent_id: null`
289
+ - [ ] All old memories have `thread_root_id: null`
290
+ - [ ] All old memories have `moderation_flags: []`
291
+ - [ ] Can fetch old memories with `fetchMemoryWithAllProperties()`
292
+ - [ ] Can publish old memories successfully
293
+ - [ ] No errors in migration logs
294
+
295
+ ---
296
+
297
+ ## Expected Output
298
+
299
+ **Before Migration**:
300
+ ```json
301
+ {
302
+ "id": "84edf86d-579d-4cb3-8b5f-2e19462d8c68",
303
+ "properties": {
304
+ "title": "Cat grad school",
305
+ "content": "...",
306
+ "type": "note",
307
+ // ❌ No parent_id
308
+ // ❌ No thread_root_id
309
+ // ❌ No moderation_flags
310
+ }
311
+ }
312
+ ```
313
+
314
+ **After Migration**:
315
+ ```json
316
+ {
317
+ "id": "84edf86d-579d-4cb3-8b5f-2e19462d8c68",
318
+ "properties": {
319
+ "title": "Cat grad school",
320
+ "content": "...",
321
+ "type": "note",
322
+ "parent_id": null, // ✅ Added
323
+ "thread_root_id": null, // ✅ Added
324
+ "moderation_flags": [] // ✅ Added
325
+ }
326
+ }
327
+ ```
328
+
329
+ ---
330
+
331
+ ## Migration Statistics Example
332
+
333
+ ```
334
+ 📊 Migration Summary
335
+ ===================
336
+ Collections processed: 5
337
+ Memories updated: 247
338
+ Memories skipped (already migrated): 0
339
+ Errors: 0
340
+
341
+ ✅ Migration completed successfully!
342
+ ```
343
+
344
+ ---
345
+
346
+ ## Common Issues and Solutions
347
+
348
+ ### Issue 1: Permission denied
349
+
350
+ **Cause**: Script not executable
351
+ **Solution**: `chmod +x /home/prmichaelsen/scripts/migrate-memory-schema.sh`
352
+
353
+ ### Issue 2: Weaviate connection failed
354
+
355
+ **Cause**: Environment variables not set
356
+ **Solution**: Ensure `.env` file has WEAVIATE_URL and WEAVIATE_API_KEY
357
+
358
+ ### Issue 3: Some memories fail to update
359
+
360
+ **Cause**: Individual object update errors
361
+ **Solution**: Check error logs, may need to manually fix specific memories
362
+
363
+ ### Issue 4: Migration takes too long
364
+
365
+ **Cause**: Large number of memories
366
+ **Solution**: Run in batches, add progress indicators
367
+
368
+ ---
369
+
370
+ ## Safety Considerations
371
+
372
+ **Backup**:
373
+ - Weaviate doesn't have built-in backup for individual collections
374
+ - Consider exporting memories before migration
375
+ - Migration is additive (only adds fields, doesn't remove)
376
+
377
+ **Rollback**:
378
+ - If migration fails, new fields will be null/empty
379
+ - Can re-run migration safely (idempotent)
380
+ - No data loss risk (only adding fields)
381
+
382
+ **Testing**:
383
+ - Test on a single collection first
384
+ - Verify results before migrating all collections
385
+ - Check Memory_public separately
386
+
387
+ ---
388
+
389
+ ## Resources
390
+
391
+ - [Weaviate Update Objects](https://weaviate.io/developers/weaviate/manage-data/update)
392
+ - [Weaviate Batch Operations](https://weaviate.io/developers/weaviate/manage-data/import)
393
+ - [Schema Evolution Best Practices](https://weaviate.io/developers/weaviate/config-refs/schema)
394
+
395
+ ---
396
+
397
+ ## Notes
398
+
399
+ - This migration is **required** for v2.6.3+ to work with old memories
400
+ - Migration is idempotent (safe to run multiple times)
401
+ - Only updates memories that need migration (checks first)
402
+ - Processes in batches to avoid memory issues
403
+ - Logs progress for monitoring
404
+ - Can be run on production without downtime
405
+ - Consider scheduling during low-traffic period
406
+ - Estimated time: ~1-5 minutes per 1000 memories
407
+
408
+ ---
409
+
410
+ ## Alternative Approaches
411
+
412
+ ### Option 1: Lazy Migration (NOT RECOMMENDED)
413
+ - Update memories on-demand when accessed
414
+ - Pros: No bulk migration needed
415
+ - Cons: Unpredictable failures, poor UX
416
+
417
+ ### Option 2: Schema-Optional Fetch (NOT RECOMMENDED)
418
+ - Make fetchMemoryWithAllProperties handle missing properties
419
+ - Pros: No migration needed
420
+ - Cons: Inconsistent data, complex error handling
421
+
422
+ ### Option 3: Bulk Migration (RECOMMENDED)
423
+ - Run migration script once to update all memories
424
+ - Pros: Clean, predictable, one-time operation
425
+ - Cons: Requires downtime or careful execution
426
+
427
+ ---
428
+
429
+ **Status**: Not Started
430
+ **Recommendation**: Run migration immediately to unblock publish functionality
431
+ **Priority**: CRITICAL - Blocks core functionality for users with old memories