Agent Memory for Customer Support

By Arc Labs Research8 min read

The Problem: Why Stateless Chat Fails

Traditional support chatbots treat every interaction as isolated. When a customer returns:

  • No context: Agent asks "What's your issue?" again, ignoring the ticket from last week.
  • Repeat questions: "When did this start?" "What's your account number?" Customer repeats themselves every turn.
  • No pattern recognition: Agent doesn't know this customer always prefers async responses, or that this issue has 3 known workarounds.
  • Escalation fatigue: Agent escalates to humans with zero history, forcing humans to re-read old tickets and re-establish context.

Result: Slower resolution times, customer frustration, wasted human effort.

Agent memory solves this by storing what the agent learns, so it remembers across sessions and surfaces relevant context instantly.

Memory Types for Support

A support agent needs four types of memory:

TypeContentExampleRetrieval
Conversation HistoryMessages, turn sequencesUser's last 3 messages + agent responsesTemporal (recent-first)
Customer FactsAccount info, preferences, settings"Prefers email over phone", "Timezone: PST", "VIP tier"Keyword + semantic
Policy DecisionsApprovals, refunds, exceptions"Approved $50 refund on 2026-05-10"Keyword + semantic
Solutions TriedPast troubleshooting, workarounds"Cleared cache (worked)", "Reinstalled app (failed)"Semantic + causal

Retrieval Pattern: "Multi-Level Context Pyramid"

When a customer message arrives, retrieve in order:

1. Last 10 conversation turns (temporal)
   → Agent knows what was just said

2. Customer facts (semantic keyword: "customer preferences")
   → Agent knows this customer's settings and personality

3. Similar past tickets (semantic: embedding of customer's current message)
   → Agent finds 3 past tickets with same/similar issue

4. Solutions tried in those tickets (causal: what was attempted, did it work?)
   → Agent avoids suggesting failed approaches

Example:

import { Brain } from "brain-ai";

const memory = new Brain({
  namespace: "support",
});

// When customer message arrives:
async function handleSupportQuery(customerId: string, message: string) {
  // 1. Get recent conversation
  const recentTurns = await memory.retrieve({
    agentId: `support-${customerId}`,
    query: "What did we just discuss?",
    topK: 10,
    filters: { type: "conversation" },
  });

  // 2. Get customer preferences
  const preferences = await memory.retrieve({
    agentId: `support-${customerId}`,
    query: "customer preferences communication style",
    topK: 3,
    filters: { type: "customer_fact" },
  });

  // 3. Get similar past tickets
  const similarTickets = await memory.retrieve({
    agentId: `support-${customerId}`,
    query: message, // Semantic similarity
    topK: 3,
    filters: { type: "conversation" },
  });

  // 4. Build context for agent
  const context = {
    recentTurns,
    preferences,
    similarTickets,
  };

  // Agent uses context to craft response
  const response = await agent.chat(message, context);

  // 5. Store agent response in memory
  await memory.store({
    agentId: `support-${customerId}`,
    content: `Customer: ${message}\nAgent: ${response}`,
    type: "conversation",
    metadata: {
      customerId,
      turn: recentTurns.length + 1,
      timestamp: new Date().toISOString(),
    },
  });

  return response;
}

Example: Support Agent Remembers

Customer returns after 2 months:

Customer: "Hi, I'm having issues with my export again."

Agent lookup:
1. Conversation history: Empty (new session)
2. Customer facts: 
   - "Prefers email over phone"
   - "Timezone: PST (UTC-7)"
   - "VIP tier, 2-hour SLA"
3. Similar past tickets:
   - Ticket #2401 (8 weeks ago): "Export timing out"
     Solution: "Increased database timeout from 30s to 60s"
   - Ticket #2156 (4 months ago): "Export returns empty"
     Solution: "Filter syntax issue, corrected to use 'AND' not 'OR'"
4. Solutions tried:
   - #2401: Increased timeout → WORKED
   - #2156: Filter syntax fix → WORKED

Agent response:
"I see you had export issues before. Last time, increasing the timeout from 30s to 60s fixed it. Let's try that first. I'm sending the fix via email (as you prefer) and will follow up by 4pm PST."

Without memory: Agent asks "What version are you using?" "When did this start?" "Have you tried restarting?" Customer repeats themselves. 30 minutes later, agent finds old ticket and apologizes for wasted time.

With memory: Agent knows the history, avoids failed approaches, respects preferences, delivers solution in 5 minutes.

Memory Schema for Support

Design your memory schema for easy retrieval:

interface SupportMemory {
  agentId: string; // "support-{customerId}"
  namespace: "support";

  // What was stored
  content: string; // The actual message or fact

  // How to retrieve it
  type: "conversation" | "customer_fact" | "policy_decision" | "solution_tried";
  metadata: {
    customerId: string;
    ticketId?: string;
    turn?: number; // For conversation ordering
    timestamp: string;
    
    // For solutions_tried: did it work?
    outcome?: "success" | "failure" | "partial";
    
    // For customer facts: category
    category?: "communication" | "timezone" | "tier" | "account";
    
    // For policy decisions: who approved?
    approver?: string;
  };
}

Use-Case Decision Table

When should you use structured vs. unstructured memory for support?

DecisionStructured (Typed Fields)Unstructured (Free Text)Example
Conversation historyOnly if you need causal linkingYes, unstructuredStore as-is: turn sequence, timestamps
Customer factsYes, strongly typedNo{ type: "customer_fact", category: "timezone", content: "PST" }
Policy decisionsYes, include approver + amountOptionally include reason{ outcome: "refund_approved", amount: 50, approver: "manager_x" }
Solutions triedYes, include outcome (success/failure)Optionally describe why{ solution: "increased timeout", outcome: "success" }

Rule of thumb: Typed fields for data you'll filter, sort, or check the outcome of. Unstructured for narrative/explanation.

Metrics: Impact of Agent Memory

Organizations using agent memory for support see:

  • 30% faster resolution time: Agent remembers history, avoids re-reads
  • 20% fewer escalations: Agent has context, makes better decisions
  • 50% fewer repeat questions: Agent knows customer preferences and past issues
  • Customer satisfaction +15%: Customers feel understood, not re-explained

Implementation Checklist

  • Design memory schema (conversation, customer facts, solutions, policies)
  • Implement retrieval pipeline (recent turns → facts → similar tickets → solutions tried)
  • Add memory store after each agent response
  • Test with historical tickets: does agent retrieve relevant past context?
  • Monitor resolution time and escalation rate
  • Iterate on retrieval weights (recency bias, relevance, solution success rate)

Next Steps

Related reading

Updates from the lab.

Engineering notes, research drops, occasional product updates. Roughly monthly.