supermemoryai/supermemory · info

Advanced search parameters (threshold, limit, rerank, rewrit

Error message

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.

What it means

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.

Source

Thrown at packages/tools/src/voltagent/middleware.ts:250

		role: msg.role,
		content: msg.content,
	}))

	const queryText = extractQueryText(genericMessages, ctx.mode)

	const useAdvancedSearch =
		ctx.threshold !== undefined ||
		ctx.limit !== undefined ||
		ctx.rerank !== undefined ||
		ctx.rewriteQuery !== undefined ||
		ctx.filters !== undefined ||
		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") {
		ctx.logger.info("Using advanced search with custom parameters")

		const searchParams: {
			q: string
			containerTag: string
			threshold?: number
			limit?: number
			rerank?: boolean
			rewriteQuery?: boolean
			filters?: { OR: Array<unknown> } | { AND: Array<unknown> }

View on GitHub (pinned to d436792e77)

Solutions

  1. Switch mode to 'query' or 'full' if you actually want the advanced search parameters honored
  2. Remove the unused parameters (threshold, limit, rerank, rewriteQuery, filters, include, searchMode) when staying in 'profile' mode
  3. Audit config objects shared across agents so profile-mode agents don't inherit search options

Example fix

// before
new SupermemoryMiddleware({
  mode: 'profile',
  threshold: 0.5,
  limit: 10,
})

// after
new SupermemoryMiddleware({
  mode: 'query',
  threshold: 0.5,
  limit: 10,
})
Defensive patterns

Strategy: validation

Validate before calling

const ADVANCED = ['threshold','limit','rerank','rewriteQuery','filters','include','searchMode'] as const;
const hasAdvanced = (o: Record<string, unknown>) => ADVANCED.some(k => o[k] !== undefined);
if (config.mode === 'profile' && hasAdvanced(config)) {
  // fix config: change mode or drop advanced params before constructing middleware
}

Type guard

type AdvancedKey = 'threshold'|'limit'|'rerank'|'rewriteQuery'|'filters'|'include'|'searchMode';
const isProfileWithAdvanced = (c: { mode?: string } & Partial<Record<AdvancedKey, unknown>>): boolean =>
  c.mode === 'profile' && ADVANCED.some(k => c[k] !== undefined);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of supermemoryai/supermemory@d436792e77 (2026-08-28). Data as JSON: /api/errors/87a9598555ec0682. Report an issue: GitHub.