The classic failure mode of AI support bots: a customer comes back with a follow-up question and the bot has no idea what was discussed last time. The customer has to re-explain everything. Frustration follows.
With persistent memory, this is fixable in an afternoon.
The Architecture
When a customer starts a support conversation:
- Retrieve their last 3–5 relevant memories (past issues, preferences, account status)
- Inject those memories into the system prompt
- At the end of the conversation, store a summary as a new memory
Implementation
// When a customer sends a message
const memories = await memoryLayer.search({
query: customerMessage,
external_user_id: customer.email,
limit: 5
});
const systemPrompt = `
You are a helpful support agent for Acme Corp.
Customer context:
${memories.results.map(m => m.memory.content).join('\n')}
Always reference this context when relevant.
`;
const reply = await llm.chat(systemPrompt, customerMessage);
What to Store
Be intentional about what you memorize. Good candidates:
- The customer's main product usage pattern
- Recurring issues they've experienced
- Their technical proficiency level
- Preferred communication style
- Open issues that haven't been resolved
The Result
A support bot that says "I see you had trouble with authentication last week — is this related?" instead of "Please describe your issue." That's the difference between a bot users tolerate and one they actually prefer.