By Paul Scanlon

Introducing Memory Extractors for Mastra Agents

You can now extract data from your agent’s conversations using a memory extractor. Give an Extractor instructions and persist defined information to send to downstream services, or surface in your app’s UI.

Extractors work as part of Observational Memory’s observer and reflector background agents. You can access extracted values from a stream chunk and can configure the output in two ways:

  1. Structured: Zod schema for typed output. Looser instructions — model infers what to capture from schema field names.
  2. Text: No schema, plain-text output. Explicit instructions — spell out what to capture.

Before extractors, pulling structured data from conversations meant either:

Hey!

Leave a reaction and let me know how I'm doing.

  • 0
  • 0
  • 0
  • 0
  • 0
Powered byNeon
Close