Architecture
- Per-customer memory: every message is attributed to the customer via
sender_id; search byuser_idspans all of that customer’s history. - Session per ticket: each ticket uses its own
session_id, so a ticket extracts as a coherent unit while still rolling up under the customer. - Cross-ticket recall: search a customer’s memory to surface similar past issues, regardless of which ticket they happened in.
Setup
Store ticket messages
The customer’s messages carry theircustomer_id as sender_id; the bot’s
replies use a bot sender id with role="assistant". A ticket maps to a session.
Gather context for a reply
Search the customer’s memory for relevant past episodes. Episodes are narrative summaries of prior interactions;include_profile=True also returns the
consolidated customer profile once it has built up.
Complete support bot
Cross-ticket intelligence
Because search is scoped to the customer (not a single ticket), you can surface recurring issues across their entire history.Best practices
One session per ticket
One session per ticket
Use a unique
session_id per ticket so each extracts as a coherent unit,
while user_id search still unifies the customer across tickets.Recall before you store
Recall before you store
Search for context before storing the incoming message, so retrieval
reflects prior history rather than echoing the message you just received.
Privacy
Privacy
Filter sensitive content out of episodes before putting them in an LLM prompt.
Next steps
AI Tutor
Apply the same recall-generate-persist loop to learning.
Agentic retrieval
LLM-guided search for complex, multi-part support questions.

