MemoGrafterAgent
graft()
Assemble prompt context from explicitly selected topics.
What it does
Assemble prompt context from explicitly selected topics.
Grafting is deterministic when topic IDs are supplied: only active memory reachable from those topics is assembled into the injection result.
Signature
TypeScript
graft(topicIds?: string[]): Promise<InjectionResult>Parameters
topicIds? (string[]) — Topic identifiers to include in the generated context.Result
The selected memory context and prompt text ready to pass to an LLM.
Example
example.ts
const injection = await agent.graft([topicId]);