@prmichaelsen/remember-mcp 2.6.8 → 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,26 @@ 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
|
+
|
|
8
28
|
## [2.6.8] - 2026-02-17
|
|
9
29
|
|
|
10
30
|
### 🐛 Fixed
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# Task 67: Migrate Memory_public Collection Schema
|
|
2
|
+
|
|
3
|
+
**Milestone**: M12 (Comment System)
|
|
4
|
+
**Estimated Time**: 1 hour
|
|
5
|
+
**Dependencies**: Task 55, Task 66
|
|
6
|
+
**Status**: Not Started
|
|
7
|
+
**Priority**: High
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Objective
|
|
12
|
+
|
|
13
|
+
Update the existing `Memory_public` collection in Weaviate Cloud to include the missing comment fields (`parent_id` and `thread_root_id`). Currently, only `moderation_flags` exists in the production schema.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Problem
|
|
18
|
+
|
|
19
|
+
The `Memory_public` collection was created before comment fields were added to the schema. Weaviate doesn't support adding properties to existing collections, so we need to migrate the data.
|
|
20
|
+
|
|
21
|
+
**Current State** (Production):
|
|
22
|
+
- ✅ `moderation_flags` field exists
|
|
23
|
+
- ❌ `parent_id` field missing
|
|
24
|
+
- ❌ `thread_root_id` field missing
|
|
25
|
+
|
|
26
|
+
**Expected State** (Code):
|
|
27
|
+
- ✅ All three fields defined in `src/weaviate/space-schema.ts` (lines 261-275)
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Impact
|
|
32
|
+
|
|
33
|
+
**Without Migration**:
|
|
34
|
+
- Cannot create comments in shared spaces
|
|
35
|
+
- Cannot thread discussions
|
|
36
|
+
- Published memories missing comment fields
|
|
37
|
+
- Schema mismatch between code and production
|
|
38
|
+
|
|
39
|
+
**With Migration**:
|
|
40
|
+
- Full comment system functionality in shared spaces
|
|
41
|
+
- Threaded discussions work correctly
|
|
42
|
+
- Schema matches code definition
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Migration Options
|
|
47
|
+
|
|
48
|
+
### Option 1: Delete and Recreate (DESTRUCTIVE)
|
|
49
|
+
|
|
50
|
+
**Steps**:
|
|
51
|
+
1. Backup all data from `Memory_public`
|
|
52
|
+
2. Delete `Memory_public` collection
|
|
53
|
+
3. Recreate with updated schema (automatic via `ensurePublicCollection`)
|
|
54
|
+
4. Restore data with new fields initialized
|
|
55
|
+
|
|
56
|
+
**Pros**:
|
|
57
|
+
- Clean schema
|
|
58
|
+
- Simple process
|
|
59
|
+
|
|
60
|
+
**Cons**:
|
|
61
|
+
- ⚠️ **LOSES ALL DATA** if backup fails
|
|
62
|
+
- Downtime during migration
|
|
63
|
+
- Risky for production
|
|
64
|
+
|
|
65
|
+
### Option 2: Create New Collection and Migrate (SAFE)
|
|
66
|
+
|
|
67
|
+
**Steps**:
|
|
68
|
+
1. Create `Memory_public_v2` with updated schema
|
|
69
|
+
2. Copy all data from `Memory_public` to `Memory_public_v2`
|
|
70
|
+
3. Initialize comment fields: `parent_id: null`, `thread_root_id: null`, `moderation_flags: []`
|
|
71
|
+
4. Test `Memory_public_v2` thoroughly
|
|
72
|
+
5. Update code to use `Memory_public_v2`
|
|
73
|
+
6. Delete old `Memory_public` after verification
|
|
74
|
+
|
|
75
|
+
**Pros**:
|
|
76
|
+
- ✅ Zero data loss
|
|
77
|
+
- ✅ Can rollback if issues
|
|
78
|
+
- ✅ Test before switching
|
|
79
|
+
|
|
80
|
+
**Cons**:
|
|
81
|
+
- More complex
|
|
82
|
+
- Temporary storage duplication
|
|
83
|
+
|
|
84
|
+
### Option 3: Live with Current Schema (NOT RECOMMENDED)
|
|
85
|
+
|
|
86
|
+
**Steps**:
|
|
87
|
+
- Do nothing
|
|
88
|
+
- Comment system only works for personal memories
|
|
89
|
+
- Shared spaces don't support comments
|
|
90
|
+
|
|
91
|
+
**Pros**:
|
|
92
|
+
- No migration needed
|
|
93
|
+
|
|
94
|
+
**Cons**:
|
|
95
|
+
- ❌ Incomplete feature
|
|
96
|
+
- ❌ Schema mismatch
|
|
97
|
+
- ❌ Technical debt
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## Recommended Approach: Option 2 (Safe Migration)
|
|
102
|
+
|
|
103
|
+
### Step 1: Create Backup Collection
|
|
104
|
+
|
|
105
|
+
```typescript
|
|
106
|
+
// Create Memory_public_v2 with full schema
|
|
107
|
+
const client = getWeaviateClient();
|
|
108
|
+
await client.collections.create({
|
|
109
|
+
name: 'Memory_public_v2',
|
|
110
|
+
// ... full schema from space-schema.ts including comment fields
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Step 2: Migrate Data
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// Fetch all objects from Memory_public
|
|
118
|
+
const oldCollection = client.collections.get('Memory_public');
|
|
119
|
+
const objects = await oldCollection.query.fetchObjects({ limit: 10000 });
|
|
120
|
+
|
|
121
|
+
// Insert into Memory_public_v2 with comment fields
|
|
122
|
+
const newCollection = client.collections.get('Memory_public_v2');
|
|
123
|
+
for (const obj of objects.objects) {
|
|
124
|
+
await newCollection.data.insert({
|
|
125
|
+
...obj.properties,
|
|
126
|
+
parent_id: null, // Initialize to null
|
|
127
|
+
thread_root_id: null, // Initialize to null
|
|
128
|
+
moderation_flags: obj.properties.moderation_flags || [], // Preserve existing
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Step 3: Update Code
|
|
134
|
+
|
|
135
|
+
```typescript
|
|
136
|
+
// src/weaviate/space-schema.ts
|
|
137
|
+
export const PUBLIC_COLLECTION_NAME = 'Memory_public_v2'; // Changed from 'Memory_public'
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### Step 4: Verify and Cleanup
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Test the new collection
|
|
144
|
+
# Verify all data migrated correctly
|
|
145
|
+
# Check comment fields exist
|
|
146
|
+
|
|
147
|
+
# After verification (wait 24-48 hours):
|
|
148
|
+
# Delete old Memory_public collection
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Verification
|
|
154
|
+
|
|
155
|
+
- [ ] `Memory_public_v2` collection created with full schema
|
|
156
|
+
- [ ] All data migrated from `Memory_public`
|
|
157
|
+
- [ ] Comment fields present: `parent_id`, `thread_root_id`, `moderation_flags`
|
|
158
|
+
- [ ] All existing memories have `parent_id: null`, `thread_root_id: null`
|
|
159
|
+
- [ ] `moderation_flags` preserved from original data
|
|
160
|
+
- [ ] Code updated to use `Memory_public_v2`
|
|
161
|
+
- [ ] All tests passing
|
|
162
|
+
- [ ] Can create comments in shared spaces
|
|
163
|
+
- [ ] Can publish memories with comment fields
|
|
164
|
+
- [ ] Old `Memory_public` collection deleted (after verification period)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Rollback Plan
|
|
169
|
+
|
|
170
|
+
If issues occur:
|
|
171
|
+
|
|
172
|
+
1. **Immediate Rollback**:
|
|
173
|
+
```typescript
|
|
174
|
+
export const PUBLIC_COLLECTION_NAME = 'Memory_public'; // Revert to old
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
2. **Keep Both Collections**:
|
|
178
|
+
- Old collection still exists
|
|
179
|
+
- Can switch back instantly
|
|
180
|
+
- No data loss
|
|
181
|
+
|
|
182
|
+
3. **After Verification**:
|
|
183
|
+
- Only delete old collection after 24-48 hours
|
|
184
|
+
- Ensure new collection works correctly
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Alternative: Manual Schema Update (If Supported)
|
|
189
|
+
|
|
190
|
+
**Note**: Weaviate typically doesn't support adding properties to existing collections. Check Weaviate documentation for your version to see if schema evolution is supported.
|
|
191
|
+
|
|
192
|
+
If supported:
|
|
193
|
+
```bash
|
|
194
|
+
# Use Weaviate API to add properties
|
|
195
|
+
# This is version-dependent and may not be available
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Production Checklist
|
|
201
|
+
|
|
202
|
+
- [ ] Backup current `Memory_public` data
|
|
203
|
+
- [ ] Create `Memory_public_v2` with full schema
|
|
204
|
+
- [ ] Migrate all data with comment fields initialized
|
|
205
|
+
- [ ] Test new collection thoroughly
|
|
206
|
+
- [ ] Update `PUBLIC_COLLECTION_NAME` constant
|
|
207
|
+
- [ ] Deploy updated code
|
|
208
|
+
- [ ] Verify in production
|
|
209
|
+
- [ ] Monitor for 24-48 hours
|
|
210
|
+
- [ ] Delete old `Memory_public` collection
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Notes
|
|
215
|
+
|
|
216
|
+
- This migration is required for comment system to work in shared spaces
|
|
217
|
+
- Personal memory collections (`Memory_{user_id}`) don't need migration if created after Task 55
|
|
218
|
+
- Old personal collections may also need migration (separate task)
|
|
219
|
+
- Consider running migration during low-traffic period
|
|
220
|
+
- Document migration in CHANGELOG.md
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
**Status**: Not Started
|
|
225
|
+
**Recommendation**: Execute Option 2 (safe migration) during next deployment window
|
|
226
|
+
**Priority**: High - Blocks comment system in shared spaces
|
package/dist/server-factory.js
CHANGED
|
@@ -1940,7 +1940,7 @@ async function handleUpdateMemory(args, userId) {
|
|
|
1940
1940
|
let existingMemory;
|
|
1941
1941
|
try {
|
|
1942
1942
|
existingMemory = await collection.query.fetchObjectById(args.memory_id, {
|
|
1943
|
-
returnProperties: ["user_id", "doc_type", "version"
|
|
1943
|
+
returnProperties: ["user_id", "doc_type", "version"]
|
|
1944
1944
|
});
|
|
1945
1945
|
} catch (fetchError) {
|
|
1946
1946
|
const fetchErrorMsg = fetchError instanceof Error ? fetchError.message : String(fetchError);
|
package/dist/server.js
CHANGED
|
@@ -2008,7 +2008,7 @@ async function handleUpdateMemory(args, userId) {
|
|
|
2008
2008
|
let existingMemory;
|
|
2009
2009
|
try {
|
|
2010
2010
|
existingMemory = await collection.query.fetchObjectById(args.memory_id, {
|
|
2011
|
-
returnProperties: ["user_id", "doc_type", "version"
|
|
2011
|
+
returnProperties: ["user_id", "doc_type", "version"]
|
|
2012
2012
|
});
|
|
2013
2013
|
} catch (fetchError) {
|
|
2014
2014
|
const fetchErrorMsg = fetchError instanceof Error ? fetchError.message : String(fetchError);
|
package/package.json
CHANGED
|
@@ -131,10 +131,12 @@ export async function handleUpdateMemory(
|
|
|
131
131
|
const collection = getMemoryCollection(userId);
|
|
132
132
|
|
|
133
133
|
// Get existing memory to verify ownership and get current version
|
|
134
|
+
// Only fetch minimal properties needed for validation - don't query optional properties
|
|
135
|
+
// that may not exist on all records (causes Weaviate gRPC errors)
|
|
134
136
|
let existingMemory;
|
|
135
137
|
try {
|
|
136
138
|
existingMemory = await collection.query.fetchObjectById(args.memory_id, {
|
|
137
|
-
returnProperties: ['user_id', 'doc_type', 'version'
|
|
139
|
+
returnProperties: ['user_id', 'doc_type', 'version'],
|
|
138
140
|
});
|
|
139
141
|
} catch (fetchError) {
|
|
140
142
|
const fetchErrorMsg = fetchError instanceof Error ? fetchError.message : String(fetchError);
|