ReferenceAsk

Readers

Reads each document a data source builds into the app's own tables. Define it in code, run it from the CLI.
import { mindstudio } from '@mindstudio-ai/agent';

A reader is app code the platform runs over every document a data source builds. A mapper works on the way in: it turns a raw object into documents, and it must be pure. A reader works on the way out: once a document is built, the reader reads it and writes what it found into the app's own tables. That is how an app learns what its documents say, in its own domain's terms: which equipment a passage names, which people it quotes, what relations it states.

defineReader takes the source and four handlers: read when a document arrives, removed when one leaves, and, optionally, cleared when the whole source is deleted and relinked when a new dictionary re-tags a document already read. One rule: a document can be read more than once, so read replaces that document's rows as a set, and removed deletes them. A reader is declared in the manifest beside or instead of a mapper, always runs against the live release, and starts reading when the app publishes.

4 entries
Methods 1
Types 3