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

Method appendToMemory

apps/sim/executor/handlers/agent/memory.ts:51–76  ·  view source on GitHub ↗
(
    ctx: ExecutionContext,
    inputs: AgentInputs,
    message: Message
  )

Source from the content-addressed store, hash-verified

49 }
50
51 async appendToMemory(
52 ctx: ExecutionContext,
53 inputs: AgentInputs,
54 message: Message
55 ): Promise<void> {
56 if (!inputs.memoryType || inputs.memoryType === 'none') {
57 return
58 }
59
60 const workspaceId = this.requireWorkspaceId(ctx)
61 this.validateConversationId(inputs.conversationId)
62
63 message = await this.maskContentForStorage(ctx, message)
64
65 this.validateContent(message.content)
66
67 const key = inputs.conversationId!
68
69 await this.appendMessage(workspaceId, key, message)
70
71 logger.debug('Appended message to memory', {
72 workspaceId,
73 key,
74 role: message.role,
75 })
76 }
77
78 async seedMemory(ctx: ExecutionContext, inputs: AgentInputs, messages: Message[]): Promise<void> {
79 if (!inputs.memoryType || inputs.memoryType === 'none') {

Callers 4

appendPiMemoryFunction · 0.80
buildMessagesMethod · 0.80

Calls 6

requireWorkspaceIdMethod · 0.95
maskContentForStorageMethod · 0.95
validateContentMethod · 0.95
appendMessageMethod · 0.95
debugMethod · 0.80

Tested by

no test coverage detected