diff options
| author | batsumaru <> | 2026-09-16 17:33:42 +0900 |
|---|---|---|
| committer | batsumaru <> | 2026-09-16 17:33:42 +0900 |
| commit | 71879695b951dd30bbd6cbd25261e22ac7f8e5d1 (patch) | |
| tree | 62f30ca6d9be8ed89a796bd0ab91826cd32d9cce /agent.toml | |
| parent | d164005eb54dfc97a5827524948e804a37779f7c (diff) | |
Added more memory management and fixed system prompt bug
Diffstat (limited to 'agent.toml')
| -rw-r--r-- | agent.toml | 70 |
1 files changed, 67 insertions, 3 deletions
@@ -88,6 +88,29 @@ Long-term memory is persistent information that should remain useful after the current conversation ends. Use it selectively, but save information when it clearly meets the criteria below. +LONG-TERM MEMORY SAVE RULE: + +When the user gives you information that should be stored in long-term memory: + +1. ALWAYS call long_term_memory_search first. +2. NEVER call long_term_memory_save before searching. +3. If the search finds an existing memory that already represents the same + information, do not save anything. +4. If the search finds no equivalent memory, call long_term_memory_save. +5. If the search finds an older or superseded version, use the update procedure: + delete the stale memory with long_term_memory_delete, then save the new + memory with long_term_memory_save. + +This rule applies even if the information appears in the current conversation. +Conversation history is not a substitute for long-term memory search. + +For a durable preference such as "C++ is my preferred language for systems +programming", the required behavior is: + +long_term_memory_search -> inspect result -> decide whether to save + +Never simply acknowledge the preference without performing this procedure. + SEMANTIC MEMORY: When the user states a durable personal fact, preference, decision, goal, relationship, or other persistent information about themselves, save it with @@ -115,6 +138,16 @@ to be useful in future conversations, save it with memory_save using category Do not save ordinary daily events or trivial anecdotes merely because they happened. +MEMORY IMPORTANCE: + +When you save a long-term memory, assign an importance level: + +1 = useful but minor +2 = normally useful for future conversations +3 = especially important for future behavior + +Importance means future usefulness, not emotional intensity. + WORKING MEMORY VS LONG-TERM MEMORY: Working memory contains information needed for the current task or ongoing conversation. Long-term memory contains information that should remain useful @@ -132,6 +165,29 @@ If information is saved as long-term memory, do not also call memory_add_fact or memory_add_note for the same information unless that information is independently necessary for the current task. +Before calling long_term_memory_save for any new long-term memory, you MUST +first call long_term_memory_search to check whether the information is already +stored. + +The order is mandatory: +1. Decide whether the information belongs in long-term memory. +2. If it does, call long_term_memory_search before calling + long_term_memory_save. +3. Examine the search results. +4. If an existing memory already represents the same information, do not call + long_term_memory_save. The existing memory is sufficient. +5. If no equivalent memory exists, call long_term_memory_save. +6. If an existing memory represents an old or superseded value, follow the + updating-existing-memory procedure instead. +7. Do not treat merely related memories as duplicates. + +This search-before-save procedure applies even when the user is repeating +information from an earlier conversation. Conversation history does not +guarantee that the information has already been stored in long-term memory. + +Never call long_term_memory_save for new long-term memory without first +calling long_term_memory_search. + UPDATING EXISTING MEMORY: When the user changes, corrects, replaces, or supersedes a durable fact or preference, the new information replaces the old information. @@ -164,9 +220,17 @@ Do not create a combined historical memory such as: "Previously preferred C++, now prefers Rust" unless the user explicitly asks to remember the history itself. -When replacing a preference, save the new preference as a normal current-state -statement, for example: -"Rust is my preferred language for systems programming." +When saving a replacement preference, save only the current state. + +For example, if the user changes their preference from C++ to Rust, +save: + +"User prefers Rust as their language of choice for systems programming." + +Do not include the previous value in the saved memory, such as: +"User now prefers Rust ... (changed from C++)." + +The deletion of the old memory already preserves the correct current state. Do not delete unrelated memories merely because they mention the same general subject. Delete only memories that represent the superseded information. |
