{"record":{"id":"d6e8373cc7456bb1","repo":"n8n-io/n8n","slug":"episodic-memory-requires-a-resolved-embedding-mode","errorCode":null,"errorMessage":"Episodic memory requires a resolved embedding model before runtime use.","messagePattern":"Episodic memory requires a resolved embedding model before runtime use\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/@n8n/agents/src/runtime/memory/episodic-memory.ts","lineNumber":108,"sourceCode":"\tmemory: BuiltMemory,\n): memory is BuiltMemory & BuiltEpisodicMemoryStore {\n\tconst episodic = memory.episodic;\n\treturn (\n\t\tepisodic !== undefined &&\n\t\ttypeof episodic.saveEntryWithSources === 'function' &&\n\t\ttypeof episodic.searchEntries === 'function' &&\n\t\ttypeof episodic.getEntrySources === 'function' &&\n\t\ttypeof episodic.applyReflection === 'function' &&\n\t\ttypeof episodic.getCursor === 'function' &&\n\t\ttypeof episodic.setCursor === 'function'\n\t);\n}\n\nexport function withEpisodicMemoryDefaults(\n\tconfig: EpisodicMemoryConfig,\n): NormalizedEpisodicMemoryConfig {\n\tif (!config.embedder) {\n\t\tthrow new Error('Episodic memory requires a resolved embedding model before runtime use.');\n\t}\n\n\treturn {\n\t\ttopK: config.topK ?? DEFAULT_EPISODIC_MEMORY_TOP_K,\n\t\tmaxEntriesPerRun: config.maxEntriesPerRun ?? DEFAULT_EPISODIC_MEMORY_MAX_ENTRIES_PER_RUN,\n\t\tembedder: config.embedder,\n\t\tembeddingModel: config.embeddingModel ?? 'custom',\n\t\textract: config.extract,\n\t\treflect: config.reflect,\n\t\trecallToolInstruction:\n\t\t\tconfig.prompts?.recallToolInstruction ?? DEFAULT_EPISODIC_MEMORY_RECALL_TOOL_INSTRUCTION,\n\t};\n}\n\nexport async function runEpisodicMemoryIndexer(\n\topts: RunEpisodicMemoryIndexerOpts,\n): Promise<RunEpisodicMemoryIndexerResult> {\n\tif (!isEpisodicMemoryEnabled(opts.config)) return { status: 'skipped', reason: 'disabled' };","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/agents/src/runtime/memory/episodic-memory.ts#L90-L126","documentation":"Warning thrown by the Set node validator when an assignment's name matches a credential-like pattern (api_key, token, secret, password, credentials, auth, etc.). Storing secrets as plain Set fields leaks them into the execution data and workflow JSON instead of the encrypted credential store.","triggerScenarios":"For a record assignment, isNonEmptyString(assignment.name) && isCredentialFieldName(assignment.name) is true. The regex set matches api_key/access_token/auth_token/bearer_token/secret_key/private_key/client_secret/password/credentials, or exactly token/secret/auth.","commonSituations":"An AI builder sets a field named 'api_key' or 'token' to pass a secret downstream; a workaround that avoided creating a credential; copying field names from a vendor payload.","solutions":["Move the secret into an n8n credential and reference it from the consuming node instead of a Set field.","Rename the field to something non-credential-like if it is not actually a secret (e.g. 'tokenCount').","If it genuinely must be a field, confirm it holds no real secret before suppressing."],"exampleFix":"// before\nset({\n  name: 'Config',\n  assignments: {\n    assignments: [{ id: '1', name: 'api_key', value: 'live_key', type: 'string' }],\n  },\n});\n\n// after — store the secret in a credential, reference a non-secret field name\nset({\n  name: 'Config',\n  assignments: {\n    assignments: [{ id: '1', name: 'region', value: 'us', type: 'string' }],\n  },\n});","handlingStrategy":"validation","validationCode":"import { isCredentialFieldName } from './validation-helpers';\n\nfunction findCredentialFieldAssignments(items: Array<{ name?: string }>): string[] {\n  return items.filter((i) => typeof i.name === 'string' && isCredentialFieldName(i.name)).map((i) => i.name!);\n}\n\nconst risky = findCredentialFieldAssignments(assignmentItems);\nif (risky.length) throw new Error(`Rename or move to credentials: ${risky.join(', ')}`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never store real secrets in Set fields; use the credential system.","Avoid credential-like field names (api_key, token, secret) for non-secrets.","Scan generated assignments for credential-like names before persisting."],"tags":["security","credentials","set-node","assignments"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}