ReferenceAsk

Mappers

Transform raw source objects into corpus documents: define a mapper in code, then test, deploy, and run it from the CLI.
import { defineMapper } from '@mindstudio-ai/agent';

A mapper is the transform between a raw source and a corpus. When documents arrive as raw objects (files in a bucket, records from a connector) rather than as clean text, defineMapper describes how to turn each object into zero or more documents. Its one job is a map function: one object in, an outcome out. Return documents([...]) to emit one or more mapped documents, passthrough() to take the object as-is, skip(reason) to drop it with a note, or deletes([...]) to remove documents an earlier object created. A mapper is defined in code and operated from the Admin CLI, where map test previews it against real objects, map deploy ships a version, and a bulk job runs it over the whole source. Each mapped document carries a stable external id, so a later object with the same id supersedes what it produced.

10 entries
Methods 5
Types 5