@prmichaelsen/remember-mcp 2.8.0 → 3.12.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/AGENT.md +296 -250
- package/CHANGELOG.md +468 -0
- package/README.md +163 -46
- package/agent/commands/acp.clarification-create.md +382 -0
- package/agent/commands/acp.command-create.md +0 -1
- package/agent/commands/acp.design-create.md +0 -1
- package/agent/commands/acp.init.md +0 -1
- package/agent/commands/acp.package-create.md +0 -1
- package/agent/commands/acp.package-info.md +0 -1
- package/agent/commands/acp.package-install.md +0 -1
- package/agent/commands/acp.package-list.md +0 -1
- package/agent/commands/acp.package-publish.md +0 -1
- package/agent/commands/acp.package-remove.md +0 -1
- package/agent/commands/acp.package-search.md +0 -1
- package/agent/commands/acp.package-update.md +0 -1
- package/agent/commands/acp.package-validate.md +0 -1
- package/agent/commands/acp.pattern-create.md +0 -1
- package/agent/commands/acp.plan.md +0 -1
- package/agent/commands/acp.proceed.md +0 -1
- package/agent/commands/acp.project-create.md +0 -1
- package/agent/commands/acp.project-info.md +309 -0
- package/agent/commands/acp.project-list.md +0 -1
- package/agent/commands/acp.project-remove.md +379 -0
- package/agent/commands/acp.project-set.md +0 -1
- package/agent/commands/acp.project-update.md +296 -0
- package/agent/commands/acp.report.md +0 -1
- package/agent/commands/acp.resume.md +0 -1
- package/agent/commands/acp.status.md +0 -1
- package/agent/commands/acp.sync.md +0 -1
- package/agent/commands/acp.task-create.md +17 -10
- package/agent/commands/acp.update.md +0 -1
- package/agent/commands/acp.validate.md +0 -1
- package/agent/commands/acp.version-check-for-updates.md +0 -1
- package/agent/commands/acp.version-check.md +0 -1
- package/agent/commands/acp.version-update.md +0 -1
- package/agent/commands/command.template.md +0 -5
- package/agent/commands/git.commit.md +13 -2
- package/agent/commands/git.init.md +0 -1
- package/agent/design/comment-memory-type.md +2 -2
- package/agent/design/local.collaborative-memory-sync.md +265 -0
- package/agent/design/local.content-flags.md +210 -0
- package/agent/design/local.ghost-persona-system.md +273 -0
- package/agent/design/local.group-acl-integration.md +338 -0
- package/agent/design/local.memory-acl-schema.md +352 -0
- package/agent/design/local.memory-collection-pattern-v2.md +348 -0
- package/agent/design/local.moderation-and-space-config.md +257 -0
- package/agent/design/local.v2-api-reference.md +621 -0
- package/agent/design/local.v2-migration-guide.md +191 -0
- package/agent/design/local.v2-usage-examples.md +265 -0
- package/agent/design/permissions-storage-architecture.md +11 -3
- package/agent/design/soft-delete-system.md +291 -0
- package/agent/design/trust-escalation-prevention.md +9 -2
- package/agent/design/trust-system-implementation.md +12 -3
- package/agent/milestones/milestone-13-soft-delete-system.md +306 -0
- package/agent/milestones/milestone-14-memory-collection-v2.md +182 -0
- package/agent/milestones/milestone-15-moderation-space-config.md +126 -0
- package/agent/package.template.yaml +0 -17
- package/agent/progress.yaml +762 -49
- package/agent/scripts/acp.common.sh +2 -0
- package/agent/scripts/acp.install.sh +15 -85
- package/agent/scripts/acp.package-install-optimized.sh +454 -0
- package/agent/scripts/acp.package-install.sh +248 -380
- package/agent/scripts/acp.package-validate.sh +0 -99
- package/agent/scripts/acp.project-info.sh +218 -0
- package/agent/scripts/acp.project-remove.sh +302 -0
- package/agent/scripts/acp.project-update.sh +296 -0
- package/agent/scripts/acp.yaml-parser.sh +128 -10
- package/agent/tasks/milestone-14-memory-collection-v2/task-165-core-infrastructure-setup.md +171 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-166-update-remember-publish.md +191 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-167-update-remember-retract.md +186 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-168-implement-remember-revise.md +184 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-169-update-remember-search-space.md +179 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-170-update-remember-create-update.md +139 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-172-performance-testing-optimization.md +161 -0
- package/agent/tasks/milestone-14-memory-collection-v2/task-173-documentation-examples.md +258 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-174-add-moderation-schema-fields.md +57 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-175-create-space-config-service.md +64 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-176-wire-moderation-publish-flow.md +45 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-177-add-moderation-search-filters.md +70 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-178-create-remember-moderate-tool.md +69 -0
- package/agent/tasks/milestone-15-moderation-space-config/task-179-documentation-integration-tests.md +58 -0
- package/agent/tasks/milestone-16-ghost-system/task-187-ghost-config-firestore.md +41 -0
- package/agent/tasks/milestone-16-ghost-system/task-188-trust-filter-integration.md +44 -0
- package/agent/tasks/milestone-16-ghost-system/task-189-ghost-memory-filtering.md +43 -0
- package/agent/tasks/milestone-16-ghost-system/task-190-ghost-config-tools.md +45 -0
- package/agent/tasks/milestone-16-ghost-system/task-191-escalation-firestore.md +38 -0
- package/agent/tasks/milestone-16-ghost-system/task-192-documentation-verification.md +39 -0
- package/agent/tasks/milestone-7-trust-permissions/task-180-access-result-permission-types.md +69 -0
- package/agent/tasks/milestone-7-trust-permissions/task-181-firestore-permissions-access-logs.md +56 -0
- package/agent/tasks/milestone-7-trust-permissions/task-182-trust-enforcement-service.md +68 -0
- package/agent/tasks/milestone-7-trust-permissions/task-183-access-control-service.md +70 -0
- package/agent/tasks/milestone-7-trust-permissions/task-184-permission-tools.md +79 -0
- package/agent/tasks/milestone-7-trust-permissions/task-185-wire-trust-into-search-query.md +55 -0
- package/agent/tasks/milestone-7-trust-permissions/task-186-documentation-verification.md +56 -0
- package/agent/tasks/task-70-add-soft-delete-schema-fields.md +165 -0
- package/agent/tasks/task-71-implement-delete-confirmation-flow.md +257 -0
- package/agent/tasks/task-72-add-deleted-filter-to-search-tools.md +18 -0
- package/agent/tasks/task-73-update-relationship-handling.md +18 -0
- package/agent/tasks/task-74-add-unit-tests-soft-delete.md +18 -0
- package/agent/tasks/task-75-update-documentation-changelog.md +26 -0
- package/agent/tasks/task-76-fix-indexnullstate-schema-bug.md +197 -0
- package/dist/collections/composite-ids.d.ts +106 -0
- package/dist/collections/core-infrastructure.spec.d.ts +11 -0
- package/dist/collections/dot-notation.d.ts +106 -0
- package/dist/collections/tracking-arrays.d.ts +176 -0
- package/dist/constants/content-types.d.ts +1 -0
- package/dist/schema/v2-collections-comments.spec.d.ts +8 -0
- package/dist/schema/v2-collections.d.ts +210 -0
- package/dist/server-factory.d.ts +15 -0
- package/dist/server-factory.js +3261 -1316
- package/dist/server.js +2926 -1236
- package/dist/services/access-control.d.ts +103 -0
- package/dist/services/access-control.spec.d.ts +2 -0
- package/dist/services/credentials-provider.d.ts +24 -0
- package/dist/services/credentials-provider.spec.d.ts +2 -0
- package/dist/services/escalation.service.d.ts +22 -0
- package/dist/services/escalation.service.spec.d.ts +2 -0
- package/dist/services/ghost-config.service.d.ts +55 -0
- package/dist/services/ghost-config.service.spec.d.ts +2 -0
- package/dist/services/space-config.service.d.ts +23 -0
- package/dist/services/space-config.service.spec.d.ts +2 -0
- package/dist/services/trust-enforcement.d.ts +83 -0
- package/dist/services/trust-enforcement.spec.d.ts +2 -0
- package/dist/services/trust-validator.d.ts +43 -0
- package/dist/services/trust-validator.spec.d.ts +2 -0
- package/dist/tools/confirm-publish-moderation.spec.d.ts +8 -0
- package/dist/tools/confirm.d.ts +8 -1
- package/dist/tools/create-memory.d.ts +2 -1
- package/dist/tools/create-memory.spec.d.ts +10 -0
- package/dist/tools/create-relationship.d.ts +2 -1
- package/dist/tools/delete-memory.d.ts +7 -31
- package/dist/tools/delete-relationship.d.ts +2 -1
- package/dist/tools/deny.d.ts +2 -1
- package/dist/tools/find-similar.d.ts +10 -2
- package/dist/tools/get-preferences.d.ts +2 -1
- package/dist/tools/ghost-config.d.ts +27 -0
- package/dist/tools/ghost-config.spec.d.ts +2 -0
- package/dist/tools/moderate.d.ts +20 -0
- package/dist/tools/moderate.spec.d.ts +5 -0
- package/dist/tools/publish.d.ts +11 -3
- package/dist/tools/query-memory.d.ts +11 -2
- package/dist/tools/query-space.d.ts +4 -1
- package/dist/tools/retract.d.ts +29 -0
- package/dist/tools/revise.d.ts +45 -0
- package/dist/tools/revise.spec.d.ts +8 -0
- package/dist/tools/search-memory.d.ts +8 -1
- package/dist/tools/search-relationship.d.ts +10 -2
- package/dist/tools/search-space.d.ts +25 -5
- package/dist/tools/search-space.spec.d.ts +9 -0
- package/dist/tools/set-preference.d.ts +2 -1
- package/dist/tools/update-memory.d.ts +2 -1
- package/dist/tools/update-relationship.d.ts +2 -1
- package/dist/types/access-result.d.ts +48 -0
- package/dist/types/access-result.spec.d.ts +2 -0
- package/dist/types/auth.d.ts +46 -0
- package/dist/types/ghost-config.d.ts +36 -0
- package/dist/types/memory.d.ts +11 -1
- package/dist/types/preferences.d.ts +1 -1
- package/dist/types/space-memory.d.ts +3 -0
- package/dist/utils/auth-helpers.d.ts +14 -0
- package/dist/utils/auth-helpers.spec.d.ts +2 -0
- package/dist/utils/test-data-generator.d.ts +124 -0
- package/dist/utils/test-data-generator.spec.d.ts +12 -0
- package/dist/utils/weaviate-filters.d.ts +19 -0
- package/dist/v2-performance.e2e.d.ts +17 -0
- package/dist/v2-smoke.e2e.d.ts +14 -0
- package/dist/weaviate/client.d.ts +5 -8
- package/dist/weaviate/space-schema.d.ts +2 -2
- package/docs/performance/v2-benchmarks.md +80 -0
- package/jest.e2e.config.js +14 -3
- package/package.json +1 -1
- package/scripts/.collection-recreation-state.yaml +16 -0
- package/scripts/.gitkeep +5 -0
- package/scripts/README-collection-recreation.md +224 -0
- package/scripts/README.md +51 -0
- package/scripts/backup-collections.ts +543 -0
- package/scripts/delete-collection.ts +137 -0
- package/scripts/migrate-recreate-collections.ts +578 -0
- package/scripts/migrate-v1-to-v2.ts +1094 -0
- package/scripts/package-lock.json +1113 -0
- package/scripts/package.json +27 -0
- package/src/collections/composite-ids.ts +193 -0
- package/src/collections/core-infrastructure.spec.ts +353 -0
- package/src/collections/dot-notation.ts +212 -0
- package/src/collections/tracking-arrays.ts +298 -0
- package/src/constants/content-types.ts +20 -0
- package/src/schema/v2-collections-comments.spec.ts +141 -0
- package/src/schema/v2-collections.ts +433 -0
- package/src/server-factory.ts +89 -20
- package/src/server.ts +45 -17
- package/src/services/access-control.spec.ts +383 -0
- package/src/services/access-control.ts +291 -0
- package/src/services/credentials-provider.spec.ts +22 -0
- package/src/services/credentials-provider.ts +34 -0
- package/src/services/escalation.service.spec.ts +183 -0
- package/src/services/escalation.service.ts +150 -0
- package/src/services/ghost-config.service.spec.ts +339 -0
- package/src/services/ghost-config.service.ts +219 -0
- package/src/services/space-config.service.spec.ts +102 -0
- package/src/services/space-config.service.ts +79 -0
- package/src/services/trust-enforcement.spec.ts +309 -0
- package/src/services/trust-enforcement.ts +197 -0
- package/src/services/trust-validator.spec.ts +108 -0
- package/src/services/trust-validator.ts +105 -0
- package/src/tools/confirm-publish-moderation.spec.ts +240 -0
- package/src/tools/confirm.ts +914 -116
- package/src/tools/create-memory.spec.ts +126 -0
- package/src/tools/create-memory.ts +20 -27
- package/src/tools/create-relationship.ts +30 -8
- package/src/tools/delete-memory.ts +99 -64
- package/src/tools/delete-relationship.ts +15 -6
- package/src/tools/deny.ts +8 -1
- package/src/tools/find-similar.ts +44 -6
- package/src/tools/get-preferences.ts +10 -1
- package/src/tools/ghost-config.spec.ts +180 -0
- package/src/tools/ghost-config.ts +230 -0
- package/src/tools/moderate.spec.ts +277 -0
- package/src/tools/moderate.ts +219 -0
- package/src/tools/publish.ts +99 -41
- package/src/tools/query-memory.ts +44 -9
- package/src/tools/query-space.ts +39 -4
- package/src/tools/retract.ts +292 -0
- package/src/tools/revise.spec.ts +146 -0
- package/src/tools/revise.ts +283 -0
- package/src/tools/search-memory.ts +46 -10
- package/src/tools/search-relationship.ts +30 -7
- package/src/tools/search-space.spec.ts +341 -0
- package/src/tools/search-space.ts +323 -99
- package/src/tools/set-preference.ts +10 -1
- package/src/tools/update-memory.ts +24 -5
- package/src/tools/update-relationship.ts +10 -1
- package/src/types/access-result.spec.ts +193 -0
- package/src/types/access-result.ts +62 -0
- package/src/types/auth.ts +52 -0
- package/src/types/ghost-config.ts +46 -0
- package/src/types/memory.ts +20 -1
- package/src/types/preferences.ts +2 -2
- package/src/types/space-memory.ts +5 -0
- package/src/utils/auth-helpers.spec.ts +75 -0
- package/src/utils/auth-helpers.ts +25 -0
- package/src/utils/test-data-generator.spec.ts +317 -0
- package/src/utils/test-data-generator.ts +292 -0
- package/src/utils/weaviate-filters.ts +32 -5
- package/src/v2-performance.e2e.ts +173 -0
- package/src/v2-smoke.e2e.ts +401 -0
- package/src/weaviate/client.spec.ts +5 -5
- package/src/weaviate/client.ts +55 -35
- package/src/weaviate/schema.ts +11 -239
- package/src/weaviate/space-schema.spec.ts +28 -25
- package/src/weaviate/space-schema.ts +35 -11
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
# Memory Collection Pattern v2 — API Reference
|
|
2
|
+
|
|
3
|
+
**Concept**: Complete API documentation for all v2 MCP tools
|
|
4
|
+
**Created**: 2026-02-27
|
|
5
|
+
**Status**: Implemented
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Overview
|
|
10
|
+
|
|
11
|
+
This document provides complete API reference for the 6 implemented tools and 2 proposed tools in Memory Collection Pattern v2. Each tool listing includes input schema, output format, error cases, and usage examples.
|
|
12
|
+
|
|
13
|
+
All tools operate on the three-tier collection structure:
|
|
14
|
+
- `Memory_users_{userId}` — Private user memories (simple IDs)
|
|
15
|
+
- `Memory_spaces_public` — All public space memories (composite IDs)
|
|
16
|
+
- `Memory_groups_{groupId}` — Group memories (composite IDs)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Tools
|
|
21
|
+
|
|
22
|
+
### remember_create_memory
|
|
23
|
+
|
|
24
|
+
Creates a new memory in the user's personal collection.
|
|
25
|
+
|
|
26
|
+
**Input Schema**:
|
|
27
|
+
|
|
28
|
+
| Parameter | Type | Required | Default | Description |
|
|
29
|
+
|-----------|------|----------|---------|-------------|
|
|
30
|
+
| `content` | string | Yes | — | Memory content (MUST be exact user-provided text) |
|
|
31
|
+
| `title` | string | No | — | Short title |
|
|
32
|
+
| `type` | string | No | `"note"` | Content type (note, event, person, recipe, etc.) |
|
|
33
|
+
| `weight` | number | No | `0.5` | Significance/priority (0-1) |
|
|
34
|
+
| `trust` | number | No | `0.5` | Access control level (0-1) |
|
|
35
|
+
| `tags` | string[] | No | `[]` | Tags for organization |
|
|
36
|
+
| `references` | string[] | No | `[]` | Source URLs |
|
|
37
|
+
| `template_id` | string | No | — | Template ID to use |
|
|
38
|
+
| `skip_template_suggestion` | boolean | No | `false` | Skip template suggestion |
|
|
39
|
+
| `parent_id` | string | No | `null` | Parent memory ID for threading |
|
|
40
|
+
| `thread_root_id` | string | No | `null` | Root memory ID for thread |
|
|
41
|
+
| `moderation_flags` | string[] | No | `[]` | Format: `"{space_id}:{flag_type}"` |
|
|
42
|
+
|
|
43
|
+
**v2 Behavior**: New memories are initialized with empty tracking arrays (`space_ids: []`, `group_ids: []`). These arrays are managed exclusively by `remember_publish` and `remember_retract`.
|
|
44
|
+
|
|
45
|
+
**Output**:
|
|
46
|
+
```json
|
|
47
|
+
{
|
|
48
|
+
"memory_id": "generated-uuid",
|
|
49
|
+
"created_at": "2026-02-27T12:34:56.000Z",
|
|
50
|
+
"message": "Memory created successfully with ID: generated-uuid"
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**Example**:
|
|
55
|
+
```
|
|
56
|
+
remember_create_memory({
|
|
57
|
+
content: "Grandma's famous pasta recipe with secret ingredient",
|
|
58
|
+
type: "recipe",
|
|
59
|
+
tags: ["cooking", "family"],
|
|
60
|
+
weight: 0.8
|
|
61
|
+
})
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
### remember_update_memory
|
|
67
|
+
|
|
68
|
+
Updates an existing memory with partial updates. Version incremented automatically.
|
|
69
|
+
|
|
70
|
+
**Input Schema**:
|
|
71
|
+
|
|
72
|
+
| Parameter | Type | Required | Default | Description |
|
|
73
|
+
|-----------|------|----------|---------|-------------|
|
|
74
|
+
| `memory_id` | string | Yes | — | ID of memory to update |
|
|
75
|
+
| `content` | string | No | — | Updated content |
|
|
76
|
+
| `title` | string | No | — | Updated title |
|
|
77
|
+
| `type` | string | No | — | Updated content type |
|
|
78
|
+
| `weight` | number | No | — | Updated significance (0-1) |
|
|
79
|
+
| `trust` | number | No | — | Updated access level (0-1) |
|
|
80
|
+
| `tags` | string[] | No | — | Updated tags (replaces existing) |
|
|
81
|
+
| `references` | string[] | No | — | Updated URLs (replaces existing) |
|
|
82
|
+
| `structured_content` | object | No | — | Updated structured content |
|
|
83
|
+
| `parent_id` | string | No | — | Updated parent ID |
|
|
84
|
+
| `thread_root_id` | string | No | — | Updated thread root ID |
|
|
85
|
+
| `moderation_flags` | string[] | No | — | Updated moderation flags |
|
|
86
|
+
|
|
87
|
+
**v2 Behavior**: `space_ids` and `group_ids` are intentionally NOT exposed — managed exclusively by `remember_publish`/`remember_retract`. Existing tracking arrays are preserved on update via spread.
|
|
88
|
+
|
|
89
|
+
**Output**:
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"memory_id": "memory-id",
|
|
93
|
+
"updated_at": "2026-02-27T12:34:56.000Z",
|
|
94
|
+
"version": 2,
|
|
95
|
+
"updated_fields": ["content", "title"],
|
|
96
|
+
"message": "Memory updated successfully. Updated fields: content, title"
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Validation**:
|
|
101
|
+
- Memory must exist and be owned by user
|
|
102
|
+
- Memory must not be soft-deleted
|
|
103
|
+
- At least one field must be provided
|
|
104
|
+
- Content type, weight, trust validated if provided
|
|
105
|
+
|
|
106
|
+
**Error Cases**:
|
|
107
|
+
- `Memory not found` — Invalid memory_id
|
|
108
|
+
- `Ownership verification failed` — User doesn't own this memory
|
|
109
|
+
- `Memory is soft-deleted` — Cannot update deleted memories
|
|
110
|
+
- `Invalid content type` — Unrecognized content type
|
|
111
|
+
- `No fields provided` — Must update at least one field
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
### remember_publish
|
|
116
|
+
|
|
117
|
+
Publishes a memory to one or more shared spaces and/or groups. Uses two-phase confirmation flow.
|
|
118
|
+
|
|
119
|
+
**Input Schema**:
|
|
120
|
+
|
|
121
|
+
| Parameter | Type | Required | Default | Description |
|
|
122
|
+
|-----------|------|----------|---------|-------------|
|
|
123
|
+
| `memory_id` | string | Yes | — | ID of memory from personal collection |
|
|
124
|
+
| `spaces` | string[] | No | `["the_void"]` | Spaces to publish to (must be in SUPPORTED_SPACES) |
|
|
125
|
+
| `groups` | string[] | No | `[]` | Group IDs to publish to |
|
|
126
|
+
| `additional_tags` | string[] | No | `[]` | Extra tags for discovery |
|
|
127
|
+
|
|
128
|
+
**Confirmation Flow**: Returns a token that must be confirmed via `remember_confirm` before the publish executes.
|
|
129
|
+
|
|
130
|
+
**Output** (token generation):
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"success": true,
|
|
134
|
+
"token": "<confirmation_token>"
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**What happens on confirmation**:
|
|
139
|
+
1. Memory is COPIED (not moved) from `Memory_users_{userId}` to target collections
|
|
140
|
+
2. Composite ID `{userId}.{memoryId}` is generated for published copies
|
|
141
|
+
3. Source memory's `space_ids` and `group_ids` arrays are updated
|
|
142
|
+
4. `published_at` timestamp is set on copies
|
|
143
|
+
|
|
144
|
+
**Validation**:
|
|
145
|
+
- At least one destination (space or group) required
|
|
146
|
+
- Space IDs must be in SUPPORTED_SPACES enum
|
|
147
|
+
- Group IDs must not contain dots or be empty
|
|
148
|
+
- Memory must exist and be owned by user
|
|
149
|
+
- Only memories (not relationships) can be published
|
|
150
|
+
|
|
151
|
+
**Error Cases**:
|
|
152
|
+
- `No destinations provided` — Both spaces and groups are empty
|
|
153
|
+
- `Invalid space IDs` — Not in SUPPORTED_SPACES
|
|
154
|
+
- `Invalid group IDs` — Contains dots or whitespace
|
|
155
|
+
- `Memory not found` — Invalid memory_id
|
|
156
|
+
- `Ownership verification failed` — User doesn't own this memory
|
|
157
|
+
|
|
158
|
+
**Example**:
|
|
159
|
+
```
|
|
160
|
+
remember_publish({
|
|
161
|
+
memory_id: "my-recipe",
|
|
162
|
+
spaces: ["cooking", "recipes"],
|
|
163
|
+
groups: ["foodie-group"],
|
|
164
|
+
additional_tags: ["pasta", "italian"]
|
|
165
|
+
})
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### remember_retract
|
|
171
|
+
|
|
172
|
+
Retracts a memory from specific spaces and/or groups. Uses two-phase confirmation flow with orphan strategy.
|
|
173
|
+
|
|
174
|
+
**Input Schema**:
|
|
175
|
+
|
|
176
|
+
| Parameter | Type | Required | Default | Description |
|
|
177
|
+
|-----------|------|----------|---------|-------------|
|
|
178
|
+
| `memory_id` | string | Yes | — | ID of memory to retract |
|
|
179
|
+
| `spaces` | string[] | No | `[]` | Spaces to retract from |
|
|
180
|
+
| `groups` | string[] | No | `[]` | Group IDs to retract from |
|
|
181
|
+
|
|
182
|
+
**Orphan Strategy**: Retracted memories remain in target collections with cleared tracking arrays. They are kept for historical reference (e.g., if other users commented on them).
|
|
183
|
+
|
|
184
|
+
**Output** (token generation):
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"success": true,
|
|
188
|
+
"message": "Retraction request created. Please confirm to proceed.",
|
|
189
|
+
"action": "retract_memory",
|
|
190
|
+
"memory_id": "my-recipe",
|
|
191
|
+
"destinations": "spaces: cooking, recipes; groups: foodie-group",
|
|
192
|
+
"retraction_details": {
|
|
193
|
+
"spaces": {
|
|
194
|
+
"action": "orphan",
|
|
195
|
+
"description": "Memory will remain in Memory_spaces_public with updated tracking arrays",
|
|
196
|
+
"spaces": ["cooking", "recipes"]
|
|
197
|
+
},
|
|
198
|
+
"groups": {
|
|
199
|
+
"action": "orphan",
|
|
200
|
+
"description": "Memory will remain in Memory_groups_{groupId} with updated tracking arrays",
|
|
201
|
+
"groups": ["foodie-group"]
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"confirmation_required": true
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**What happens on confirmation**:
|
|
209
|
+
1. Published copy's `space_ids`/`group_ids` arrays are updated (retracted spaces/groups removed)
|
|
210
|
+
2. Source memory's tracking arrays are updated
|
|
211
|
+
3. Published copies remain in collections (orphaned, not deleted)
|
|
212
|
+
|
|
213
|
+
**Validation**:
|
|
214
|
+
- At least one destination required
|
|
215
|
+
- Group IDs must not contain dots
|
|
216
|
+
- Memory must exist and be owned by user
|
|
217
|
+
- Memory must be currently published to specified destinations
|
|
218
|
+
|
|
219
|
+
**Example**:
|
|
220
|
+
```
|
|
221
|
+
remember_retract({
|
|
222
|
+
memory_id: "my-recipe",
|
|
223
|
+
spaces: ["cooking"]
|
|
224
|
+
})
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### remember_revise
|
|
230
|
+
|
|
231
|
+
Syncs updated content from source memory to all published copies. Uses two-phase confirmation flow.
|
|
232
|
+
|
|
233
|
+
**Input Schema**:
|
|
234
|
+
|
|
235
|
+
| Parameter | Type | Required | Default | Description |
|
|
236
|
+
|-----------|------|----------|---------|-------------|
|
|
237
|
+
| `memory_id` | string | Yes | — | ID of source memory to sync |
|
|
238
|
+
|
|
239
|
+
**Confirmation Flow**: Returns a token that must be confirmed via `remember_confirm` before the revision executes.
|
|
240
|
+
|
|
241
|
+
**Output** (token generation):
|
|
242
|
+
```json
|
|
243
|
+
{
|
|
244
|
+
"success": true,
|
|
245
|
+
"token": "<confirmation_token>",
|
|
246
|
+
"message": "Revision request created. Please confirm to sync content to all published copies.",
|
|
247
|
+
"action": "revise_memory",
|
|
248
|
+
"memory_id": "my-recipe",
|
|
249
|
+
"destinations": "spaces: cooking, recipes; groups: foodie-group",
|
|
250
|
+
"revision_details": {
|
|
251
|
+
"space_ids": ["cooking", "recipes"],
|
|
252
|
+
"group_ids": ["foodie-group"],
|
|
253
|
+
"total_locations": 2
|
|
254
|
+
},
|
|
255
|
+
"confirmation_required": true
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Output** (after confirmation):
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"success": true,
|
|
263
|
+
"composite_id": "user123.my-recipe",
|
|
264
|
+
"revised_at": "2026-02-27T12:34:56.000Z",
|
|
265
|
+
"summary": {
|
|
266
|
+
"total": 2,
|
|
267
|
+
"success": 2,
|
|
268
|
+
"failed": 0,
|
|
269
|
+
"skipped": 0
|
|
270
|
+
},
|
|
271
|
+
"results": [
|
|
272
|
+
{ "location": "Memory_spaces_public", "status": "success" },
|
|
273
|
+
{ "location": "Memory_groups_foodie-group", "status": "success" }
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
**Revision History**: Previous content is preserved in `revision_history` (max 10 entries). Each entry contains `{ content: string, revised_at: string }`.
|
|
279
|
+
|
|
280
|
+
**What happens on confirmation**:
|
|
281
|
+
1. Fetches source memory from `Memory_users_{userId}`
|
|
282
|
+
2. For each space in `space_ids` → updates `Memory_spaces_public`
|
|
283
|
+
3. For each group in `group_ids` → updates `Memory_groups_{groupId}`
|
|
284
|
+
4. Each update: old content → `revision_history`, `revision_count++`, `revised_at` set
|
|
285
|
+
|
|
286
|
+
**Validation**:
|
|
287
|
+
- Source memory must exist and be owned by user
|
|
288
|
+
- Memory must be published to at least one location
|
|
289
|
+
|
|
290
|
+
**Supports partial success** — some locations may fail while others succeed.
|
|
291
|
+
|
|
292
|
+
**Example** (typical workflow):
|
|
293
|
+
```
|
|
294
|
+
// 1. Update source memory
|
|
295
|
+
remember_update_memory({
|
|
296
|
+
memory_id: "my-recipe",
|
|
297
|
+
content: "Updated recipe with new secret ingredient"
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
// 2. Request revision (generates token)
|
|
301
|
+
remember_revise({ memory_id: "my-recipe" })
|
|
302
|
+
// → { success: true, token: "tok_xyz", ... }
|
|
303
|
+
|
|
304
|
+
// 3. Confirm revision
|
|
305
|
+
remember_confirm({ token: "tok_xyz" })
|
|
306
|
+
// → { success: true, summary: { total: 2, success: 2, ... } }
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
### remember_search_space
|
|
312
|
+
|
|
313
|
+
Searches shared spaces and/or groups to discover memories from other users.
|
|
314
|
+
|
|
315
|
+
**Input Schema**:
|
|
316
|
+
|
|
317
|
+
| Parameter | Type | Required | Default | Description |
|
|
318
|
+
|-----------|------|----------|---------|-------------|
|
|
319
|
+
| `query` | string | Yes | — | Search query |
|
|
320
|
+
| `spaces` | string[] | No | — | Spaces to search (omit for all-public) |
|
|
321
|
+
| `groups` | string[] | No | — | Group IDs to search |
|
|
322
|
+
| `search_type` | enum | No | `"hybrid"` | `"hybrid"`, `"bm25"`, or `"semantic"` |
|
|
323
|
+
| `content_type` | string | No | — | Filter by content type |
|
|
324
|
+
| `tags` | string[] | No | — | Filter by tags (AND semantics) |
|
|
325
|
+
| `min_weight` | number | No | — | Minimum significance (0-1) |
|
|
326
|
+
| `max_weight` | number | No | — | Maximum significance (0-1) |
|
|
327
|
+
| `date_from` | string | No | — | ISO 8601 minimum date |
|
|
328
|
+
| `date_to` | string | No | — | ISO 8601 maximum date |
|
|
329
|
+
| `include_comments` | boolean | No | `false` | Include comments in results |
|
|
330
|
+
| `limit` | number | No | `10` | Max results |
|
|
331
|
+
| `offset` | number | No | `0` | Pagination offset |
|
|
332
|
+
|
|
333
|
+
**Search Behavior**:
|
|
334
|
+
- If `spaces` provided → searches `Memory_spaces_public` filtered by `space_ids.containsAny()`
|
|
335
|
+
- If `groups` provided → searches each `Memory_groups_{groupId}` separately
|
|
336
|
+
- If neither → searches all of `Memory_spaces_public` (all-public fallback)
|
|
337
|
+
- Results are merged, deduplicated by UUID, and sorted by relevance score
|
|
338
|
+
|
|
339
|
+
**Search Types**:
|
|
340
|
+
- `hybrid` — Combined BM25 keyword + semantic vector search (default, recommended)
|
|
341
|
+
- `bm25` — Keyword-only search
|
|
342
|
+
- `semantic` — Vector-only search via `nearText()`
|
|
343
|
+
|
|
344
|
+
**Base Filters** (always applied):
|
|
345
|
+
- Excludes soft-deleted memories (`deleted_at IS NULL`)
|
|
346
|
+
- Only returns memories (`doc_type = 'memory'`)
|
|
347
|
+
- Excludes comments unless `include_comments: true`
|
|
348
|
+
|
|
349
|
+
**Output**:
|
|
350
|
+
```json
|
|
351
|
+
{
|
|
352
|
+
"spaces_searched": ["cooking", "recipes"],
|
|
353
|
+
"groups_searched": ["foodie-group"],
|
|
354
|
+
"query": "pasta recipe",
|
|
355
|
+
"search_type": "hybrid",
|
|
356
|
+
"memories": [
|
|
357
|
+
{
|
|
358
|
+
"id": "user123.my-recipe",
|
|
359
|
+
"content": "Grandma's famous pasta recipe...",
|
|
360
|
+
"title": "Secret Pasta",
|
|
361
|
+
"weight": 0.8,
|
|
362
|
+
"_score": 0.95
|
|
363
|
+
}
|
|
364
|
+
],
|
|
365
|
+
"total": 1,
|
|
366
|
+
"offset": 0,
|
|
367
|
+
"limit": 10
|
|
368
|
+
}
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
**Example**:
|
|
372
|
+
```
|
|
373
|
+
// Search specific space
|
|
374
|
+
remember_search_space({
|
|
375
|
+
query: "pasta recipe",
|
|
376
|
+
spaces: ["cooking"],
|
|
377
|
+
search_type: "hybrid",
|
|
378
|
+
tags: ["italian"],
|
|
379
|
+
limit: 20
|
|
380
|
+
})
|
|
381
|
+
|
|
382
|
+
// Search group
|
|
383
|
+
remember_search_space({
|
|
384
|
+
query: "meeting notes",
|
|
385
|
+
groups: ["team-alpha"]
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
// Search all public memories
|
|
389
|
+
remember_search_space({
|
|
390
|
+
query: "hiking trails"
|
|
391
|
+
})
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
396
|
+
### remember_sync *(Proposed)*
|
|
397
|
+
|
|
398
|
+
Detects conflicts between a source memory and its published copies. Call before `remember_revise` in shared-editing contexts to check for divergent content.
|
|
399
|
+
|
|
400
|
+
**Status**: Proposal — depends on shared write permission system (M7 Trust & Permissions)
|
|
401
|
+
|
|
402
|
+
**Input Schema**:
|
|
403
|
+
|
|
404
|
+
| Parameter | Type | Required | Default | Description |
|
|
405
|
+
|-----------|------|----------|---------|-------------|
|
|
406
|
+
| `memory_id` | string | Yes | — | Source memory ID from personal collection |
|
|
407
|
+
| `location` | string | No | — | Specific location to sync (omit for all published locations) |
|
|
408
|
+
|
|
409
|
+
**Output — Clean** (no conflicts):
|
|
410
|
+
```json
|
|
411
|
+
{
|
|
412
|
+
"status": "clean",
|
|
413
|
+
"message": "Published copies are in sync. Safe to remember_revise.",
|
|
414
|
+
"locations_checked": 3
|
|
415
|
+
}
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Output — Conflict detected**:
|
|
419
|
+
```json
|
|
420
|
+
{
|
|
421
|
+
"status": "conflict",
|
|
422
|
+
"message": "Published copy has been modified since your last revision.",
|
|
423
|
+
"conflicts": [
|
|
424
|
+
{
|
|
425
|
+
"location": "Memory_spaces_public",
|
|
426
|
+
"local_content": "Your version...",
|
|
427
|
+
"remote_content": "Published version (modified by user456)...",
|
|
428
|
+
"local_updated_at": "2026-02-27T10:00:00Z",
|
|
429
|
+
"remote_revised_at": "2026-02-27T11:30:00Z",
|
|
430
|
+
"remote_revised_by": "user456"
|
|
431
|
+
}
|
|
432
|
+
],
|
|
433
|
+
"merge_options": ["keep_local", "keep_remote", "manual"]
|
|
434
|
+
}
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**Conflict Detection Logic**:
|
|
438
|
+
- If published `revised_at` > source `updated_at` → **CONFLICT** (someone else revised the published copy)
|
|
439
|
+
- If source content === published content → **CLEAN** (already in sync)
|
|
440
|
+
- If source `updated_at` > published `revised_at` and content differs → **CLEAN** (user's own changes pending)
|
|
441
|
+
|
|
442
|
+
**Merge Strategies**:
|
|
443
|
+
- `keep_local` — Use source memory content, discard remote changes, then call `remember_revise`
|
|
444
|
+
- `keep_remote` — Update source memory from published copy content (no revise needed)
|
|
445
|
+
- `manual` — User edits source memory to reconcile, then calls `remember_revise`
|
|
446
|
+
|
|
447
|
+
**Validation**:
|
|
448
|
+
- Source memory must exist and be owned by user
|
|
449
|
+
- Memory must be published to at least one location
|
|
450
|
+
|
|
451
|
+
**Error Cases**:
|
|
452
|
+
- `Memory not found` — Invalid memory_id
|
|
453
|
+
- `Ownership verification failed` — User doesn't own this memory
|
|
454
|
+
- `Not published` — Memory has no published copies to sync
|
|
455
|
+
|
|
456
|
+
**Example**:
|
|
457
|
+
```
|
|
458
|
+
// Check for conflicts before revising
|
|
459
|
+
remember_sync({ memory_id: "my-recipe" })
|
|
460
|
+
// → { status: "clean", locations_checked: 2 }
|
|
461
|
+
|
|
462
|
+
// Safe to revise
|
|
463
|
+
remember_revise({ memory_id: "my-recipe" })
|
|
464
|
+
|
|
465
|
+
// Or if conflict detected:
|
|
466
|
+
remember_sync({ memory_id: "my-recipe" })
|
|
467
|
+
// → { status: "conflict", conflicts: [...], merge_options: [...] }
|
|
468
|
+
// User resolves conflict, then revises
|
|
469
|
+
```
|
|
470
|
+
|
|
471
|
+
---
|
|
472
|
+
|
|
473
|
+
### remember_overwrite *(Proposed)*
|
|
474
|
+
|
|
475
|
+
Force-replaces published copies with source memory content, bypassing conflict detection. Requires overwrite permission on the target document. Uses two-phase confirmation flow.
|
|
476
|
+
|
|
477
|
+
**Status**: Proposal — depends on shared write permission system (M7 Trust & Permissions)
|
|
478
|
+
|
|
479
|
+
**Input Schema**:
|
|
480
|
+
|
|
481
|
+
| Parameter | Type | Required | Default | Description |
|
|
482
|
+
|-----------|------|----------|---------|-------------|
|
|
483
|
+
| `memory_id` | string | Yes | — | Source memory ID from personal collection |
|
|
484
|
+
| `locations` | object | No | — | Specific locations to overwrite (omit for all) |
|
|
485
|
+
| `locations.spaces` | string[] | No | — | Spaces to overwrite |
|
|
486
|
+
| `locations.groups` | string[] | No | — | Groups to overwrite |
|
|
487
|
+
|
|
488
|
+
**Confirmation Flow**: Returns a token that must be confirmed via `remember_confirm` before the overwrite executes.
|
|
489
|
+
|
|
490
|
+
**Output** (token generation):
|
|
491
|
+
```json
|
|
492
|
+
{
|
|
493
|
+
"success": true,
|
|
494
|
+
"token": "<confirmation_token>",
|
|
495
|
+
"message": "Overwrite request created. This will replace published content unconditionally.",
|
|
496
|
+
"action": "overwrite_memory",
|
|
497
|
+
"memory_id": "my-recipe",
|
|
498
|
+
"warning": "This will discard any remote changes made by other users.",
|
|
499
|
+
"confirmation_required": true
|
|
500
|
+
}
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
**What happens on confirmation**:
|
|
504
|
+
1. Source memory content replaces published copy content unconditionally
|
|
505
|
+
2. Old published content preserved in `revision_history` (max 10 entries)
|
|
506
|
+
3. `revision_count` incremented, `revised_at` updated
|
|
507
|
+
4. `last_revised_by` set to overwriting user's ID
|
|
508
|
+
|
|
509
|
+
**Permission Model**: Overwrite permission is a document-level flag. Only the original author or users with explicit overwrite access can use this tool.
|
|
510
|
+
|
|
511
|
+
**Validation**:
|
|
512
|
+
- Source memory must exist and be owned by user
|
|
513
|
+
- Memory must be published to at least one location
|
|
514
|
+
- User must have overwrite permission on the target document
|
|
515
|
+
|
|
516
|
+
**Error Cases**:
|
|
517
|
+
- `Memory not found` — Invalid memory_id
|
|
518
|
+
- `Ownership verification failed` — User doesn't own this memory
|
|
519
|
+
- `Not published` — Memory has no published copies
|
|
520
|
+
- `Permission denied` — User lacks overwrite permission on target
|
|
521
|
+
|
|
522
|
+
**Example**:
|
|
523
|
+
```
|
|
524
|
+
// Force-replace all published copies
|
|
525
|
+
remember_overwrite({ memory_id: "my-recipe" })
|
|
526
|
+
// → { success: true, token: "tok_xyz", warning: "..." }
|
|
527
|
+
|
|
528
|
+
remember_confirm({ token: "tok_xyz" })
|
|
529
|
+
// → Published copies replaced unconditionally
|
|
530
|
+
|
|
531
|
+
// Overwrite specific locations only
|
|
532
|
+
remember_overwrite({
|
|
533
|
+
memory_id: "my-recipe",
|
|
534
|
+
locations: { spaces: ["cooking"] }
|
|
535
|
+
})
|
|
536
|
+
```
|
|
537
|
+
|
|
538
|
+
---
|
|
539
|
+
|
|
540
|
+
## Utility Modules
|
|
541
|
+
|
|
542
|
+
### Composite IDs (`src/collections/composite-ids.ts`)
|
|
543
|
+
|
|
544
|
+
Format: `{userId}.{memoryId}` (e.g., `user123.my-recipe`)
|
|
545
|
+
|
|
546
|
+
| Function | Signature | Description |
|
|
547
|
+
|----------|-----------|-------------|
|
|
548
|
+
| `generateCompositeId` | `(userId, memoryId) → string` | Creates composite ID |
|
|
549
|
+
| `parseCompositeId` | `(compositeId) → { userId, memoryId }` | Splits into components |
|
|
550
|
+
| `isCompositeId` | `(id) → boolean` | Checks format validity |
|
|
551
|
+
| `belongsToUser` | `(compositeId, userId) → boolean` | Ownership check |
|
|
552
|
+
| `getUserIdFromComposite` | `(compositeId) → string` | Extracts userId |
|
|
553
|
+
| `getMemoryIdFromComposite` | `(compositeId) → string` | Extracts memoryId |
|
|
554
|
+
|
|
555
|
+
Constraints: No dots allowed in userId or memoryId components.
|
|
556
|
+
|
|
557
|
+
### Tracking Arrays (`src/collections/tracking-arrays.ts`)
|
|
558
|
+
|
|
559
|
+
All functions are immutable (return new objects).
|
|
560
|
+
|
|
561
|
+
| Function | Signature | Description |
|
|
562
|
+
|----------|-----------|-------------|
|
|
563
|
+
| `addToSpaceIds` | `(memory, spaceId) → memory` | Add space (deduped) |
|
|
564
|
+
| `removeFromSpaceIds` | `(memory, spaceId) → memory` | Remove space |
|
|
565
|
+
| `addToGroupIds` | `(memory, groupId) → memory` | Add group (deduped) |
|
|
566
|
+
| `removeFromGroupIds` | `(memory, groupId) → memory` | Remove group |
|
|
567
|
+
| `addMultipleSpaceIds` | `(memory, spaceIds[]) → memory` | Bulk add (O(n+m) Set) |
|
|
568
|
+
| `addMultipleGroupIds` | `(memory, groupIds[]) → memory` | Bulk add (O(n+m) Set) |
|
|
569
|
+
| `isPublished` | `(memory) → boolean` | Any publications? |
|
|
570
|
+
| `isPublishedToSpace` | `(memory, spaceId) → boolean` | Published to space? |
|
|
571
|
+
| `isPublishedToGroup` | `(memory, groupId) → boolean` | Published to group? |
|
|
572
|
+
| `getPublishedLocations` | `(memory) → { spaces, groups }` | All locations |
|
|
573
|
+
| `getPublishedCount` | `(memory) → number` | Total count |
|
|
574
|
+
| `initializeTracking` | `(memory) → memory` | Ensure arrays exist |
|
|
575
|
+
|
|
576
|
+
### Dot Notation (`src/collections/dot-notation.ts`)
|
|
577
|
+
|
|
578
|
+
| Function | Signature | Description |
|
|
579
|
+
|----------|-----------|-------------|
|
|
580
|
+
| `getCollectionName` | `(type, id?) → string` | Build collection name |
|
|
581
|
+
| `parseCollectionName` | `(name) → { type, id, name }` | Parse collection name |
|
|
582
|
+
| `validateCollectionName` | `(name) → boolean` | Validate format |
|
|
583
|
+
| `isUserCollection` | `(name) → boolean` | Is `Memory_users_*`? |
|
|
584
|
+
| `isSpacesCollection` | `(name) → boolean` | Is `Memory_spaces_public`? |
|
|
585
|
+
| `isGroupCollection` | `(name) → boolean` | Is `Memory_groups_*`? |
|
|
586
|
+
|
|
587
|
+
Collection types: `USERS`, `SPACES`, `GROUPS`
|
|
588
|
+
|
|
589
|
+
---
|
|
590
|
+
|
|
591
|
+
---
|
|
592
|
+
|
|
593
|
+
## Upcoming: Memory-Level ACL Fields
|
|
594
|
+
|
|
595
|
+
Four new fields will be added to `PUBLISHED_MEMORY_PROPERTIES` to support collaborative editing and group-based permissions:
|
|
596
|
+
|
|
597
|
+
| Field | Type | Default | Purpose |
|
|
598
|
+
|-------|------|---------|---------|
|
|
599
|
+
| `write_mode` | text | `null` (→ `"owner_only"`) | Controls who can revise: `"owner_only"` / `"group_editors"` / `"anyone"` |
|
|
600
|
+
| `overwrite_allowed_ids` | text[] | `[]` | Per-memory explicit overwrite grants (user IDs) |
|
|
601
|
+
| `last_revised_by` | text | `null` | User ID of last reviser — enables conflict detection |
|
|
602
|
+
| `owner_id` | text | `null` (→ `author_id`) | Supports ownership transfer |
|
|
603
|
+
|
|
604
|
+
All fields are nullable with zero-migration deployment. Existing memories continue to work unchanged (`write_mode: null` → `"owner_only"` semantics).
|
|
605
|
+
|
|
606
|
+
**Impact on existing tools**:
|
|
607
|
+
- `remember_publish` — can optionally set `write_mode` and `owner_id`
|
|
608
|
+
- `remember_revise` — sets `last_revised_by`, checks write permissions
|
|
609
|
+
- `remember_overwrite` — checks overwrite permissions via `overwrite_allowed_ids` and group credentials
|
|
610
|
+
- `remember_sync` — uses `last_revised_by` for conflict detection
|
|
611
|
+
|
|
612
|
+
See [Memory ACL Schema](local.memory-acl-schema.md) for full specification.
|
|
613
|
+
|
|
614
|
+
---
|
|
615
|
+
|
|
616
|
+
**Status**: Implemented (v3.1.0–v3.7.0), with 2 proposed tools (remember_sync, remember_overwrite)
|
|
617
|
+
**Recommendation**: Reference this document when integrating with remember-mcp v2 tools
|
|
618
|
+
**Related Documents**:
|
|
619
|
+
- [Memory Collection Pattern v2](local.memory-collection-pattern-v2.md) — Architecture and design rationale
|
|
620
|
+
- [Collaborative Memory Sync](local.collaborative-memory-sync.md) — Design proposal for remember_sync and remember_overwrite
|
|
621
|
+
- [Memory ACL Schema](local.memory-acl-schema.md) — Memory-level access control fields and permission resolution
|