Exports a Brain to a structured JSON file.

Usage:

const exporter = new JsonExporter(brain);
await exporter.export('/path/to/export.json', { includeEmbeddings: false });

Constructors

Methods

Constructors

Methods

  • Export the full brain state to a JSON file at outputPath.

    Parameters

    • outputPath: string

      Absolute path to write the JSON output.

    • Optional options: ExportOptions

      Optional export configuration. includeEmbeddings (default false): when true, raw embedding BLOBs are encoded as base64 strings and included in the output. includeConversations (default true): when false, conversation and message rows are omitted from the output.

    Returns Promise<void>

  • Export the full brain state as a JSON string without filesystem access.

    Parameters

    • Optional options: ExportOptions

      Optional export configuration (embeddings, conversations).

    Returns Promise<string>

    Pretty-printed JSON string of the full brain payload.