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)
| 135 | |
| 136 | |
| 137 | def 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 | |
| 154 | def core_memory_replace(agent_state: "AgentState", label: str, old_content: str, new_content: str) -> Optional[str]: # type: ignore |
nothing calls this directly
no test coverage detected