<?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: Surya</title>
    <description>The latest articles on DEV Community by Surya (@surya_09).</description>
    <link>https://dev.to/surya_09</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%2F4147472%2Fcfc6487e-d896-451b-9e07-67b6bb269af5.png</url>
      <title>DEV Community: Surya</title>
      <link>https://dev.to/surya_09</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/surya_09"/>
    <language>en</language>
    <item>
      <title>DealMind: An AI Negotiation Agent That Remembers What Actually Worked (Built with Hindsight)</title>
      <dc:creator>Surya</dc:creator>
      <pubDate>Mon, 28 Sep 2026 15:37:46 +0000</pubDate>
      <link>https://dev.to/surya_09/dealmind-an-ai-negotiation-agent-that-remembers-what-actually-worked-built-with-hindsight-2g25</link>
      <guid>https://dev.to/surya_09/dealmind-an-ai-negotiation-agent-that-remembers-what-actually-worked-built-with-hindsight-2g25</guid>
      <description>&lt;p&gt;Every negotiation creates experience. The hard part is making that experience useful when the next negotiation starts.&lt;/p&gt;

&lt;p&gt;Sales teams have plenty of history: past customers, objections, discounts, competitors, outcomes. But storing records is not the same as &lt;em&gt;using&lt;/em&gt; them. A salesperson negotiating a $100,000 deal still has to dig through CRM notes and old emails to answer basic questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have we negotiated with this customer before?&lt;/li&gt;
&lt;li&gt;Which objections came up, and which strategies were used?&lt;/li&gt;
&lt;li&gt;Did large concessions actually help?&lt;/li&gt;
&lt;li&gt;What happened with similar customers?&lt;/li&gt;
&lt;li&gt;How much should we trust that history?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A generic AI assistant can give general negotiation advice. It cannot tell you what &lt;strong&gt;your organization&lt;/strong&gt; has learned.&lt;/p&gt;

&lt;p&gt;That gap is why we built &lt;strong&gt;DealMind&lt;/strong&gt; for this hackathon, using &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt; as its long-term memory layer.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A completed negotiation should become useful experience for the next one.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What DealMind does
&lt;/h2&gt;

&lt;p&gt;DealMind is a negotiation decision-support agent. You enter the current deal: customer, industry, segment, deal value, initial offer, counteroffer, requested discount, objection, competitor pressure, and contract length. DealMind then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Recalls&lt;/strong&gt; comparable past negotiations from Hindsight&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Builds evidence&lt;/strong&gt; from what came back&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calculates&lt;/strong&gt; economics and confidence with deterministic rules&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synthesizes&lt;/strong&gt; readable guidance with an LLM (Groq)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Records the outcome&lt;/strong&gt; so the next negotiation can learn from this one
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Current deal → Hindsight recall → Evidence → Analysis → Recommendation
      → Salesperson decides → Outcome → Hindsight retain → Future recall
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The salesperson always makes the final call. DealMind is decision support, not autonomous negotiation.&lt;/p&gt;

&lt;h2&gt;
  
  
  See it in action
&lt;/h2&gt;

&lt;p&gt;The dashboard gives a salesperson a snapshot of the pipeline: active deals, total pipeline value, win rate, and how many historical deals are stored in Hindsight memory. Every deal opens into its own negotiation workspace, and the &lt;strong&gt;60-Second Demo&lt;/strong&gt; button walks through the full recall → evidence → recommendation → outcome loop. The sidebar has &lt;strong&gt;Memory&lt;/strong&gt; and &lt;strong&gt;Learning&lt;/strong&gt; views under Insights, and the footer shows &lt;strong&gt;Powered by Hindsight&lt;/strong&gt;, so it's always clear where the experience comes from.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture: give every layer one job
&lt;/h2&gt;

&lt;p&gt;The most important decision we made was separating responsibilities:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Responsibility&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;SQLite&lt;/td&gt;
&lt;td&gt;Structured application state (deals, customers, status)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Hindsight&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;Long-term organizational experience&lt;/strong&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DealMind services&lt;/td&gt;
&lt;td&gt;Deterministic economics and confidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Groq&lt;/td&gt;
&lt;td&gt;Language synthesis from supplied evidence&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Salesperson&lt;/td&gt;
&lt;td&gt;Final decision&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;We did not want Hindsight to become "another database table." SQLite tells the app &lt;em&gt;what is stored&lt;/em&gt;. Hindsight helps DealMind understand &lt;em&gt;what the organization has experienced&lt;/em&gt;. That makes memory an active part of the agent's reasoning loop rather than an archive.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retaining experience, not just outcomes
&lt;/h2&gt;

&lt;p&gt;When a negotiation completes, DealMind retains the outcome &lt;strong&gt;together with its context&lt;/strong&gt;: customer, normalized customer name, segment, industry, objection, initial offer, counteroffer, strategy, concession, competitor pressure, contract length, outcome, and outcome reason.&lt;/p&gt;

&lt;p&gt;Context is what makes a memory useful:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Won" is a result.&lt;/li&gt;
&lt;li&gt;"Won after a smaller concession while responding to competitor pressure" is experience.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We also retain &lt;strong&gt;failures&lt;/strong&gt;. A large discount that still lost the deal is exactly the lesson a future salesperson needs. The goal is not to remember everything that worked. It is to remember what actually happened.&lt;/p&gt;

&lt;p&gt;One practical detail: customer names are messy. "Acme", "Acme Corp", and "ACME Corporation" should be one customer, so we normalize identity before it enters the memory workflow. Otherwise recall quietly gets worse.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recalling with context
&lt;/h2&gt;

&lt;p&gt;For a new deal, DealMind builds a context-aware recall query from the customer, normalized customer, segment, industry, objection, requested discount, competitor pressure, and contract context. Hindsight returns the relevant experiences, and those become the &lt;strong&gt;evidence&lt;/strong&gt; for the analysis layer.&lt;/p&gt;

