@prmichaelsen/remember-mcp 0.1.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.
Files changed (95) hide show
  1. package/.env.example +65 -0
  2. package/AGENT.md +840 -0
  3. package/README.md +72 -0
  4. package/agent/design/.gitkeep +0 -0
  5. package/agent/design/access-control-result-pattern.md +458 -0
  6. package/agent/design/action-audit-memory-types.md +637 -0
  7. package/agent/design/common-template-fields.md +282 -0
  8. package/agent/design/complete-tool-set.md +407 -0
  9. package/agent/design/content-types-expansion.md +521 -0
  10. package/agent/design/cross-database-id-strategy.md +358 -0
  11. package/agent/design/default-template-library.md +423 -0
  12. package/agent/design/firestore-wrapper-analysis.md +606 -0
  13. package/agent/design/llm-provider-abstraction.md +691 -0
  14. package/agent/design/location-handling-architecture.md +523 -0
  15. package/agent/design/memory-templates-design.md +364 -0
  16. package/agent/design/permissions-storage-architecture.md +680 -0
  17. package/agent/design/relationship-storage-strategy.md +361 -0
  18. package/agent/design/remember-mcp-implementation-tasks.md +417 -0
  19. package/agent/design/remember-mcp-progress.yaml +141 -0
  20. package/agent/design/requirements-enhancements.md +468 -0
  21. package/agent/design/requirements.md +56 -0
  22. package/agent/design/template-storage-strategy.md +412 -0
  23. package/agent/design/template-suggestion-system.md +853 -0
  24. package/agent/design/trust-escalation-prevention.md +343 -0
  25. package/agent/design/trust-system-implementation.md +592 -0
  26. package/agent/design/user-preferences.md +683 -0
  27. package/agent/design/weaviate-collection-strategy.md +461 -0
  28. package/agent/milestones/.gitkeep +0 -0
  29. package/agent/milestones/milestone-1-project-foundation.md +121 -0
  30. package/agent/milestones/milestone-2-core-memory-system.md +150 -0
  31. package/agent/milestones/milestone-3-relationships-graph.md +116 -0
  32. package/agent/milestones/milestone-4-user-preferences.md +103 -0
  33. package/agent/milestones/milestone-5-template-system.md +126 -0
  34. package/agent/milestones/milestone-6-auth-multi-tenancy.md +124 -0
  35. package/agent/milestones/milestone-7-trust-permissions.md +133 -0
  36. package/agent/milestones/milestone-8-testing-quality.md +137 -0
  37. package/agent/milestones/milestone-9-deployment-documentation.md +147 -0
  38. package/agent/patterns/.gitkeep +0 -0
  39. package/agent/patterns/bootstrap.md +1271 -0
  40. package/agent/patterns/firebase-admin-sdk-v8-usage.md +950 -0
  41. package/agent/patterns/firestore-users-pattern-best-practices.md +347 -0
  42. package/agent/patterns/library-services.md +454 -0
  43. package/agent/patterns/testing-colocated.md +316 -0
  44. package/agent/progress.yaml +395 -0
  45. package/agent/tasks/.gitkeep +0 -0
  46. package/agent/tasks/task-1-initialize-project-structure.md +266 -0
  47. package/agent/tasks/task-2-install-dependencies.md +199 -0
  48. package/agent/tasks/task-3-setup-weaviate-client.md +330 -0
  49. package/agent/tasks/task-4-setup-firestore-client.md +362 -0
  50. package/agent/tasks/task-5-create-basic-mcp-server.md +114 -0
  51. package/agent/tasks/task-6-create-integration-tests.md +195 -0
  52. package/agent/tasks/task-7-finalize-milestone-1.md +363 -0
  53. package/agent/tasks/task-8-setup-utility-scripts.md +382 -0
  54. package/agent/tasks/task-9-create-server-factory.md +404 -0
  55. package/dist/config.d.ts +26 -0
  56. package/dist/constants/content-types.d.ts +60 -0
  57. package/dist/firestore/init.d.ts +14 -0
  58. package/dist/firestore/paths.d.ts +53 -0
  59. package/dist/firestore/paths.spec.d.ts +2 -0
  60. package/dist/server-factory.d.ts +40 -0
  61. package/dist/server-factory.js +1741 -0
  62. package/dist/server-factory.spec.d.ts +2 -0
  63. package/dist/server.d.ts +3 -0
  64. package/dist/server.js +1690 -0
  65. package/dist/tools/create-memory.d.ts +94 -0
  66. package/dist/tools/delete-memory.d.ts +47 -0
  67. package/dist/tools/search-memory.d.ts +88 -0
  68. package/dist/types/memory.d.ts +183 -0
  69. package/dist/utils/logger.d.ts +7 -0
  70. package/dist/weaviate/client.d.ts +39 -0
  71. package/dist/weaviate/client.spec.d.ts +2 -0
  72. package/dist/weaviate/schema.d.ts +29 -0
  73. package/esbuild.build.js +60 -0
  74. package/esbuild.watch.js +25 -0
  75. package/jest.config.js +31 -0
  76. package/jest.e2e.config.js +17 -0
  77. package/package.json +68 -0
  78. package/src/.gitkeep +0 -0
  79. package/src/config.ts +56 -0
  80. package/src/constants/content-types.ts +454 -0
  81. package/src/firestore/init.ts +68 -0
  82. package/src/firestore/paths.spec.ts +75 -0
  83. package/src/firestore/paths.ts +124 -0
  84. package/src/server-factory.spec.ts +60 -0
  85. package/src/server-factory.ts +215 -0
  86. package/src/server.ts +243 -0
  87. package/src/tools/create-memory.ts +198 -0
  88. package/src/tools/delete-memory.ts +126 -0
  89. package/src/tools/search-memory.ts +216 -0
  90. package/src/types/memory.ts +276 -0
  91. package/src/utils/logger.ts +42 -0
  92. package/src/weaviate/client.spec.ts +58 -0
  93. package/src/weaviate/client.ts +114 -0
  94. package/src/weaviate/schema.ts +288 -0
  95. package/tsconfig.json +26 -0
