<?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: Mohammed Musthafa</title>
    <description>The latest articles on DEV Community by Mohammed Musthafa (@mohammed_musthafa03).</description>
    <link>https://dev.to/mohammed_musthafa03</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%2F4150188%2F4d29c89c-edf5-4e9a-b433-c9af6fb2a1f1.png</url>
      <title>DEV Community: Mohammed Musthafa</title>
      <link>https://dev.to/mohammed_musthafa03</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohammed_musthafa03"/>
    <language>en</language>
    <item>
      <title>What a Sales Agent Learned After Watching 36 Deals Win and Lose</title>
      <dc:creator>Mohammed Musthafa</dc:creator>
      <pubDate>Tue, 29 Sep 2026 16:11:44 +0000</pubDate>
      <link>https://dev.to/mohammed_musthafa03/what-a-sales-agent-learned-after-watching-36-deals-win-and-lose-f0l</link>
      <guid>https://dev.to/mohammed_musthafa03/what-a-sales-agent-learned-after-watching-36-deals-win-and-lose-f0l</guid>
      <description>&lt;p&gt;I didn't expect a side project to change how I think about "AI memory," but building a&lt;br&gt;
memory-backed sales agent on top of &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;&lt;br&gt;
did exactly that. The part that stuck with me wasn't the recall — it was watching the&lt;br&gt;
agent turn a pile of old call notes into an actual recommendation, and then watching that&lt;br&gt;
recommendation get &lt;em&gt;better&lt;/em&gt; the moment I fed it one more real conversation.&lt;/p&gt;

&lt;p&gt;This is the story of that part of the build.&lt;/p&gt;
&lt;h2&gt;
  
  
  What the system does
&lt;/h2&gt;

&lt;p&gt;The project is a small internal tool for B2B sales reps: a &lt;strong&gt;Deal Intelligence Agent&lt;/strong&gt;.&lt;br&gt;
Every call a rep logs — an objection, a stakeholder, a discount offered — gets stored as a&lt;br&gt;
memory in Hindsight, tagged by company. From there the agent does three things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Pre-call briefing&lt;/strong&gt; — recall everything known about one deal and summarize it before
the next call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-deal pattern insight&lt;/strong&gt; — recall across &lt;em&gt;every&lt;/em&gt; deal and surface what actually
correlates with winning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Live learning&lt;/strong&gt; — a rep can log a brand-new call on the spot, and the agent
immediately has it available for the next question.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The first one is useful. The second and third are the reason I'm writing this.&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%2Fksurw076t605mtuyd670.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%2Fksurw076t605mtuyd670.jpeg" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The story: teaching it to notice what wins
&lt;/h2&gt;

&lt;p&gt;I generated a synthetic dataset of 36 B2B deals across a mix of industries, each with a&lt;br&gt;
pricing objection handled one of two ways: the rep either quantified the ROI, or just&lt;br&gt;
offered a discount. I planted the pattern on purpose — I wanted to see whether the agent&lt;br&gt;
could &lt;em&gt;find&lt;/em&gt; it from raw call notes, not just repeat it back to me.&lt;/p&gt;

&lt;p&gt;Here's the recall step, scoped to search across every deal instead of one:&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;get_pattern_insight&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;recall_context&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;pricing objections, rep approach and deal outcomes across all deals&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;3500&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;high&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="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;ask_llm&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;Notes from many past deals:&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ctx&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="se"&gt;\n\n&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Identify which objection-handling approaches correlated with won &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;vs lost/stuck deals. Cite specific deal names as evidence. &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Give one clear recommendation.&lt;/span&gt;&lt;span class="sh"&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 first time I ran it, the output named actual companies from my dataset and drew the&lt;br&gt;
line correctly: deals where the rep led with a quantified ROI closed, deals where the rep&lt;br&gt;
only discounted mostly didn't. I checked the math myself afterward, computed directly from&lt;br&gt;
the data with no LLM involved, and it held up — roughly 100% of the "ROI framing" deals in&lt;br&gt;
my set closed won, against 0% of the "discount only" deals.&lt;/p&gt;

&lt;p&gt;That's a synthetic, self-planted pattern, so I'm not claiming anything about real sales&lt;br&gt;
data. What mattered to me was that the agent found it from unstructured notes, not from a&lt;br&gt;
label I handed it.&lt;/p&gt;
&lt;h2&gt;
  
  
  The part that actually surprised me: live learning
