MCPcopy Index your code
hub / github.com/simstudioai/sim / appendPiMemory

Function appendPiMemory

apps/sim/executor/handlers/pi/context.ts:103–118  ·  view source on GitHub ↗
(
  ctx: ExecutionContext,
  config: PiMemoryConfig,
  task: string,
  finalText: string
)

Source from the content-addressed store, hash-verified

101
102/** Persists the user task and the agent's final message to memory. */
103export async function appendPiMemory(
104 ctx: ExecutionContext,
105 config: PiMemoryConfig,
106 task: string,
107 finalText: string
108): Promise<void> {
109 if (!isMemoryEnabled(config)) return
110 try {
111 await memoryService.appendToMemory(ctx, config, { role: 'user', content: task })
112 if (finalText) {
113 await memoryService.appendToMemory(ctx, config, { role: 'assistant', content: finalText })
114 }
115 } catch (error) {
116 logger.warn('Failed to append Pi memory', { error: getErrorMessage(error) })
117 }
118}

Callers 1

runPiMethod · 0.90

Calls 4

getErrorMessageFunction · 0.90
isMemoryEnabledFunction · 0.85
appendToMemoryMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected