<?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: sampeta ganesh</title>
    <description>The latest articles on DEV Community by sampeta ganesh (@ganeshsampeta07gif).</description>
    <link>https://dev.to/ganeshsampeta07gif</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%2F4148905%2F1a3001f8-f2c9-4c16-a178-56a1f9ca547c.png</url>
      <title>DEV Community: sampeta ganesh</title>
      <link>https://dev.to/ganeshsampeta07gif</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ganeshsampeta07gif"/>
    <language>en</language>
    <item>
      <title>Giving a Sales Agent a Memory That Persists Between Conversations</title>
      <dc:creator>sampeta ganesh</dc:creator>
      <pubDate>Tue, 29 Sep 2026 09:11:51 +0000</pubDate>
      <link>https://dev.to/ganeshsampeta07gif/giving-a-sales-agent-a-memory-that-persists-between-conversations-1om3</link>
      <guid>https://dev.to/ganeshsampeta07gif/giving-a-sales-agent-a-memory-that-persists-between-conversations-1om3</guid>
      <description>&lt;p&gt;We built DealMind to address a simple failure mode in conversational sales tools: a useful customer detail can disappear when the conversation ends. A normal conversational AI can use the context in its current chat, but it does not automatically turn every important detail into durable context for the next conversation. Sales discussions are full of facts worth retaining: a customer's interests, preferences, objections, buying intent, and competitor comparisons.&lt;/p&gt;

&lt;p&gt;DealMind is an AI Sales Intelligence Agent designed to retain those useful customer facts and recall them later. The technical result is a memory loop around the language model: retrieve relevant context before generating an answer, then extract and retain explicit durable facts after the interaction.&lt;/p&gt;

&lt;p&gt;Screenshot: DealMind chat interface showing persistent customer memory&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%2Fswqocr8l0ec1tamrn60v.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%2Fswqocr8l0ec1tamrn60v.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The Problem We Chose to Solve
&lt;/h2&gt;

&lt;p&gt;A salesperson may learn that a prospect is interested in the product, considers the annual plan expensive, prefers monthly billing, and is comparing the product with Zoho. Those facts can change what the salesperson should discuss in a later meeting. Without persistent memory, a later request such as "Prepare me for my meeting with Ravi" starts with only that request and whatever short-lived chat context is still available.&lt;/p&gt;

&lt;p&gt;Our goal was to make customer context available across conversations without turning every previous message into an unfiltered prompt. DealMind stores useful facts in Hindsight and gives relevant recalled text to the model.&lt;/p&gt;
&lt;h2&gt;
  
  
  Architecture: A Memory Loop Around the Agent
&lt;/h2&gt;

&lt;p&gt;The implemented request path is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;User -&amp;gt; React UI -&amp;gt; FastAPI -&amp;gt; DealMind Agent -&amp;gt; Hindsight recall -&amp;gt; Groq LLM -&amp;gt; durable fact extraction -&amp;gt; Hindsight retain -&amp;gt; response to UI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The frontend is a Vite application using React and React DOM. Submitting the composer sends JSON to the configured API URL, defaulting to &lt;code&gt;http://127.0.0.1:8000&lt;/code&gt;, and reads &lt;code&gt;response&lt;/code&gt; and &lt;code&gt;memories&lt;/code&gt;. The FastAPI backend's &lt;code&gt;/chat&lt;/code&gt; endpoint validates &lt;code&gt;ChatRequest&lt;/code&gt;, calls &lt;code&gt;agent.process_message&lt;/code&gt;, and returns the response plus recalled memories.&lt;/p&gt;

&lt;p&gt;The agent identifies a customer name when possible, constructs a customer-scoped recall query, and asks Hindsight for up to ten relevant memories. It formats them as a bullet list in the prompt sent to the model, then returns the response to FastAPI and the React UI.&lt;/p&gt;

&lt;p&gt;Screenshot: Architecture diagram&lt;/p&gt;

&lt;p&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%2Fn65tnr3nnppx5wx72kby.jpeg" 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%2Fn65tnr3nnppx5wx72kby.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  What Hindsight Does
&lt;/h2&gt;

&lt;p&gt;Hindsight is the persistent memory layer; it is not the language model generating the answer. DealMind configures a Hindsight base URL, API key, and bank ID from environment variables. The service wrapper uses the Hindsight REST API with authenticated &lt;code&gt;requests&lt;/code&gt; calls.&lt;/p&gt;

