mastra-ai/mastra · error · Error

Subconscious semantic knowledge requires an embedder. Pass a

Error message

Subconscious semantic knowledge requires an embedder. Pass an `embedder` option to Memory.

What it means

The experimental_subconscious embeds knowledge for semantic lookup, so besides a vector store it requires an embedder. The Memory constructor checks `this.embedder` when `experimental_subconscious` is configured and throws if it is missing.

Source

Thrown at packages/memory/src/index.ts:519

    const omConfig = normalizeObservationalMemoryConfig(mergedConfig.observationalMemory);
    if (omConfig?.retrieval && typeof omConfig.retrieval === 'object' && omConfig.retrieval.vector) {
      if (!this.vector) {
        throw new Error(
          '`retrieval: { vector: true }` requires a vector store. Pass a `vector` option to your Memory instance.',
        );
      }
      if (!this.embedder) {
        throw new Error(
          '`retrieval: { vector: true }` requires an embedder. Pass an `embedder` option to your Memory instance.',
        );
      }
    }
    if (omConfig?.experimental_subconscious) {
      if (!this.vector) {
        throw new Error('Subconscious semantic knowledge requires a vector store. Pass a `vector` option to Memory.');
      }
      if (!this.embedder) {
        throw new Error('Subconscious semantic knowledge requires an embedder. Pass an `embedder` option to Memory.');
      }
    }
  }

  private async getKnowledgeStore(): Promise<KnowledgeStorage> {
    const store = await this.storage.getStore('knowledge');
    if (!store) {
      throw new Error(`Knowledge storage domain is not available on ${this.storage.constructor.name}`);
    }
    return store;
  }

  public async getKnowledgeSemanticIndex(): Promise<KnowledgeSemanticIndexCoordinator> {
    if (!this.vector || !this.embedder) {
      throw new Error('Subconscious semantic knowledge requires both a vector store and an embedder.');
    }
    this._knowledgeSemanticIndex ??= this.getKnowledgeStore().then(
      knowledge =>

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Pass an `embedder` option (e.g. FastEmbed, OpenAI embeddings) to the Memory constructor
  2. Remove experimental_subconscious if not needed
  3. Verify embedder credentials/model name are valid for the provider

Example fix

// before
new Memory({ vector, options: { observationalMemory: { experimental_subconscious: sub } } })
// after
new Memory({ vector, embedder: new FastEmbed(), options: { observationalMemory: { experimental_subconscious: sub } } })
Defensive patterns

Strategy: validation

Validate before calling

if (opts.options?.observationalMemory?.experimental_subconscious && !opts.embedder) {
  throw new Error('experimental_subconscious requires an embedder option on Memory');
}

Try / catch

try {
  const memory = new Memory(opts);
} catch (err) {
  if (err instanceof Error && err.message.includes('requires an embedder')) {
    // add embedder and rebuild Memory
  } else throw err;
}

Prevention

When it happens

Trigger: `new Memory({ vector, options: { observationalMemory: { experimental_subconscious: new Subconscious({...}) } } })` constructed with a vector store but no `embedder` option.

Common situations: Vector store added but embedder omitted when enabling the subconscious; embedder removed during refactoring while the subconscious stayed enabled; assuming subconscious uses the agent's LLM instead of a dedicated embedding model.

Related errors


AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30). Data as JSON: /api/errors/4bbc0e52ddc01196. Report an issue: GitHub.