mastra-ai/mastra · error · Error
Subconscious semantic knowledge requires a vector store. Pas
Error message
Subconscious semantic knowledge requires a vector store. Pass a `vector` option to Memory.
What it means
The experimental_subconscious feature stores and queries semantic knowledge, which fundamentally requires a vector store. The Memory constructor validates this eagerly: if `observationalMemory.experimental_subconscious` is set but no `vector` option was provided, construction fails with this error.
Source
Thrown at packages/memory/src/index.ts:516
this.threadConfig = mergedConfig;
// Validate retrieval vector config at construction time
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.');View on GitHub (pinned to 75dd419e61)
Solutions
- Add a `vector` option (e.g. LibSQLVector, PGVector) to the Memory constructor
- Disable experimental_subconscious if semantic knowledge features are not required
- Provision and connect a vector store dependency before enabling the feature
Example fix
// before
new Memory({ storage, options: { observationalMemory: { experimental_subconscious: new Subconscious({ model }) } } })
// after
new Memory({ storage, vector: new LibSQLVector({ connectionUrl: url }), options: { observationalMemory: { experimental_subconscious: new Subconscious({ model }) } } }) Defensive patterns
Strategy: validation
Validate before calling
if (opts.options?.observationalMemory?.experimental_subconscious && !opts.vector) {
throw new Error('experimental_subconscious requires a vector option on Memory');
} Try / catch
try {
const memory = new Memory(opts);
} catch (err) {
if (err instanceof Error && err.message.includes('Subconscious semantic knowledge requires a vector store')) {
// add vector store and rebuild
} else throw err;
} Prevention
- Enable experimental_subconscious only after vector storage is set up
- Centralize Memory construction so required pairs (vector/embedder/subconscious) are enforced
- Keep feature flags for experimental features aligned with infrastructure availability
- Validate the full option set with a schema before constructing Memory
When it happens
Trigger: `new Memory({ options: { observationalMemory: { experimental_subconscious: new Subconscious({...}) } } })` without a `vector` option in Memory constructor options.
Common situations: Enabling the experimental subconscious in a memory configured only with relational storage; following older examples that predate the vector requirement; toggling the feature on in an environment without vector storage provisioned.
Related errors
- `retrieval: { vector: true }` requires a vector store. Pass
- Subconscious semantic knowledge requires an embedder. Pass a
- Subconscious ${phase} agent name is required.
- Duplicate Subconscious ${phase} agent: ${name}
- Subconscious maxSteps must be an integer between 1 and ${MAX
AI-assisted analysis of mastra-ai/mastra@75dd419e61 (2026-08-30).
Data as JSON: /api/errors/1941195ab3a5ec42.
Report an issue: GitHub.