MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / core_memory_append

Function core_memory_append

methods/letta/functions/function_sets/base.py:137–151  ·  view source on GitHub ↗

Append to the contents of core memory. Args: label (str): Section of the memory to be edited (persona or human). content (str): Content to write to the memory. All unicode (including emojis) are supported. Returns: Optional[str]: None is always returned as this

(agent_state: "AgentState", label: str, content: str)

Source from the content-addressed store, hash-verified

135
136
137def core_memory_append(agent_state: "AgentState", label: str, content: str) -> Optional[str]: # type: ignore
138 """
139 Append to the contents of core memory.
140
141 Args:
142 label (str): Section of the memory to be edited (persona or human).
143 content (str): Content to write to the memory. All unicode (including emojis) are supported.
144
145 Returns:
146 Optional[str]: None is always returned as this function does not produce a response.
147 """
148 current_value = str(agent_state.memory.get_block(label).value)
149 new_value = current_value + "\n" + str(content)
150 agent_state.memory.update_block_value(label=label, value=new_value)
151 return None
152
153
154def core_memory_replace(agent_state: "AgentState", label: str, old_content: str, new_content: str) -> Optional[str]: # type: ignore

Callers

nothing calls this directly

Calls 2

get_blockMethod · 0.45
update_block_valueMethod · 0.45

Tested by

no test coverage detected