Skip to main content
Build a customer support bot that remembers customer history, past interactions, and preferences, so customers don’t repeat themselves and agents inherit full context on handoff.

Architecture

  • Per-customer memory: every message is attributed to the customer via sender_id; search by user_id spans 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 their customer_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

Use a unique session_id per ticket so each extracts as a coherent unit, while user_id search still unifies the customer across tickets.
Search for context before storing the incoming message, so retrieval reflects prior history rather than echoing the message you just received.
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.