n8n-io/n8n · error · Error

Episodic memory requires a storage backend that implements B

Error message

Episodic memory requires a storage backend that implements BuiltEpisodicMemoryStore.

What it means

Thrown from normalizeMemoryConfig when episodic memory is enabled but the configured backend does not implement BuiltEpisodicMemoryStore. Capability is detected by hasEpisodicMemoryStore, which inspects memory.episodic for saveEntryWithSources, searchEntries, getEntrySources, applyReflection, getCursor, setCursor.

Source

Thrown at packages/@n8n/agents/src/sdk/memory.ts:128

		config.observationalMemory.renderTokenBudget === undefined
			? {
					...config.observationalMemory,
					renderTokenBudget: config.observationLog.renderTokenBudget,
				}
			: config.observationalMemory;
	const observationalMemory = resolveObservationalMemoryConfig(observationalMemoryConfig, options);

	return normalizeMemoryConfig({
		...config,
		memory: config.memory,
		observationalMemory,
		episodicMemory,
	});
}

export function normalizeMemoryConfig(config: MemoryConfig): MemoryConfig {
	if (isEpisodicMemoryEnabled(config.episodicMemory) && !hasEpisodicMemoryStore(config.memory)) {
		throw new Error(
			'Episodic memory requires a storage backend that implements BuiltEpisodicMemoryStore.',
		);
	}

	if (!config.observationalMemory) {
		return config;
	}

	if (!hasObservationLogStore(config.memory)) {
		throw new Error(
			'Observational memory requires a storage backend that implements BuiltObservationLogStore.',
		);
	}

	return {
		...config,
		observationLog: {
			...config.observationLog,

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Use InMemoryMemory (default) which implements BuiltEpisodicMemoryStore.
  2. Implement memory.episodic with all six required methods on your backend.
  3. Drop .episodicMemory() if your backend cannot support it.

Example fix

// before
const mem = new Memory().storage(customThreadsOnly).episodicMemory({});
// after
const mem = new Memory().storage('memory').episodicMemory({});
Defensive patterns

Strategy: type-guard

Validate before calling

import { hasEpisodicMemoryStore, isEpisodicMemoryEnabled } from '@n8n/agents/runtime/memory/episodic-memory';

if (isEpisodicMemoryEnabled(config.episodicMemory) && !hasEpisodicMemoryStore(config.memory)) {
  throw new Error('episodic memory needs a BuiltEpisodicMemoryStore backend');
}

Type guard

import { hasEpisodicMemoryStore } from '@n8n/agents/runtime/memory/episodic-memory';

function supportsEpisodicMemory(m: BuiltMemory): boolean {
  return hasEpisodicMemoryStore(m);
}

Prevention

When it happens

Trigger: Calling Memory.episodicMemory({ enabled: true }) (or any non-disabled config) on a Memory builder whose storage backend lacks the episodic methods, then triggering normalization.

Common situations: Custom persistent backend that implements threads/messages but not the .episodic namespace; enabling episodic memory against an older backend written before episodic support; mis-typed backend where memory.episodic is undefined.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/262d0aa16601a1dc. Report an issue: GitHub.