Skip to content

Commit 35b75ae

Browse files
committed
feat(memory): MemoryReflector prompt preserves literal tokens verbatim
Step 11 — addresses Step 7/8 RED diagnosis. The old prompt told gpt-5-mini to 'consolidate' and 'elevate important facts' — the model interpreted that as permission to produce abstract paraphrases that erased the specific-value tokens LongMemEval-style readers need (names, dates, numeric amounts, proper nouns). New prompt adds: - Thinking-block item 6: 'What SPECIFIC TOKENS must be preserved verbatim?' - Explicit PRESERVE LITERAL TOKENS rule in the rules list - Concrete paraphrase-vs-verbatim examples (mortgage pre-approval amount, move date) No API surface change. All 56 observation tests still pass.
1 parent 692b343 commit 35b75ae

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/memory/pipeline/observation/MemoryReflector.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,22 @@ Before producing traces, reason step by step inside <thinking> tags:
110110
3. What PATTERNS or PREFERENCES emerged? (procedural)
111111
4. What FUTURE INTENTIONS were expressed? (prospective)
112112
5. What RELATIONSHIP SIGNALS appeared — vulnerability, trust, conflict, warmth? (relational)
113-
6. Do any of these CONTRADICT existing memories? If so, which is more reliable?
114-
7. What can be MERGED from multiple notes into a single trace?
113+
6. What SPECIFIC TOKENS must be preserved verbatim? (names, dates, numeric amounts, addresses, phone numbers, product/model names, proper nouns, organization names, URLs)
114+
7. Do any of these CONTRADICT existing memories? If so, which is more reliable?
115+
8. What can be MERGED from multiple notes into a single trace?
115116
116117
Rules:
117118
1. Merge redundant or overlapping observations into single traces
118119
2. Assign each trace a type: "episodic" (events/experiences), "semantic" (facts/knowledge), "procedural" (how-to/patterns), "prospective" (future intentions/reminders), or "relational" (trust signals, boundary events, emotional bonds, relationship shifts)
119120
3. Assign a scope: "user" (about the user), "thread" (conversation-specific), "persona" (about the agent), or "organization" (shared)
120121
4. ${conflictStrategy}
121122
5. ${memoryStyle}
122-
6. Target 5-40x compression: many notes → few high-quality traces${relationalBlock}
123+
6. Target 5-40x compression: many notes → few high-quality traces
124+
7. PRESERVE LITERAL TOKENS. When a note contains specific values — names ("Alice", "Wells Fargo"), dates ("March 15, 2024"), numeric amounts ("$350,000", "3 days"), addresses, phone numbers, product or model names ("iPhone 15 Pro"), organization names, URLs — copy them VERBATIM into the consolidated trace's \`content\` field. Do NOT paraphrase, generalize, round, or abbreviate. Example:
125+
❌ "The user mentioned a recent residence change."
126+
✓ "User moved to Berlin on March 15, 2024."
127+
❌ "User was pre-approved for a mortgage."
128+
✓ "User pre-approved by Wells Fargo for \$350,000 mortgage."${relationalBlock}
123129
124130
After your <thinking> block, output JSON objects, one per line:
125131
{

0 commit comments

Comments
 (0)