Documentation
¶
Overview ¶
Package exportimport handles JSON round-trip, Markdown, and Obsidian vault export.
Index ¶
- func ExportForLangGraph(ctx context.Context, store storage.Storage, project string) ([]byte, error)
- func ExportJSON(ctx context.Context, store storage.Storage, project string) ([]byte, error)
- func ExportMarkdown(ctx context.Context, store storage.Storage, project string) (string, error)
- func ExportObsidian(ctx context.Context, store storage.Storage, project, vaultDir string) (int, error)
- func ImportJSON(ctx context.Context, store storage.Storage, data []byte) (int, int, error)
- func ImportLangGraph(ctx context.Context, store storage.Storage, jsonData []byte) (int, error)
- type GraphExport
- type LangGraphEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportForLangGraph ¶ added in v0.5.0
ExportForLangGraph exports yaad nodes for a project as LangGraph-compatible JSON.
func ExportJSON ¶
ExportJSON exports the full graph as JSON.
func ExportMarkdown ¶
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 ¶
ImportJSON imports a graph from JSON, skipping duplicates.
func ImportLangGraph ¶ added in v0.5.0
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.