Skip to main content

Class: ObsidianExporter

Defined in: packages/agentos/src/cognition/memory/io/ObsidianExporter.ts:63

Exports memory traces as an Obsidian-compatible Markdown vault.

Usage:

const exporter = new ObsidianExporter(brain);
await exporter.export('/path/to/obsidian-vault');

Extends​

Constructors​

Constructor​

new ObsidianExporter(brain): ObsidianExporter

Defined in: packages/agentos/src/cognition/memory/io/MarkdownExporter.ts:67

Parameters​

brain​

Brain

The Brain instance to read from.

Returns​

ObsidianExporter

Inherited from​

MarkdownExporter.constructor

Properties​

brain​

protected readonly brain: Brain

Defined in: packages/agentos/src/cognition/memory/io/MarkdownExporter.ts:67

The Brain instance to read from.

Inherited from​

MarkdownExporter.brain

Methods​

buildFileContent()​

protected buildFileContent(trace): string

Defined in: packages/agentos/src/cognition/memory/io/ObsidianExporter.ts:107

Build Obsidian-flavoured Markdown for a trace.

Additions over the base implementation:

  • Tags are rendered as #tagName inline hashtags in the body.
  • Related knowledge nodes (found via knowledge_edges) are rendered as [[Node Label]] wikilinks appended at the bottom of the note.

Parameters​

trace​

TraceRow

Parsed trace row.

Returns​

string

Full Markdown file content with front-matter.

Overrides​

MarkdownExporter.buildFileContent


export()​

export(outputDir, options?): Promise<void>

Defined in: packages/agentos/src/cognition/memory/io/ObsidianExporter.ts:86

Export all memory traces as Obsidian-flavoured .md files.

Pre-fetches all knowledge-edge relationships into an in-memory cache, then delegates to the parent export() method. Directory creation and file writing are handled there; only buildFileContent is overridden.

Parameters​

outputDir​

string

Root directory to write the Obsidian vault into.

options?​

ExportOptions

Optional export configuration.

Returns​

Promise<void>

Overrides​

MarkdownExporter.export


traceRelativePath()​

protected traceRelativePath(trace): string

Defined in: packages/agentos/src/cognition/memory/io/MarkdownExporter.ts:130

Determine the relative file path for a trace within the output directory.

Default: {scope}/{type}/{id}.md

Parameters​

trace​

TraceRow

The trace row.

Returns​

string

Relative path string (no leading slash).

Inherited from​

MarkdownExporter.traceRelativePath