Interface IngestOptions

Options controlling a document-ingestion job launched via Memory.ingest().

interface IngestOptions {
    recursive?: boolean;
    include?: string[];
    exclude?: string[];
    format?: "auto" | "markdown" | "obsidian";
    onProgress?: ((processed, total, current) => void);
}

Properties

recursive?: boolean

Whether to recursively scan sub-directories when source is a directory.

Default

false
include?: string[]

Glob patterns for file types to include.

Example

['**/*.md', '**/*.pdf']
exclude?: string[]

Glob patterns for paths to exclude.

Example

['node_modules/**', '**/*.test.*']
format?: "auto" | "markdown" | "obsidian"

Format hint for the ingested content.

  • 'auto' – detect from file extension / mime type.
  • 'obsidian' – parse Obsidian wiki-links and front-matter.
  • 'markdown' – treat as plain CommonMark.

Default

'auto'
onProgress?: ((processed, total, current) => void)

Callback invoked as each file is processed. Useful for building progress UI.

Type declaration

    • (processed, total, current): void
    • Parameters

      • processed: number

        number of files completed so far

      • total: number

        total number of files discovered

      • current: string

        path of the file currently being processed

      Returns void