mastra-ai/mastra · error

Subconscious curate requires a configured knowledge storage

Error message

Subconscious curate requires a configured knowledge storage domain.

What it means

The subconscious curate handler needs a 'knowledge' storage domain registered on the memory instance's storage to persist its worklist and curation cursor. Before doing any curation work it calls memory.storage.getStore('knowledge'); if no such store is configured it throws immediately. This guards against running curation against a storage backend that cannot hold KnowledgeRecords.

Source

Thrown at packages/memory/src/processors/observational-memory/subconscious/curate.ts:76

  return { records, hasMore: Boolean(cursor) };
}

export function createCuratorHandler(
  memory: Memory,
  subconscious: ResolvedSubconsciousConfig,
  curatorMemory = memory,
  options?: { omModel?: ObservationalMemoryModel },
): (context: ReflectionCommittedContext) => Promise<'ran' | 'no-op'> {
  const config = subconscious.reflection.find(agent => agent.name === CURATION_AGENT);
  if (!config) return async () => 'no-op';

  return async context => {
    let store: KnowledgeStorage | undefined;
    let scope: KnowledgeScope | undefined;
    try {
      scope = resolveScope(context);
      store = await memory.storage.getStore('knowledge');
      if (!store) throw new Error('Subconscious curate requires a configured knowledge storage domain.');

      const cursor = await store.getCurationCursor({ sourceThreadId: context.parentThreadId, agent: CURATION_AGENT });
      const worklist = await readWorklist(store, context.parentThreadId, scope, cursor?.lastKnowledgeId);
      if (!worklist.records.length && !context.observations.trim()) return 'no-op';

      const agent = await createCuratorAgent(
        memory,
        curatorMemory,
        context,
        scope,
        config,
        subconscious,
        options?.omModel,
      );
      const result = await agent.generate(
        `Parent thread: ${context.parentThreadId}\nCurrent time: ${new Date().toISOString()}\nWorklist truncated: ${worklist.hasMore}\n\nCommitted pre-reflection observations:\n${context.observations}\n\nNew KnowledgeRecord worklist:\n${JSON.stringify(worklist.records)}`,
        {
          requestContext: context.requestContext,

View on GitHub (pinned to 75dd419e61)

Solutions

  1. Register a knowledge store on the memory storage backend (storage.addStore / equivalent for domain 'knowledge') before enabling curate.
  2. Verify with await memory.storage.getStore('knowledge') at startup that the store resolves.
  3. Disable the curate phase in the Subconscious config if knowledge storage is not intended to be used.

Example fix

// before
new Memory({ storage }) // no knowledge store
// after
const storage = new LibsqlStore({ url });
storage.addStore?.('knowledge', new KnowledgeStorageAdapter());
new Memory({ storage });
Defensive patterns

Strategy: validation

Validate before calling

const store = await memory.storage.getStore('knowledge');
if (!store) throw new Error('Enable knowledge storage before running subconscious curate.');

Type guard

function hasKnowledgeStore(s: unknown): s is KnowledgeStorage {
  return !!s && typeof (s as KnowledgeStorage).getCurationCursor === 'function';
}

Try / catch

try {
  await curate(context);
} catch (err) {
  if (err.message.includes('knowledge storage domain')) {
    logger.warn('curate skipped: no knowledge storage configured');
  } else throw err;
}

Prevention

When it happens

Trigger: Calling the curate processor (via handler/curate) when memory.storage has no store registered under the 'knowledge' domain, e.g. using a default storage adapter that never had a knowledge store added.

Common situations: Enabling the subconscious curate phase in observational-memory config without configuring knowledge storage; switching storage adapters and forgetting to register the knowledge store; running against in-memory/legacy storage that lacks the knowledge domain.

Related errors


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