@@ -0,0 +1,133 @@
1
+ # Milestone 7: Trust & Permissions
2
+
3
+ **Goal**: Implement trust system and cross-user access control
4
+ **Duration**: 2 weeks
5
+ **Dependencies**: M6 (Auth & Multi-Tenancy)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Implement the prompt-based trust system, cross-user permissions, trust escalation prevention, and access logging.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Trust Enforcement
19
+ - Prompt-based trust filtering
20
+ - Format memories by trust level (continuous 0-1)
21
+ - Validation for trust < 0.25
22
+ - Trust context in LLM prompts
23
+
24
+ ### 2. Permission Storage
25
+ - Firestore schema: user_permissions/{owner}/allowed_accessors/{accessor}
26
+ - Permission CRUD operations
27
+ - Trust relationship tracking
28
+ - Access scope (allowed/excluded tags)
29
+
30
+ ### 3. Trust Escalation Prevention
31
+ - Track access attempts
32
+ - -0.1 trust reduction per unauthorized attempt
33
+ - Block after 3 attempts
34
+ - Reset block functionality
35
+
36
+ ### 4. Access Control Result Pattern
37
+ - Discriminated union types
38
+ - checkMemoryAccess() returns Result
39
+ - Type-safe error handling
40
+ - No exceptions for expected failures
41
+
42
+ ### 5. Permission Tools (5 tools)
43
+ - remember_grant_access
44
+ - remember_revoke_access
45
+ - remember_list_accessors
46
+ - remember_reset_block
47
+ - remember_get_access_logs
48
+
49
+ ---
50
+
51
+ ## Success Criteria
52
+
53
+ - [ ] Trust levels enforced via prompts (continuous 0-1)
54
+ - [ ] Users always access own memories (trust doesn't apply to self)
55
+ - [ ] Cross-user access controlled by permissions
56
+ - [ ] Trust escalation prevention active
57
+ - [ ] Access attempts logged
58
+ - [ ] Validation catches trust violations
59
+ - [ ] Result pattern used (no exceptions)
60
+ - [ ] Block reset works correctly
61
+
62
+ ---
63
+
64
+ ## Key Files to Create
65
+
66
+ ```
67
+ src/
68
+ ├── types/
69
+ │ ├── access-result.ts # Discriminated union
70
+ │ └── permission.ts # Permission interfaces
71
+ ├── services/
72
+ │ ├── trust-enforcement.ts
73
+ │ ├── trust-validator.ts
74
+ │ └── access-control.ts
75
+ ├── firestore/
76
+ │ ├── permissions.ts
77
+ │ └── access-logs.ts
78
+ └── tools/
79
+ ├── grant-access.ts
80
+ ├── revoke-access.ts
81
+ ├── list-accessors.ts
82
+ ├── reset-block.ts
83
+ └── get-access-logs.ts
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Trust Enforcement Example
89
+
90
+ ```typescript
91
+ // Trust 0.0 - Intimate details only
92
+ formatMemoryForPrompt(memory, trust: 0.0):
93
+ "Memory (Trust: 0.0 - Intimate Details Only):
94
+ Context: Significant personal incident
95
+ Type: personal_event
96
+
97
+ CRITICAL: Hint at existence only, NO specifics."
98
+
99
+ // Trust 0.5 - Summary only
100
+ formatMemoryForPrompt(memory, trust: 0.5):
101
+ "Memory (Trust: 0.5 - Summary Only):
102
+ Title: Doctor Visit
103
+ Summary: Had medical checkup, discussed health metrics
104
+
105
+ Summary only - no specific medical details."
106
+
107
+ // Trust 1.0 - Full access
108
+ formatMemoryForPrompt(memory, trust: 1.0):
109
+ "Memory (Trust: 1.0 - Full Access):
110
+ Title: Camping Trip
111
+ Content: [full content]
112
+
113
+ You have full access to this memory."
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Testing
119
+
120
+ - [ ] Trust enforcement test (all levels 0-1)
121
+ - [ ] Self-access test (trust doesn't apply)
122
+ - [ ] Cross-user access test
123
+ - [ ] Permission grant/revoke test
124
+ - [ ] Trust escalation test (-0.1 per attempt)
125
+ - [ ] Block after 3 attempts test
126
+ - [ ] Reset block test
127
+ - [ ] Access logging test
128
+ - [ ] Validation test (trust < 0.25)
129
+
130
+ ---
131
+
132
+ **Next Milestone**: M8 - Testing & Quality
133
+ **Blockers**: M6 must be complete
@@ -0,0 +1,137 @@
1
+ # Milestone 8: Testing & Quality
2
+
3
+ **Goal**: Comprehensive testing and validation
4
+ **Duration**: 2 weeks
5
+ **Dependencies**: M1-M7 (All previous milestones)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Comprehensive testing across all features with focus on security, performance, and data isolation.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Unit Tests
19
+ - Test all 24 tools individually
20
+ - Test all services and utilities
21
+ - Mock external dependencies
22
+ - Aim for >80% code coverage
23
+
24
+ ### 2. Integration Tests
25
+ - End-to-end user flows
26
+ - Multi-user scenarios
27
+ - Cross-user access scenarios
28
+ - Template suggestion flows
29
+
30
+ ### 3. Security Tests
31
+ - User isolation verification
32
+ - Trust boundary enforcement
33
+ - Permission bypass attempts
34
+ - GraphQL injection attempts
35
+ - Access log verification
36
+
37
+ ### 4. Performance Tests
38
+ - Query latency measurement
39
+ - Concurrent user load testing
40
+ - Memory usage profiling
41
+ - Database connection pooling
42
+
43
+ ---
44
+
45
+ ## Success Criteria
46
+
47
+ - [ ] All unit tests passing
48
+ - [ ] >80% code coverage
49
+ - [ ] No data leakage between users
50
+ - [ ] Trust boundaries enforced correctly
51
+ - [ ] Performance <500ms p95 for queries
52
+ - [ ] Can handle 100 concurrent users
53
+ - [ ] No memory leaks
54
+ - [ ] Security audit passed
55
+
56
+ ---
57
+
58
+ ## Test Scenarios
59
+
60
+ ### Security Tests
61
+ 1. **User Isolation**
62
+ - User A creates memory
63
+ - User B searches → no results
64
+ - User B cannot access User A's memory ID
65
+
66
+ 2. **Trust Enforcement**
67
+ - User A grants User B trust 0.5
68
+ - User B accesses trust 0.8 memory → denied
69
+ - Trust reduced to 0.4
70
+ - After 3 attempts → blocked
71
+
72
+ 3. **Permission Bypass**
73
+ - Attempt to access without permission
74
+ - Attempt to escalate own trust
75
+ - Attempt GraphQL injection
76
+
77
+ ### Performance Tests
78
+ 1. **Query Latency**
79
+ - 1000 memories per user
80
+ - Search query latency
81
+ - RAG query latency
82
+ - Relationship query latency
83
+
84
+ 2. **Concurrent Users**
85
+ - 100 users simultaneously
86
+ - Each creates/searches memories
87
+ - Measure response times
88
+ - Check for race conditions
89
+
90
+ 3. **Memory Usage**
91
+ - Monitor memory over time
92
+ - Check for leaks
93
+ - Profile hot paths
94
+
95
+ ---
96
+
97
+ ## Key Files to Create
98
+
99
+ ```
100
+ tests/
101
+ ├── unit/
102
+ │ ├── tools/
103
+ │ │ ├── create-memory.test.ts
104
+ │ │ ├── search-memory.test.ts
105
+ │ │ └── ... (all tools)
106
+ │ ├── services/
107
+ │ │ ├── trust-enforcement.test.ts
108
+ │ │ └── template-suggestion.test.ts
109
+ │ └── utils/
110
+ ├── integration/
111
+ │ ├── user-isolation.test.ts
112
+ │ ├── cross-user-access.test.ts
113
+ │ ├── template-flow.test.ts
114
+ │ └── rag-with-relationships.test.ts
115
+ ├── security/
116
+ │ ├── isolation.test.ts
117
+ │ ├── trust-boundaries.test.ts
118
+ │ └── permission-bypass.test.ts
119
+ └── performance/
120
+ ├── query-latency.test.ts
121
+ ├── concurrent-users.test.ts
122
+ └── memory-profiling.test.ts
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Testing Tools
128
+
129
+ - Vitest for unit/integration tests
130
+ - Artillery or k6 for load testing
131
+ - Jest for mocking
132
+ - Supertest for HTTP testing
133
+
134
+ ---
135
+
136
+ **Next Milestone**: M9 - Deployment & Documentation
137
+ **Blockers**: M1-M7 must be complete and tested
@@ -0,0 +1,147 @@
1
+ # Milestone 9: Deployment & Documentation
2
+
3
+ **Goal**: Deploy to production and complete documentation
4
+ **Duration**: 1 week
5
+ **Dependencies**: M8 (Testing & Quality)
6
+ **Status**: Not Started
7
+
8
+ ---
9
+
10
+ ## Overview
11
+
12
+ Prepare for production deployment with Docker containerization, CI/CD pipeline, monitoring, and comprehensive documentation.
13
+
14
+ ---
15
+
16
+ ## Deliverables
17
+
18
+ ### 1. Containerization
19
+ - Dockerfile
20
+ - docker-compose.yml (with Weaviate)
21
+ - .dockerignore
22
+ - Multi-stage build optimization
23
+
24
+ ### 2. Deployment Configuration
25
+ - Environment variable management
26
+ - Secrets management (Google Secret Manager)
27
+ - Cloud Run configuration
28
+ - Health check endpoints
29
+
30
+ ### 3. CI/CD Pipeline
31
+ - GitHub Actions workflow
32
+ - Automated testing on PR
33
+ - Automated builds
34
+ - Automated deployment
35
+
36
+ ### 4. Monitoring & Logging
37
+ - Structured logging
38
+ - Error tracking (Sentry)
39
+ - Performance monitoring
40
+ - Usage analytics
41
+ - Dashboards
42
+
43
+ ### 5. Documentation
44
+ - API reference for all 24 tools
45
+ - User guide
46
+ - Deployment guide
47
+ - Architecture documentation
48
+ - Troubleshooting guide
49
+
50
+ ---
51
+
52
+ ## Success Criteria
53
+
54
+ - [ ] Docker image builds successfully
55
+ - [ ] Can deploy to Cloud Run
56
+ - [ ] Secrets managed securely
57
+ - [ ] CI/CD pipeline working
58
+ - [ ] Monitoring active
59
+ - [ ] Logs structured and searchable
60
+ - [ ] API documentation complete
61
+ - [ ] User guide clear and helpful
62
+
63
+ ---
64
+
65
+ ## Key Files to Create
66
+
67
+ ```
68
+ remember-mcp/
69
+ ├── Dockerfile
70
+ ├── docker-compose.yml
71
+ ├── .dockerignore
72
+ ├── cloudbuild.yaml
73
+ ├── .github/
74
+ │ └── workflows/
75
+ │ ├── test.yml
76
+ │ ├── build.yml
77
+ │ └── deploy.yml
78
+ ├── scripts/
79
+ │ ├── deploy.sh
80
+ │ └── setup-secrets.sh
81
+ └── docs/
82
+ ├── API.md
83
+ ├── USER_GUIDE.md
84
+ ├── DEPLOYMENT.md
85
+ ├── ARCHITECTURE.md
86
+ └── TROUBLESHOOTING.md
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Dockerfile
92
+
93
+ ```dockerfile
94
+ FROM node:20-alpine
95
+
96
+ WORKDIR /app
97
+
98
+ COPY package*.json ./
99
+ RUN npm ci --only=production
100
+
101
+ COPY dist ./dist
102
+
103
+ EXPOSE 3000
104
+
105
+ HEALTHCHECK --interval=30s --timeout=3s \
106
+ CMD node -e "require('http').get('http://localhost:3000/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"
107
+
108
+ CMD ["node", "dist/server.js"]
109
+ ```
110
+
111
+ ---
112
+
113
+ ## Monitoring
114
+
115
+ ### Metrics to Track
116
+ - Request latency (p50, p95, p99)
117
+ - Error rate
118
+ - Memory usage
119
+ - CPU usage
120
+ - Database query times
121
+ - User count
122
+ - Memory count per user
123
+ - Relationship count per user
124
+
125
+ ### Alerts
126
+ - Error rate > 1%
127
+ - Latency p95 > 500ms
128
+ - Memory usage > 80%
129
+ - Database connection failures
130
+
131
+ ---
132
+
133
+ ## Testing
134
+
135
+ - [ ] Docker build test
136
+ - [ ] Docker run test
137
+ - [ ] Health check test
138
+ - [ ] Deployment to staging
139
+ - [ ] Smoke tests in staging
140
+ - [ ] Load test in staging
141
+ - [ ] Deploy to production
142
+ - [ ] Smoke tests in production
143
+
144
+ ---
145
+
146
+ **Project Complete**: All milestones delivered
147
+ **Status**: Production Ready
File without changes