Class ObsidianImporter

Imports an Obsidian vault (directory of Markdown files) into a SqliteBrain.

Usage:

const importer = new ObsidianImporter(brain);
const result = await importer.import('/path/to/obsidian-vault');

Hierarchy (view full)

Constructors

Methods

Properties

Constructors

Methods

  • Recursively walk sourceDir, parse every .md file, and insert traces.

    Non-Markdown files are silently ignored. Files that fail to parse are recorded in result.errors and processing continues.

    Parameters

    • sourceDir: string

      Directory to recursively scan for .md files.

    • Optional options: Pick<ImportOptions, "dedup">

    Returns Promise<ImportResult>

    ImportResult with counts of imported, skipped, and errored items.

  • Post-process a successfully imported Markdown file:

    1. Warn about any embedded images (![[...]]).
    2. Extract inline #hashtags and merge them into the trace's tag list.
    3. Parse [[wikilinks]] and create knowledge_edges entries.

    Parameters

    • _filePath: string

      Absolute path of the source file (unused here).

    • _frontmatter: TraceFrontmatter

      Parsed front-matter data.

    • body: string

      Markdown body (content after front-matter).

    • result: ImportResult

      Mutable ImportResult accumulator.

    • traceId: string

      The ID of the just-inserted trace.

    Returns Promise<void>

Properties

The target SqliteBrain to import into.