&lt;p&gt;For recall, DealMind posts to the bank's &lt;code&gt;/memories/recall&lt;/code&gt; endpoint. The payload includes a query, the memory types &lt;code&gt;world&lt;/code&gt;, &lt;code&gt;experience&lt;/code&gt;, and &lt;code&gt;observation&lt;/code&gt;, a &lt;code&gt;mid&lt;/code&gt; budget, a token limit derived from the requested limit, and a customer tag. The agent normalizes the returned shapes, extracts readable memory text, and passes only the recalled text into the LLM prompt.&lt;/p&gt;

&lt;p&gt;For retention, the agent first makes a separate Groq call asking for valid JSON containing only explicit, useful, durable customer facts. The allowed categories include preferences, pricing concerns, objections, competitors, interest, buying intent, decision criteria, requirements, and follow-up details. If the JSON is invalid, the code has a conservative fallback that looks for explicit durable cues in the original message. Each retained item is sent to Hindsight with content, conversation context, a customer and memory-type tag, a deterministic document ID, and metadata.&lt;/p&gt;

&lt;p&gt;That order matters. Hindsight supplies durable context, while Groq performs response generation and fact extraction. Hindsight does not replace Groq, and Groq does not provide persistence by itself.&lt;/p&gt;

&lt;p&gt;Screenshot: Hindsight memory/recall behavior&lt;/p&gt;

&lt;p&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%2F0j1m9x5lj35kmbgg15ws.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%2F0j1m9x5lj35kmbgg15ws.png" alt=" " width="799" height="672"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Three Small Pieces of the Implementation
&lt;/h2&gt;

&lt;p&gt;The recall step scopes a query to one customer and turns returned memories into prompt context:&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;recall_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;Customer: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Relevant information for this request: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;recalled_items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_recall_items&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;recall_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;customer&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="n"&gt;recall_query&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;10&lt;/span&gt;&lt;span class="p"&gt;)&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="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;_memory_text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;recalled_items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;memory_context&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&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;- &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;item&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;item&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;memories&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;No relevant memories found.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the boundary where persistent memory becomes usable input. The agent does not blindly paste an entire conversation archive; it asks Hindsight for relevant, customer-tagged results.&lt;/p&gt;

&lt;p&gt;Groq generates the response from both the system rules and the current request with recalled context:&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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;language_model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;SYSTEM_PROMPT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user_prompt&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Inside &lt;code&gt;LLMService&lt;/code&gt;, that call becomes a Groq chat completion using the configured model and a low temperature of &lt;code&gt;0.2&lt;/code&gt;. The system prompt instructs DealMind to distinguish customer facts from suggestions and to avoid unsupported product or competitor claims.&lt;/p&gt;

&lt;p&gt;After the response, the agent asks Groq to extract durable facts and retains each accepted fact:&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;extracted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;language_model&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;generate_response&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;You extract factual customer memory candidates. Return only the requested JSON.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;extraction_prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;facts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;_parse_extracted_facts&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;extracted&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;fact&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;facts&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;memory_service&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;retain_memory&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;memory_type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;fact&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;value&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;dealmind_conversation&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;context&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;Conversation message: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;message&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;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;customer&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;customer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;source&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;dealmind_agent&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The extraction prompt explicitly excludes requests, temporary details, advice, and inferred facts. This keeps the memory layer focused on information likely to matter later.&lt;/p&gt;

&lt;p&gt;Screenshot: Relevant code showing Hindsight integration&lt;/p&gt;

&lt;p&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%2F9c9959yreagwpdpu12tl.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%2F9c9959yreagwpdpu12tl.png" alt=" " width="799" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&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%2Fvh5fzc1lyppfftb90znt.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%2Fvh5fzc1lyppfftb90znt.png" alt=" " width="799" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&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%2Fxg62mwbqz7e3o57k868y.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%2Fxg62mwbqz7e3o57k868y.png" alt=" " width="800" height="411"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&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%2Fl2v5f8rk9tsey8wya3iq.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%2Fl2v5f8rk9tsey8wya3iq.png" alt=" " width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Ravi Interaction
&lt;/h2&gt;

&lt;p&gt;The repository includes this concrete two-step test scenario. First, the salesperson sends:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Ravi is interested in our software. He thinks the annual plan is expensive, prefers monthly billing, and is comparing us with Zoho.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;DealMind generates a response for the current request, then extracts explicit facts such as Ravi's interest, pricing concern, billing preference, and competitor comparison. Those facts are retained under Ravi's Hindsight tag.&lt;/p&gt;

