<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: syed abdul khader</title>
    <description>The latest articles on DEV Community by syed abdul khader (@syed_abdulkhader_2a1eeb9).</description>
    <link>https://dev.to/syed_abdulkhader_2a1eeb9</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4150034%2F4bdd5e24-8a7b-4471-98b7-8b89c8073355.png</url>
      <title>DEV Community: syed abdul khader</title>
      <link>https://dev.to/syed_abdulkhader_2a1eeb9</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/syed_abdulkhader_2a1eeb9"/>
    <language>en</language>
    <item>
      <title>I Stopped My Customer Support Agent From Forgetting Every Conversation</title>
      <dc:creator>syed abdul khader</dc:creator>
      <pubDate>Tue, 29 Sep 2026 14:55:25 +0000</pubDate>
      <link>https://dev.to/syed_abdulkhader_2a1eeb9/i-stopped-my-customer-support-agent-from-forgetting-every-conversation-52oc</link>
      <guid>https://dev.to/syed_abdulkhader_2a1eeb9/i-stopped-my-customer-support-agent-from-forgetting-every-conversation-52oc</guid>
      <description>&lt;p&gt;I Stopped My Customer Support Agent From Forgetting Every Conversation&lt;/p&gt;

&lt;p&gt;I built a customer support agent that handled complaints perfectly  except it had the memory of a goldfish. Every time the same customer came back, it asked them to repeat their entire story. So I gave it one.&lt;/p&gt;

&lt;p&gt;What the System Does&lt;/p&gt;

&lt;p&gt;The project is a &lt;a href="https://github.com/gnanatejadiviti/Customer%20%20Resolution%20%20Engine" rel="noopener noreferrer"&gt;Customer Resolution Engine&lt;/a&gt;  a LangGraph  based agentic workflow that triages electronics customer complaints. When a customer submits a complaint, the agent:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Classifies the issue into a category and priority&lt;/li&gt;
&lt;li&gt;Queries a PostgreSQL knowledge base (read  only, via a SQL agent) to check if it's a known issue with a known fix&lt;/li&gt;
&lt;li&gt;Decides whether to return an instant resolution, create a support ticket, or pause for human review (if the complaint involves legal threats or repeat failures)&lt;/li&gt;
&lt;li&gt;Responds to the customer&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The stack is deliberately boring: FastAPI, PostgreSQL, LangGraph, and Gemini. Nothing exotic. The interesting part is what I bolted on afterward.&lt;/p&gt;

&lt;p&gt;The Problem I Was Trying to Solve&lt;/p&gt;

&lt;p&gt;After shipping v1, I ran a demo for a friend who runs a small electronics repair shop. Halfway through, he asked: &lt;em&gt;"What happens when the same customer calls back three times about the same laptop?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I ran the test. Here's what happened:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Call 1 : "My laptop screen is flickering." → Agent creates ticket TKT  2026  00011, assigns a hardware technician.
Call 2  (two days later): "My laptop is acting up again." → Agent responds: *"I'm sorry to hear that. Can you describe the issue in more detail?"*
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;My friend stared at the screen. &lt;em&gt;"You just made the customer repeat themselves. That's the exact thing that makes people hate calling support."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;He was right. The agent had access to the ticket database, but it had no concept of &lt;em&gt;this specific customer's history&lt;/em&gt;  their frustration level, what had already been tried, what had worked. It was treating every interaction as day one.&lt;/p&gt;

&lt;p&gt;The Fix: A Real Memory Layer&lt;/p&gt;

&lt;p&gt;I didn't want to solve this by dumping raw chat logs into PostgreSQL. Unstructured conversation history doesn't belong in a relational database  it belongs in a semantic memory layer that can retrieve &lt;em&gt;relevant context&lt;/em&gt;, not just &lt;em&gt;recent rows&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;That's when I found &lt;a href="https://github.com/vectorize%20%20io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;, an open  source memory system for AI agents by Vectorize. It lets agents &lt;code&gt;retain&lt;/code&gt; information after an interaction and &lt;code&gt;recall&lt;/code&gt; semantically relevant memories before the next one. You can read more about the design philosophy in their &lt;a href="https://vectorize.io/what%20%20is%20%20agent%20%20memory" rel="noopener noreferrer"&gt;agent memory overview&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The integration took about 45 minutes and changed the agent from a stateless chatbot into something that actually &lt;em&gt;knows&lt;/em&gt; its customers.&lt;/p&gt;

&lt;p&gt;How I Wired It In&lt;/p&gt;

&lt;p&gt;The architecture is simple. Hindsight sits at the absolute entry and exit points of the LangGraph workflow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User Request → recall_memory → understand → classify → search_db → decide → respond → retain_memory → END
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;# The Recall Node (runs first)&lt;/p&gt;

