Skip to documentation
Docs navigation
Docs/ingestGraftedNodes()
MemoGrafter

ingestGraftedNodes()

Copy supplied nodes into a target session.

What it does

Copy supplied nodes into a target session.

This lower-level API keeps session selection explicit, which is useful for services that manage many users or conversations through one instance.

Signature

TypeScript
ingestGraftedNodes(nodes: TopicNode[], targetSessionId: string): Promise<TopicNode[]>

Parameters

nodes (TopicNode[]) — Topic nodes, including their active memories, to copy.
targetSessionId (string) — The session that will receive copied memory.

Result

The topic nodes created, selected, or copied by the operation.

Example

example.ts
await memo.ingestGraftedNodes(nodes, "target");