{"record":{"id":"87a9598555ec0682","repo":"supermemoryai/supermemory","slug":"advanced-search-parameters-threshold-limit-rera","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"packages/tools/src/voltagent/middleware.ts","lineNumber":250,"sourceCode":"\t\trole: msg.role,\n\t\tcontent: msg.content,\n\t}))\n\n\tconst queryText = extractQueryText(genericMessages, ctx.mode)\n\n\tconst useAdvancedSearch =\n\t\tctx.threshold !== undefined ||\n\t\tctx.limit !== undefined ||\n\t\tctx.rerank !== undefined ||\n\t\tctx.rewriteQuery !== undefined ||\n\t\tctx.filters !== undefined ||\n\t\tctx.include !== undefined ||\n\t\tctx.searchMode !== undefined\n\n\t// Warn if advanced search params are set but mode is \"profile\"\n\t// Profile mode only fetches static/dynamic user data, not query-based search\n\tif (useAdvancedSearch && ctx.mode === \"profile\") {\n\t\tctx.logger.warn(\n\t\t\t\"Advanced search parameters (threshold, limit, rerank, rewriteQuery, filters, include, searchMode) \" +\n\t\t\t\t'are ignored when mode is \"profile\". Use mode \"query\" or \"full\" to enable advanced search.',\n\t\t)\n\t}\n\n\tlet memories: string\n\n\tif (useAdvancedSearch && ctx.mode !== \"profile\") {\n\t\tctx.logger.info(\"Using advanced search with custom parameters\")\n\n\t\tconst searchParams: {\n\t\t\tq: string\n\t\t\tcontainerTag: string\n\t\t\tthreshold?: number\n\t\t\tlimit?: number\n\t\t\trerank?: boolean\n\t\t\trewriteQuery?: boolean\n\t\t\tfilters?: { OR: Array<unknown> } | { AND: Array<unknown> }","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/supermemoryai/supermemory/blob/d436792e777a99865939dd543c8d1a16d57f54ec/packages/tools/src/voltagent/middleware.ts#L232-L268","documentation":"Warned when the VoltAgent Supermemory middleware is configured with mode: 'profile' while also supplying advanced search parameters (threshold, limit, rerank, rewriteQuery, filters, include, searchMode). Profile mode only fetches static/dynamic user profile data and never runs query-based search, so those parameters have no effect. The call succeeds but advanced options are silently ignored.","triggerScenarios":"Creating the middleware with mode 'profile' together with any of: threshold, limit, rerank, rewriteQuery, filters, include, or searchMode set. Typical copy-paste from a 'query'/'full' config where the mode was later changed to 'profile' without removing the search options.","commonSituations":"Migrating from search-based retrieval to profile-only enrichment and forgetting to strip search options; default config templates that pre-fill threshold/limit; misunderstanding that 'profile' mode is not a superset of 'query' mode.","solutions":["Switch mode to 'query' or 'full' if you actually want the advanced search parameters honored","Remove the unused parameters (threshold, limit, rerank, rewriteQuery, filters, include, searchMode) when staying in 'profile' mode","Audit config objects shared across agents so profile-mode agents don't inherit search options"],"exampleFix":"// before\nnew SupermemoryMiddleware({\n  mode: 'profile',\n  threshold: 0.5,\n  limit: 10,\n})\n\n// after\nnew SupermemoryMiddleware({\n  mode: 'query',\n  threshold: 0.5,\n  limit: 10,\n})","handlingStrategy":"validation","validationCode":"const ADVANCED = ['threshold','limit','rerank','rewriteQuery','filters','include','searchMode'] as const;\nconst hasAdvanced = (o: Record<string, unknown>) => ADVANCED.some(k => o[k] !== undefined);\nif (config.mode === 'profile' && hasAdvanced(config)) {\n  // fix config: change mode or drop advanced params before constructing middleware\n}","typeGuard":"type AdvancedKey = 'threshold'|'limit'|'rerank'|'rewriteQuery'|'filters'|'include'|'searchMode';\nconst isProfileWithAdvanced = (c: { mode?: string } & Partial<Record<AdvancedKey, unknown>>): boolean =>\n  c.mode === 'profile' && ADVANCED.some(k => c[k] !== undefined);","tryCatchPattern":null,"preventionTips":["Keep one config per retrieval mode; don't share search options with profile-mode agents","Add a startup assertion rejecting profile+advanced combinations","Document in team conventions that profile mode ignores search parameters"],"tags":["typescript","voltagent","configuration","middleware","no-op-options"],"backgroundTag":"ignored-configuration-options","analyzedSha":"d436792e777a99865939dd543c8d1a16d57f54ec","analyzedAt":"2026-08-28T18:04:46.947Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}