Skip to content

Extractor

A named, typed, structured thing to learn from a conversation. Always schema-driven — no Mastra-style tag-scraping inline mode.

Type Parameter Default type

T

unknown

readonly includePrevious: boolean;

Include the previously extracted value in the prompt. Default true.


readonly instructions: string | ((c) => string | Promise<string>);

readonly name: string;

readonly optional onExtracted?: (c) => void | T | Promise<void | T>;

Interceptor: returning a value replaces it before persistence; throwing records a per-slug failure.

Parameter Type

c

ExtractorOnExtractedContext<T>

void | T | Promise<void | T>


readonly persist: boolean;

Persist to PersistentMemoryStore. false = emit + run onExtracted only. Default true.


readonly schema:
| ZodType<T, unknown, $ZodTypeInternals<T, unknown>>
| ((c) =>
| ZodType<T, unknown, $ZodTypeInternals<T, unknown>>
| Promise<ZodType<T, unknown, $ZodTypeInternals<T, unknown>>>);

readonly scope: MemoryBlockScope;

readonly slug: string;

Derived from name via slugifyExtractorName.