diff --git a/packages/tools/package.json b/packages/tools/package.json index cfaf5fd8..b69ac16f 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,7 +1,7 @@ { "name": "@supermemory/tools", "type": "module", - "version": "1.4.6", + "version": "1.4.7", "description": "Memory tools for AI SDK, OpenAI, Voltagent and Mastra with supermemory", "scripts": { "build": "tsdown", diff --git a/packages/tools/src/voltagent/middleware.ts b/packages/tools/src/voltagent/middleware.ts index 3618b241..bf771726 100644 --- a/packages/tools/src/voltagent/middleware.ts +++ b/packages/tools/src/voltagent/middleware.ts @@ -90,6 +90,7 @@ export const createSupermemoryContext = ( metadata, searchMode, entityContext, + verbose = false, } = options // Runtime validation: customId is required @@ -99,7 +100,7 @@ export const createSupermemoryContext = ( ) } - const logger = createLogger(false) // VoltAgent SDK doesn't use verbose + const logger = createLogger(verbose) const normalizedBaseUrl = normalizeBaseUrl(baseUrl) const client = new Supermemory({ @@ -243,6 +244,15 @@ export const enhanceMessagesWithMemories = async ( ctx.include !== undefined || ctx.searchMode !== undefined + // Warn if advanced search params are set but mode is "profile" + // Profile mode only fetches static/dynamic user data, not query-based search + if (useAdvancedSearch && ctx.mode === "profile") { + ctx.logger.warn( + "Advanced search parameters (threshold, limit, rerank, rewriteQuery, filters, include, searchMode) " + + 'are ignored when mode is "profile". Use mode "query" or "full" to enable advanced search.', + ) + } + let memories: string if (useAdvancedSearch && ctx.mode !== "profile") { diff --git a/packages/tools/src/voltagent/types.ts b/packages/tools/src/voltagent/types.ts index 9ee9ebc7..cc5350ea 100644 --- a/packages/tools/src/voltagent/types.ts +++ b/packages/tools/src/voltagent/types.ts @@ -17,8 +17,7 @@ import type { * Configuration options for the Supermemory VoltAgent integration. * Extends base options with VoltAgent-specific settings. */ -export interface SupermemoryVoltAgent - extends Omit { +export interface SupermemoryVoltAgent extends SupermemoryBaseOptions { /** * Custom ID to group messages into a single document. * Ensures related messages are added to the same document for that conversation. @@ -29,34 +28,46 @@ export interface SupermemoryVoltAgent * Threshold / sensitivity for memory selection. 0 is least sensitive (returns * most memories, more results), 1 is most sensitive (returns fewer memories, * more accurate results). Default: 0.1 + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ threshold?: number /** * Maximum number of memory results to return. Default: 10 + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ limit?: number /** * If true, rerank the results based on the query. This helps ensure the most * relevant results are returned. Default: false + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ rerank?: boolean /** * If true, rewrites the query to make it easier to find memories. This increases * latency by about 400ms. Default: false + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ rewriteQuery?: boolean /** * Advanced filters to apply to the search using AND/OR logic. * Example: { OR: [{ metadata: { type: "note" } }, { metadata: { type: "conversation" } }] } + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ filters?: SearchFilters /** * Control what additional data to include in search results + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ include?: IncludeOptions @@ -71,6 +82,8 @@ export interface SupermemoryVoltAgent * - "memories": Search only memory entries (atomic facts) * - "documents": Search only document chunks * - "hybrid": Search both memories AND document chunks (recommended) + * + * Note: Only effective when mode is "query" or "full". Ignored in "profile" mode. */ searchMode?: "memories" | "documents" | "hybrid"