&lt;p&gt;Later, the salesperson sends:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Prepare me for my meeting with Ravi.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The agent recognizes Ravi, recalls relevant Hindsight memories, and gives those memories to Groq. The second response can therefore mention that Ravi is interested, is concerned about the annual plan's cost, prefers monthly billing, and is comparing the product with Zoho. The test checks that stored facts exist, that the second request recalls memories, and that the response uses terms such as "monthly," "annual," "Zoho," or "interested."&lt;/p&gt;

&lt;p&gt;Those are customer facts, not product facts. Ravi's preference for monthly billing does not prove that DealMind's product offers monthly billing. The prompt rules require unknown commercial details to be verified rather than presented as fact.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before and After
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Before:&lt;/strong&gt; the agent has only the current conversation context. A meeting-preparation request may identify Ravi but contains no history about what he cares about.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;After:&lt;/strong&gt; the agent can use relevant persistent customer memories from previous interactions. The salesperson receives guidance grounded in Ravi's known interest, concern, preference, and comparison, while unsupported business details remain unknown and are marked for verification.&lt;/p&gt;

&lt;p&gt;Persistence therefore provides selective, query-driven continuity rather than simply a longer prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  Lessons Learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Memory needs an explicit write policy. Extracting durable facts is more useful than saving every utterance.&lt;/li&gt;
&lt;li&gt;Recall must be scoped. Customer tags and a request-specific query reduce the chance that unrelated context is treated as relevant.&lt;/li&gt;
&lt;li&gt;A memory about a customer's belief or preference is not evidence about the product. Grounding rules must prevent "Ravi prefers monthly billing" from becoming "monthly billing is offered."&lt;/li&gt;
&lt;li&gt;The memory loop is testable. The Ravi test checks retention, recall, and use in the later response.&lt;/li&gt;
&lt;li&gt;The model and memory service have different responsibilities. Keeping Groq generation separate from Hindsight recall and retention makes the data flow easier to inspect.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Limitations and Open Edges
&lt;/h2&gt;

&lt;p&gt;This implementation focuses on the chat and memory loop. The backend exposes customer-memory and timeline routes, but the corresponding agent functions currently return empty arrays, so those routes are not a completed timeline feature. The &lt;code&gt;/api/memory&lt;/code&gt; route acknowledges ingestion rather than implementing a separate workflow. The fallback fact extractor for invalid model JSON is heuristic, so retained facts still deserve review.&lt;/p&gt;

&lt;p&gt;The repository has tests for the API contract, Ravi behavior, Hindsight connectivity and retention/recall, and a direct Groq call. Live behavior requires external credentials and a reachable Hindsight endpoint. There is no repository evidence of production hosting, autoscaling, authentication, or observability.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technologies and Deployment
&lt;/h2&gt;

&lt;p&gt;The project uses Python 3.11+, FastAPI, Uvicorn, Pydantic, &lt;code&gt;python-dotenv&lt;/code&gt;, &lt;code&gt;requests&lt;/code&gt;, Groq's Python client, and the Vectorize package listed in &lt;code&gt;backend/requirements.txt&lt;/code&gt;. The frontend uses JavaScript, React 18, React DOM, and Vite. The React/Vite frontend is deployed on Vercel, while the FastAPI backend is deployed on Render.&lt;/p&gt;

&lt;p&gt;Hindsight is connected through its hosted API, and Groq is used through its API. Secrets such as API keys are stored as environment variables and are not exposed in the frontend. For local development, create a Python virtual environment, install &lt;code&gt;backend/requirements.txt&lt;/code&gt;, install the frontend npm dependencies, configure the Hindsight and Groq variables, run &lt;code&gt;uvicorn backend.main:app --reload&lt;/code&gt;, and run &lt;code&gt;npm run dev&lt;/code&gt; in &lt;code&gt;frontend&lt;/code&gt;. CORS allows Vite localhost origins and an optional &lt;code&gt;FRONTEND_URL&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links and Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/ganeshsampeta07-gif/DealMind" rel="noopener noreferrer"&gt;DealMind repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://deal-mind-sepia.vercel.app/" rel="noopener noreferrer"&gt;Live DealMind application&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight GitHub repository&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://vectorize.io/resources" rel="noopener noreferrer"&gt;Vectorize agent memory resources&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;DealMind's central idea is modest but practical: sales context should survive the end of a chat when it is useful, explicit, and customer-specific. Hindsight provides the durable memory and retrieval layer. Groq turns the current request plus recalled facts into a response and helps identify new facts to store. The result is an agent that can prepare for the next conversation with continuity, while its grounding rules keep customer preferences separate from claims that still need verification.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>python</category>
      <category>devchallenge</category>
    </item>
  </channel>
</rss>