&lt;p&gt;At the start of every complaint, the agent queries Hindsight for the customer's past interactions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;hindsight&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;HindsightClient&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;

&lt;span class="n"&gt;hindsight_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;HindsightClient&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getenv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;HINDSIGHT_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;recall_customer_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;CustomerCareState&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;customer_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;memories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;hindsight_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Past issues, frustration level, and resolved solutions for customer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;
        &lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory_context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;memories&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;memory_context&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No prior memory found.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;# The Retain Node (runs last)&lt;/p&gt;

&lt;p&gt;After the agent resolves or tickets the issue, it saves the outcome back to Hindsight with metadata:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;retain_resolution_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;CustomerCareState&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;customer_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;customer_id&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;unknown&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;complaint&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;complaint&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Unknown complaint&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;resolution&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;resolution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ticket_reference&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;hindsight_client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Customer &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; complained about: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;complaint&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Resolution: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;resolution&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;user_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;customer_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;status&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;resolved&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
            &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;category&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;general&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;# The Prompt Injection (where the magic happens)&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;memory_context&lt;/code&gt; is injected directly into the Gemini prompt. This is the single most important line of code in the entire project:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;
You are an expert customer support agent.

IMPORTANT CONTEXT FROM PAST INTERACTIONS:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;memory_context&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

CURRENT CUSTOMER COMPLAINT:
&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;complaint&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;

INSTRUCTIONS:
1. If the customer is experiencing a recurring issue, explicitly acknowledge their past frustration and previous resolution attempts.
2. Do NOT ask them to repeat information already present in the memory context.
3. Formulate a personalized, context  aware resolution.
&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Before/After: CUST  999&lt;/p&gt;

&lt;p&gt;Here's the same customer, same vague follow  up complaint, with and without memory.&lt;/p&gt;

&lt;p&gt;Without Hindsight: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Customer : "My laptop is acting up again."&lt;br&gt;
 Agent : "I'm sorry to hear that. Can you describe the issue in more detail?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;With Hindsight: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Customer : "My laptop is acting up again."&lt;br&gt;
 Agent : "I see from your history that your screen was flickering last week and we replaced the display cable under ticket TKT  2026  00011. I apologize it's acting up again. Is this the exact same flickering issue, or something new? I'll escalate this to a senior hardware technician either way."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The second response is what my friend wanted to see. The customer doesn't repeat themselves. The agent demonstrates it &lt;em&gt;remembers&lt;/em&gt;. The frustration level drops. The ticket gets routed correctly on the first try.&lt;/p&gt;

&lt;p&gt;You can explore the full implementation in the &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight documentation&lt;/a&gt; if you want to replicate this pattern.&lt;/p&gt;

&lt;p&gt;Five Lessons I Learned&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Memory is a first  class architectural concern, not a feature flag. &lt;br&gt;
Don't bolt memory on at the end. Design your workflow so that &lt;code&gt;recall&lt;/code&gt; runs at the entry point and &lt;code&gt;retain&lt;/code&gt; runs at the exit. If you treat memory as an afterthought, your agent will feel like one.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Don't store chat logs in PostgreSQL. &lt;br&gt;
Relational databases are great for structured data (tickets, customers, products). They are terrible for semantic retrieval of unstructured conversation history. Use a purpose  built memory layer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Prompt injection is the whole game. &lt;br&gt;
Retrieving memory is only half the battle. If you don't explicitly instruct the LLM to &lt;em&gt;use&lt;/em&gt; the memory  and to &lt;em&gt;not&lt;/em&gt; ask the user to repeat themselves  it will ignore the context. Negative constraints ("Do NOT ask...") are as important as positive ones.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Fail gracefully on memory outages. &lt;br&gt;
If Hindsight is down, the agent should still work  just without memory. The &lt;code&gt;try/except&lt;/code&gt; block in &lt;code&gt;recall_customer_memory&lt;/code&gt; ensures the workflow never crashes because of a memory API failure.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The "Aha!" moment has to happen in 60 seconds. &lt;br&gt;
Judges (and users) don't have time for a 10  minute demo. Show the generic response first, then show the personalized response. The contrast is the entire pitch.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;What's Next&lt;/p&gt;

&lt;p&gt;The current implementation uses an in  memory LangGraph checkpointer, which means intra  session state is lost on restart. The next iteration will swap that for a Postgres  backed checkpointer so human  in  the  loop interrupts survive server restarts. But the long  term memory  the part that actually matters for customer experience  is already handled by Hindsight.&lt;/p&gt;

&lt;p&gt;If you're building agents that interact with &lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6jqns4h3l2pecmh4hmg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6jqns4h3l2pecmh4hmg.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;the same users repeatedly, persistent memory isn't optional. It's the difference between a chatbot and a colleague.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
