@prmichaelsen/remember-mcp 2.5.2 → 2.6.2

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.
@@ -17,7 +17,7 @@ import { handleToolError } from '../utils/error-handler.js';
17
17
  */
18
18
  export const querySpaceTool: Tool = {
19
19
  name: 'remember_query_space',
20
- description: 'Ask natural language questions about memories in shared spaces. Works like remember_query_memory but queries shared spaces.',
20
+ description: 'Ask natural language questions about memories in shared spaces. By default, excludes comments to focus on original content. Set include_comments: true to include discussions in answers.',
21
21
  inputSchema: {
22
22
  type: 'object',
23
23
  properties: {
@@ -25,11 +25,15 @@ export const querySpaceTool: Tool = {
25
25
  type: 'string',
26
26
  description: 'Natural language question',
27
27
  },
28
- space: {
29
- type: 'string',
30
- description: 'Which space to query',
31
- enum: SUPPORTED_SPACES,
32
- default: 'the_void',
28
+ spaces: {
29
+ type: 'array',
30
+ items: {
31
+ type: 'string',
32
+ enum: SUPPORTED_SPACES,
33
+ },
34
+ description: 'Spaces to query (e.g., ["the_void", "dogs"])',
35
+ minItems: 1,
36
+ default: ['the_void'],
33
37
  },
34
38
  content_type: {
35
39
  type: 'string',
@@ -54,6 +58,11 @@ export const querySpaceTool: Tool = {
54
58
  type: 'string',
55
59
  description: 'Filter memories created before this date (ISO 8601)',
56
60
  },
61
+ include_comments: {
62
+ type: 'boolean',
63
+ description: 'Include comments in query results (default: false)',
64
+ default: false,
65
+ },
57
66
  limit: {
58
67
  type: 'number',
59
68
  default: 10,
@@ -78,6 +87,7 @@ interface QuerySpaceArgs {
78
87
  min_weight?: number;
79
88
  date_from?: string;
80
89
  date_to?: string;
90
+ include_comments?: boolean;
81
91
  limit?: number;
82
92
  format?: 'detailed' | 'compact';
83
93
  }
@@ -134,6 +144,13 @@ export async function handleQuerySpace(
134
144
  filterList.push(publicCollection.filter.byProperty('type').equal(args.content_type));
135
145
  }
136
146
 
147
+ // Exclude comments by default (unless explicitly included)
148
+ if (!args.include_comments && !args.content_type) {
149
+ // Only exclude comments if not filtering by content_type
150
+ // (if content_type is set, user has explicit control)
151
+ filterList.push(publicCollection.filter.byProperty('type').notEqual('comment'));
152
+ }
153
+
137
154
  // Apply tags filter
138
155
  if (args.tags && args.tags.length > 0) {
139
156
  args.tags.forEach(tag => {
@@ -18,7 +18,7 @@ import type { SearchFilters } from '../types/memory.js';
18
18
  */
19
19
  export const searchSpaceTool: Tool = {
20
20
  name: 'remember_search_space',
21
- description: 'Search one or more shared spaces to discover thoughts, ideas, and memories. Works like remember_search_memory but searches shared spaces instead of personal memories. Can search multiple spaces in a single query.',
21
+ description: 'Search one or more shared spaces to discover thoughts, ideas, and memories. By default, excludes comments to keep discovery clean. Set include_comments: true to include threaded discussions. Can search multiple spaces in a single query.',
22
22
  inputSchema: {
23
23
  type: 'object',
24
24
  properties: {
@@ -65,6 +65,11 @@ export const searchSpaceTool: Tool = {
65
65
  type: 'string',
66
66
  description: 'Filter memories created before this date (ISO 8601)',
67
67
  },
68
+ include_comments: {
69
+ type: 'boolean',
70
+ description: 'Include comments in search results (default: false)',
71
+ default: false,
72
+ },
68
73
  limit: {
69
74
  type: 'number',
70
75
  default: 10,
@@ -89,6 +94,7 @@ interface SearchSpaceArgs {
89
94
  max_weight?: number;
90
95
  date_from?: string;
91
96
  date_to?: string;
97
+ include_comments?: boolean;
92
98
  limit?: number;
93
99
  offset?: number;
94
100
  }
@@ -150,6 +156,13 @@ export async function handleSearchSpace(
150
156
  filterList.push(publicCollection.filter.byProperty('type').equal(args.content_type));
151
157
  }
152
158
 
159
+ // Exclude comments by default (unless explicitly included)
160
+ if (!args.include_comments && !args.content_type) {
161
+ // Only exclude comments if not filtering by content_type
162
+ // (if content_type is set, user has explicit control)
163
+ filterList.push(publicCollection.filter.byProperty('type').notEqual('comment'));
164
+ }
165
+
153
166
  // Apply tags filter
154
167
  if (args.tags && args.tags.length > 0) {
155
168
  args.tags.forEach(tag => {
@@ -1,5 +1,6 @@
1
1
  import weaviate, { WeaviateClient } from 'weaviate-client';
2
2
  import { config } from '../config.js';
3
+ import { logger } from '../utils/logger.js';
3
4
 
4
5
  let client: WeaviateClient | null = null;
5
6
 
@@ -25,7 +26,10 @@ export async function initWeaviateClient(): Promise<WeaviateClient> {
25
26
  // Use appropriate connection method
26
27
  if (!isLocal) {
27
28
  // Use connectToWeaviateCloud() for ALL remote instances (cloud or self-hosted)
28
- console.log('[Weaviate] Connecting to remote Weaviate:', weaviateUrl);
29
+ logger.info('Connecting to remote Weaviate', {
30
+ module: 'weaviate-client',
31
+ url: weaviateUrl,
32
+ });
29
33
  client = await weaviate.connectToWeaviateCloud(weaviateUrl, {
30
34
  authCredentials: config.weaviate.apiKey
31
35
  ? new weaviate.ApiKey(config.weaviate.apiKey)
@@ -36,7 +40,10 @@ export async function initWeaviateClient(): Promise<WeaviateClient> {
36
40
  });
37
41
  } else {
38
42
  // connectToLocal() for localhost only
39
- console.log('[Weaviate] Connecting to local Weaviate:', weaviateUrl);
43
+ logger.info('Connecting to local Weaviate', {
44
+ module: 'weaviate-client',
45
+ url: weaviateUrl,
46
+ });
40
47
  const localConfig: any = {
41
48
  host: weaviateUrl.replace(/^https?:\/\//, '').split(':')[0],
42
49
  port: weaviateUrl.includes(':')
@@ -56,7 +63,10 @@ export async function initWeaviateClient(): Promise<WeaviateClient> {
56
63
  client = await weaviate.connectToLocal(localConfig);
57
64
  }
58
65
 
59
- console.log('[Weaviate] Client initialized successfully');
66
+ logger.info('Weaviate client initialized successfully', {
67
+ module: 'weaviate-client',
68
+ isLocal,
69
+ });
60
70
  return client;
61
71
  }
62
72
 
@@ -77,10 +87,16 @@ export async function testWeaviateConnection(): Promise<boolean> {
77
87
  try {
78
88
  const weaviateClient = getWeaviateClient();
79
89
  const isReady = await weaviateClient.isReady();
80
- console.log('[Weaviate] Connection successful, ready:', isReady);
90
+ logger.info('Weaviate connection test successful', {
91
+ module: 'weaviate-client',
92
+ isReady,
93
+ });
81
94
  return isReady;
82
95
  } catch (error) {
83
- console.error('[Weaviate] Connection failed:', error);
96
+ logger.error('Weaviate connection test failed', {
97
+ module: 'weaviate-client',
98
+ error: error instanceof Error ? error.message : String(error),
99
+ });
84
100
  return false;
85
101
  }
86
102
  }
@@ -132,7 +148,11 @@ export async function collectionExists(collectionName: string): Promise<boolean>
132
148
  const exists = await weaviateClient.collections.exists(collectionName);
133
149
  return exists;
134
150
  } catch (error) {
135
- console.error(`[Weaviate] Error checking collection ${collectionName}:`, error);
151
+ logger.error('Error checking collection existence', {
152
+ module: 'weaviate-client',
153
+ collectionName,
154
+ error: error instanceof Error ? error.message : String(error),
155
+ });
136
156
  return false;
137
157
  }
138
158
  }
@@ -144,6 +164,8 @@ export async function closeWeaviateClient(): Promise<void> {
144
164
  if (client) {
145
165
  // Weaviate client doesn't have explicit close method
146
166
  client = null;
147
- console.log('[Weaviate] Client closed');
167
+ logger.info('Weaviate client closed', {
168
+ module: 'weaviate-client',
169
+ });
148
170
  }
149
171
  }
@@ -6,6 +6,7 @@
6
6
  import weaviate, { WeaviateClient } from 'weaviate-client';
7
7
  import { getWeaviateClient, sanitizeUserId } from './client.js';
8
8
  import { config } from '../config.js';
9
+ import { logger } from '../utils/logger.js';
9
10
 
10
11
  /**
11
12
  * Create Memory collection schema for a user
@@ -25,11 +26,17 @@ export async function createMemoryCollection(userId: string): Promise<void> {
25
26
  // Check if collection already exists
26
27
  const exists = await client.collections.exists(collectionName);
27
28
  if (exists) {
28
- console.log(`[Weaviate] Collection ${collectionName} already exists`);
29
+ logger.debug('Collection already exists', {
30
+ module: 'weaviate-schema',
31
+ collectionName,
32
+ });
29
33
  return;
30
34
  }
31
35
 
32
- console.log(`[Weaviate] Creating collection ${collectionName}...`);
36
+ logger.info('Creating memory collection', {
37
+ module: 'weaviate-schema',
38
+ collectionName,
39
+ });
33
40
 
34
41
  // Create collection with schema
35
42
  await client.collections.create({
@@ -243,10 +250,30 @@ export async function createMemoryCollection(userId: string): Promise<void> {
243
250
  dataType: 'number' as any,
244
251
  description: 'Calculated effective weight',
245
252
  },
253
+
254
+ // Comment/threading fields (for threaded discussions in shared spaces)
255
+ {
256
+ name: 'parent_id',
257
+ dataType: 'text' as any,
258
+ description: 'ID of parent memory or comment (for threading)',
259
+ },
260
+ {
261
+ name: 'thread_root_id',
262
+ dataType: 'text' as any,
263
+ description: 'Root memory ID for fetching entire thread',
264
+ },
265
+ {
266
+ name: 'moderation_flags',
267
+ dataType: 'text[]' as any,
268
+ description: 'Per-space moderation flags (format: "{space_id}:{flag_type}")',
269
+ },
246
270
  ],
247
271
  });
248
272
 
249
- console.log(`[Weaviate] Collection ${collectionName} created successfully`);
273
+ logger.info('Memory collection created successfully', {
274
+ module: 'weaviate-schema',
275
+ collectionName,
276
+ });
250
277
  }
251
278
 
252
279
  /**
@@ -283,6 +310,9 @@ export async function deleteMemoryCollection(userId: string): Promise<void> {
283
310
 
284
311
  if (exists) {
285
312
  await client.collections.delete(collectionName);
286
- console.log(`[Weaviate] Collection ${collectionName} deleted`);
313
+ logger.info('Memory collection deleted', {
314
+ module: 'weaviate-schema',
315
+ collectionName,
316
+ });
287
317
  }
288
318
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Weaviate space collection schema and utilities
3
- *
3
+ *
4
4
  * Manages shared space collections where users can publish memories
5
5
  * for discovery by other users.
6
6
  */
@@ -8,6 +8,7 @@
8
8
  import weaviate, { type WeaviateClient, type Collection } from 'weaviate-client';
9
9
  import { config } from '../config.js';
10
10
  import { SUPPORTED_SPACES, type SpaceId } from '../types/space-memory.js';
11
+ import { logger } from '../utils/logger.js';
11
12
 
12
13
  /**
13
14
  * Unified public collection name for all public spaces
@@ -83,7 +84,11 @@ async function createSpaceCollection(
83
84
  ? PUBLIC_COLLECTION_NAME
84
85
  : getSpaceCollectionName(spaceId);
85
86
 
86
- console.log(`[Weaviate] Creating space collection ${collectionName}...`);
87
+ logger.info('Creating space collection', {
88
+ module: 'weaviate-space-schema',
89
+ collectionName,
90
+ spaceId,
91
+ });
87
92
 
88
93
  // Create collection with schema (same as Memory schema but for spaces)
89
94
  await client.collections.create({
@@ -251,10 +256,30 @@ async function createSpaceCollection(
251
256
  dataType: 'number' as any,
252
257
  description: 'Version number (increments on update)',
253
258
  },
259
+
260
+ // Comment/threading fields (for threaded discussions in shared spaces)
261
+ {
262
+ name: 'parent_id',
263
+ dataType: 'text' as any,
264
+ description: 'ID of parent memory or comment (for threading)',
265
+ },
266
+ {
267
+ name: 'thread_root_id',
268
+ dataType: 'text' as any,
269
+ description: 'Root memory ID for fetching entire thread',
270
+ },
271
+ {
272
+ name: 'moderation_flags',
273
+ dataType: 'text[]' as any,
274
+ description: 'Per-space moderation flags (format: "{space_id}:{flag_type}")',
275
+ },
254
276
  ],
255
277
  });
256
278
 
257
- console.log(`[Weaviate] Space collection ${collectionName} created successfully`);
279
+ logger.info('Space collection created successfully', {
280
+ module: 'weaviate-space-schema',
281
+ collectionName,
282
+ });
258
283
  }
259
284
 
260
285
  /**