exportimport

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package exportimport handles JSON round-trip, Markdown, and Obsidian vault export.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExportForLangGraph added in v0.5.0

func ExportForLangGraph(ctx context.Context, store storage.Storage, project string) ([]byte, error)

ExportForLangGraph exports yaad nodes for a project as LangGraph-compatible JSON.

func ExportJSON

func ExportJSON(ctx context.Context, store storage.Storage, project string) ([]byte, error)

ExportJSON exports the full graph as JSON.

func ExportMarkdown

func ExportMarkdown(ctx context.Context, store storage.Storage, project string) (string, error)

ExportMarkdown exports nodes as a Markdown document.

func ExportObsidian

func ExportObsidian(ctx context.Context, store storage.Storage, project, vaultDir string) (int, error)

ExportObsidian exports the graph as an Obsidian vault (one .md file per node, wikilinks for edges). vaultDir must be an absolute path and must not escape above itself via ".." components.

func ImportJSON

func ImportJSON(ctx context.Context, store storage.Storage, data []byte) (int, int, error)

ImportJSON imports a graph from JSON, skipping duplicates.

func ImportLangGraph added in v0.5.0

func ImportLangGraph(ctx context.Context, store storage.Storage, jsonData []byte) (int, error)

ImportLangGraph imports LangGraph-format JSON into yaad storage. Each entry is mapped to a yaad Node with Type="entity". Returns the count of successfully imported nodes.

Types

type GraphExport

type GraphExport struct {
	Version    string          `json:"version"`
	ExportedAt time.Time       `json:"exported_at"`
	Nodes      []*storage.Node `json:"nodes"`
	Edges      []*storage.Edge `json:"edges"`
}

GraphExport is the full graph export format.

type LangGraphEntry added in v0.5.0

type LangGraphEntry struct {
	ID       string                 `json:"id"`
	ParentID string                 `json:"parent_id,omitempty"`
	Role     string                 `json:"role"`
	Content  string                 `json:"content"`
	Metadata map[string]interface{} `json:"metadata,omitempty"`
}

LangGraphEntry represents a single entry in the LangGraph-compatible JSON format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL