DEV Community

Cover image for DealMind: An AI Negotiation Agent That Remembers What Actually Worked (Built with Hindsight)
Surya
Surya

Posted on

DealMind: An AI Negotiation Agent That Remembers What Actually Worked (Built with Hindsight)

Every negotiation creates experience. The hard part is making that experience useful when the next negotiation starts.

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

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

A generic AI assistant can give general negotiation advice. It cannot tell you what your organization has learned.

That gap is why we built DealMind for this hackathon, using Hindsight as its long-term memory layer.

A completed negotiation should become useful experience for the next one.

What DealMind does

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:

  1. Recalls comparable past negotiations from Hindsight
  2. Builds evidence from what came back
  3. Calculates economics and confidence with deterministic rules
  4. Synthesizes readable guidance with an LLM (Groq)
  5. Records the outcome so the next negotiation can learn from this one
Current deal → Hindsight recall → Evidence → Analysis → Recommendation
      → Salesperson decides → Outcome → Hindsight retain → Future recall
Enter fullscreen mode Exit fullscreen mode

The salesperson always makes the final call. DealMind is decision support, not autonomous negotiation.

See it in action

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 60-Second Demo button walks through the full recall → evidence → recommendation → outcome loop. The sidebar has Memory and Learning views under Insights, and the footer shows Powered by Hindsight, so it's always clear where the experience comes from.

Architecture: give every layer one job

The most important decision we made was separating responsibilities:

Layer Responsibility
SQLite Structured application state (deals, customers, status)
Hindsight Long-term organizational experience
DealMind services Deterministic economics and confidence
Groq Language synthesis from supplied evidence
Salesperson Final decision

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

Retaining experience, not just outcomes

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

Context is what makes a memory useful:

  • "Won" is a result.
  • "Won after a smaller concession while responding to competitor pressure" is experience.

We also retain failures. 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.

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.

Recalling with context

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 evidence for the analysis layer.

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.

Evidence before explanation

Most LLM apps look like this: Question → LLM → Answer.

DealMind works like this: Question → Recall → Evidence → Deterministic analysis → LLM synthesis → Answer.

The model never invents history. It receives the history the application actually retrieved, and the UI shows evidence IDs 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.

Confidence is rules, not vibes

The LLM does not decide confidence. The application does:

Sample size Win rate Confidence
< 3 any LOW
≥ 3 ≥ 70% HIGH
≥ 3 40–69% MEDIUM
≥ 3 < 40% LOW

Two more rules keep the system honest:

  • Customer evidence first. With at least two comparable customer-specific examples, DealMind uses them before falling back to segment-level history.
  • Conflicts stay visible. 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.

The economics layer is deterministic on purpose

A language model can explain a number. It should not invent the number.

On a $100,000 deal:

  • 20% discount → $20,000 concession
  • 8% discount → $8,000 concession
  • Difference → $12,000 less in discount concession

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

That feeds three tools in the deal workspace:

  • Strategy Lab 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
  • What-if Simulator shows the cost of 20%, 15%, 10%, or 8% discounts side by side
  • Counteroffer Advisor starts from the customer's live counteroffer and combines economics, evidence, and context

One workspace, one object

Memory, evidence, strategies, what-if analysis, and customer history could easily become seven screens. We organized everything around one object, the current negotiation. 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.

The design principle: make uncertainty visible. 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.

The learning loop

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.

Analyze → Negotiate → Record outcome → Retain in Hindsight
      → Future recall → Better context for the next negotiation
Enter fullscreen mode Exit fullscreen mode

We only retain real recorded outcomes, and never invent them. A memory system is only as useful as the memories are trustworthy.

What we learned

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

Built with Hindsight

DealMind's memory layer is powered by Hindsight, an open-source agent memory system.

DealMind doesn't just remember what happened. It changes what it recommends next.

Top comments (0)