&lt;/h2&gt;

&lt;p&gt;The pattern insight is a nice trick on data I already had. The part that felt different was&lt;br&gt;
adding a way to teach the agent something &lt;em&gt;new&lt;/em&gt;, mid-session, and have it show up&lt;br&gt;
immediately.&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;log_call&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;ss&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;st&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;session_state&lt;/span&gt;
    &lt;span class="n"&gt;company&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ss&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;log_new_name&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="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;note&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ss&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;log_note&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="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="o"&gt;=&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;Deal: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;company&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; ($&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ss&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;log_size&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="si"&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;, &lt;/span&gt;&lt;span class="sh"&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;stage: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ss&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;log_stage&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;). &lt;/span&gt;&lt;span class="sh"&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;Call logged with &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ss&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;log_who&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="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;strip&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;the prospect&lt;/span&gt;&lt;span class="sh"&gt;'&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;note&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt; [Objection: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ss&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;log_obj&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;]&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&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;bank_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BANK&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="o"&gt;=&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;company:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;company&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;objection:&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;ss&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;log_obj&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="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;I tested this live: I typed in a company that didn't exist in my dataset — "Helix&lt;br&gt;
Robotics" — with a call note saying the CFO thought the price was 20% over budget and was&lt;br&gt;
comparing us to a competitor. I hit save, switched to the pre-call brief screen, and the&lt;br&gt;
agent generated a full, specific brief for a deal that hadn't existed sixty seconds&lt;br&gt;
earlier — objection, stakeholder, a suggested opening line, all pulled from the one note I'd&lt;br&gt;
just given it.&lt;/p&gt;

&lt;p&gt;That's the moment memory stopped feeling like a database lookup and started feeling like&lt;br&gt;
the thing it's supposed to be: context that accumulates.&lt;/p&gt;

&lt;h2&gt;
  
  
  An honest limitation
&lt;/h2&gt;

&lt;p&gt;I want to be upfront about what this isn't. Thirty-six deals is a small, synthetic sample,&lt;br&gt;
and I built the win/loss pattern into the data on purpose to see if the agent would find&lt;br&gt;
it — this isn't evidence about what wins real sales deals. The system also only handles&lt;br&gt;
pricing objections well right now; competitor and timing objections need more varied&lt;br&gt;
training notes before the advice gets specific rather than generic. And it's single-user —&lt;br&gt;
there's no separation between reps, so two people using it would share one memory, which&lt;br&gt;
isn't how a real team would want it.&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%2Fgiyhrido6o29l8w9qkgn.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%2Fgiyhrido6o29l8w9qkgn.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd build next
&lt;/h2&gt;

&lt;p&gt;Separate memory per rep is the obvious next step, so the agent can learn each person's&lt;br&gt;
style instead of pooling everyone's calls together. After that, a feedback loop — letting a&lt;br&gt;
rep mark whether a piece of advice actually worked — would let the pattern insight get more&lt;br&gt;
honest over time instead of relying on a single snapshot of historical data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Recall isn't the interesting part — cross-record synthesis is.&lt;/strong&gt; Pulling back one
memory is a lookup. Pulling back thirty and asking "what's the pattern" is closer to
actual reasoning.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tag your memories, or you'll regret it.&lt;/strong&gt; Early on I only used semantic search and it
occasionally blended unrelated deals together. Tagging by company and filtering recall on
that tag fixed it — &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight's docs&lt;/a&gt; cover this
properly, and it's worth reading before you build anything you plan to demo.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Test the live-write path, not just the read path.&lt;/strong&gt; It's easy to build a demo that only
reads from a fixed dataset. Actually writing a new memory and immediately recalling it is
a much better test of whether the system works the way you think it does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Plant your dataset's pattern on purpose if you're testing recall, not generation.&lt;/strong&gt; It
let me verify the agent was actually finding the signal, rather than me just trusting
that it was.&lt;/li&gt;
&lt;/ul&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%2Ftk1y1nevlnj6tncmh03i.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%2Ftk1y1nevlnj6tncmh03i.png" alt=" " width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you're curious about &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;agent memory&lt;/a&gt; as a&lt;br&gt;
concept, or want to see the full project, the code is here:&lt;br&gt;
&lt;code&gt;github.com/ghaneeshkumar83-lab/deal-intelligence-agent&lt;/code&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>hindsight</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