&lt;p&gt;The useful history often isn't an exact match. It may be spread across the same customer's earlier deals, similar customers, or the same type of objection. That is where a memory layer helps more than a lookup table.&lt;/p&gt;

&lt;h2&gt;
  
  
  Evidence before explanation
&lt;/h2&gt;

&lt;p&gt;Most LLM apps look like this: &lt;code&gt;Question → LLM → Answer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;DealMind works like this: &lt;code&gt;Question → Recall → Evidence → Deterministic analysis → LLM synthesis → Answer&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The model never invents history. It receives the history the application actually retrieved, and the UI shows &lt;strong&gt;evidence IDs&lt;/strong&gt; linking each recommendation back to the recalled memories. If Hindsight is unavailable, DealMind says historical memory is temporarily unavailable instead of pretending it recalled something.&lt;/p&gt;

&lt;h3&gt;
  
  
  Confidence is rules, not vibes
&lt;/h3&gt;

&lt;p&gt;The LLM does not decide confidence. The application does:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sample size&lt;/th&gt;
&lt;th&gt;Win rate&lt;/th&gt;
&lt;th&gt;Confidence&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt; 3&lt;/td&gt;
&lt;td&gt;any&lt;/td&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;≥ 3&lt;/td&gt;
&lt;td&gt;≥ 70%&lt;/td&gt;
&lt;td&gt;HIGH&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;≥ 3&lt;/td&gt;
&lt;td&gt;40–69%&lt;/td&gt;
&lt;td&gt;MEDIUM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;≥ 3&lt;/td&gt;
&lt;td&gt;&amp;lt; 40%&lt;/td&gt;
&lt;td&gt;LOW&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two more rules keep the system honest:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Customer evidence first.&lt;/strong&gt; With at least two comparable customer-specific examples, DealMind uses them before falling back to segment-level history.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Conflicts stay visible.&lt;/strong&gt; If customer-specific and segment patterns disagree (at least two customer examples and three segment examples with different strategies), DealMind shows both patterns and caps confidence at MEDIUM. The LLM cannot override this.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The economics layer is deterministic on purpose
&lt;/h2&gt;

&lt;p&gt;A language model can explain a number. It should not invent the number.&lt;/p&gt;

&lt;p&gt;On a $100,000 deal:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;20% discount → &lt;strong&gt;$20,000&lt;/strong&gt; concession&lt;/li&gt;
&lt;li&gt;8% discount → &lt;strong&gt;$8,000&lt;/strong&gt; concession&lt;/li&gt;
&lt;li&gt;Difference → &lt;strong&gt;$12,000 less in discount concession&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We deliberately don't call that "profit saved," because that would need real cost and margin data. The app calculates, and the LLM explains.&lt;/p&gt;

&lt;p&gt;That feeds three tools in the deal workspace:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Strategy Lab&lt;/strong&gt; presents approaches such as holding price and adding value, trading a smaller concession for a longer contract, or responding to competitor pressure without automatically matching it&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What-if Simulator&lt;/strong&gt; shows the cost of 20%, 15%, 10%, or 8% discounts side by side&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Counteroffer Advisor&lt;/strong&gt; starts from the customer's live counteroffer and combines economics, evidence, and context&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  One workspace, one object
&lt;/h2&gt;

&lt;p&gt;Memory, evidence, strategies, what-if analysis, and customer history could easily become seven screens. We organized everything around one object, &lt;strong&gt;the current negotiation&lt;/strong&gt;. After analysis, the deal workspace has tabs for Overview, Strategies, What-if, Counteroffer, Evidence, and Customer. Technical details like API health and memory configuration live in Settings so they don't crowd the workflow.&lt;/p&gt;

&lt;p&gt;The design principle: &lt;strong&gt;make uncertainty visible.&lt;/strong&gt; Thin evidence, conflicting patterns, an unavailable memory service, or a deterministic fallback when the LLM is down should all be shown to the user, not hidden.&lt;/p&gt;

&lt;h2&gt;
  
  
  The learning loop
&lt;/h2&gt;

&lt;p&gt;The most interesting part happens after the recommendation. The salesperson records what actually happened, and DealMind retains it in Hindsight with full context. Months later, a different salesperson faces a similar deal, and DealMind recalls that experience as evidence.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Analyze → Negotiate → Record outcome → Retain in Hindsight
      → Future recall → Better context for the next negotiation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We only retain real recorded outcomes, and never invent them. A memory system is only as useful as the memories are trustworthy.&lt;/p&gt;

&lt;h2&gt;
  
  
  What we learned
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Give memory a defined job.&lt;/strong&gt; Keeping state, business rules, language generation, and long-term memory separate made the system easier to reason about.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Retain context, not just results.&lt;/strong&gt; Outcomes without context are barely reusable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Remember failures too.&lt;/strong&gt; A lost deal is still organizational experience.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not everything needs an LLM.&lt;/strong&gt; Calculations, thresholds, and evidence counts are better deterministic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make memory visible.&lt;/strong&gt; Users trust recommendations they can trace back to evidence.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Built with Hindsight
&lt;/h2&gt;

&lt;p&gt;DealMind's memory layer is powered by Hindsight, an open-source agent memory system.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🧠 &lt;strong&gt;Hindsight on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;github.com/vectorize-io/hindsight&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;📚 &lt;strong&gt;Hindsight docs:&lt;/strong&gt; &lt;a href="https://hindsight.vectorize.io" rel="noopener noreferrer"&gt;hindsight.vectorize.io&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;DealMind doesn't just remember what happened. It changes what it recommends next.&lt;/strong&gt;&lt;/p&gt;

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