Urgent.News

What's breaking now, across thousands of outlets.

Tech

Building a Customer-Support Agent That Actually Remembers: Adding Persistent Memory with Hindsight

Imagine contacting customer support about a problem you've already explained twice. The support agent asks: “Could you please provide your order number?” You already provided it in your previous conversation. Then you explain the issue again. And again. This is one of the biggest limitations of many AI customer-support agents: they can remember the current conversation, but they don't truly…

In a typical customer support scenario, if a customer has previously explained their issue multiple times, the support agent will ask for the order number once again, and then repeat the explanation. This repetitive process is a major drawback of many AI customer-support agents, as they can only remember the current conversation, not the customer as a whole.

To address this issue, the project team developed SupportMemory, an AI-powered customer-support agent that employs Hindsight persistent memory to recall previous customer interactions and retain new information for future conversations. The main objective was to ensure that customers do not have to repeat themselves when contacting support.

Most conversational AI systems function effectively within a single conversation. For instance, when a customer informs the agent about an issue with their order, the agent can provide assistance. However, when the customer returns for a second conversation, they must start over and provide the same information once again. This leads to several problems, including customers having to repeat information, slower conversations, less context for the agent, and a frustrating customer experience.

The team aimed to change this by introducing a persistent memory layer into the agent's architecture. The agent would no longer treat every conversation as a completely new interaction. Instead, the architecture would consist of the following components:

1. Customer

2. SupportMemory Agent

3. Recall Memory

4. New Message

5. Hindsight Memory Layer

6. Agent Response

7. Retain New Information

Hindsight plays a crucial role in the agent's persistent memory. The basic flow involves the following steps:

1. Customer Message: The agent receives a message from the customer.

2. Recall relevant customer memory: The agent retrieves useful information from previous interactions that can help answer the current message.

3. Combine memory + current conversation: The agent merges the retrieved memory with the current conversation.

4. LLM Agent: The agent generates a response using the combined information.

5. Retain new information: The agent stores new information from the current interaction for future conversations.

The agent does not need to load the entire customer conversation history every time; it can retrieve relevant information that is pertinent to the current request. For example, consider a customer named Ananya. During a previous conversation, Ananya mentioned her preferred language is English and she typically wants email updates.

The agent can retain this information. Later, when Ananya starts a new conversation, she can inquire about the status of her refund, and the agent can recall the relevant customer information to provide a more contextually appropriate response.

The team demonstrated the effectiveness of the persistent memory approach by comparing a stateless agent with a memory-enabled agent. In the stateless agent scenario, when Steven contacts support to check on his laptop replacement, the agent asks him to provide his order number. When Steven contacts support again to inquire about his laptop replacement, the stateless agent once again requests his order number.

In contrast, the memory-enabled agent remembers the previous context and can respond accordingly without requiring Steven to repeat himself. This difference may seem minor from a technical standpoint, but it significantly improves the customer's experience by making the agent appear knowledgeable about their previous interactions.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

My Traefik Set Up on Docker

My Traefik Setup with Docker: A Simple Reverse Proxy for My Homelab I've been running several services on Docker, and at some point managing ports, domains, HTTPS certificates, and reverse-proxy…

  • Traefik simplifies reverse proxy configuration for Docker containers
  • Docker Compose creates dedicated network for Traefik and services
  • Traefik routes traffic based on Docker labels and HTTPS certificates

More from Tuesday 29 September →