DEV Community

fatimamadiha0333-max
fatimamadiha0333-max

Posted on

Building a Deal Intelligence Agent with Persistent Memory

Sales deals are 3-6 months long with 20+ touchpoints. Reps waste hours re-reading scattered CRM notes before calls and still miss key objections like pricing concerns or competitor mentions.

Problem we're solving

A typical deal has calls, emails, Slack, CRM fields. Information is everywhere. Reps spend 30 minutes before every call re-reading notes.

Why normal AI agents forget

Traditional RAG agents are stateless. They treat every query as new. They give generic info like "Acme is a 200-employee SaaS company" but miss that last week the CTO said "your pricing is 30% higher than Competitor X".

Our solution

Deal Intelligence Agent that remembers every interaction across a deal cycle - objections, competitors mentioned, stakeholder concerns, and pricing discussions. Over time, it learns which objection-handling approaches work best.

How persistent memory works

We use Hindsight AI as the memory core. Not just vector search - it's episodic memory that stores deal_id, objection type, sentiment, and evolves over time.

System architecture

User Call / Email -> Transcription -> Hindsight Memory Extraction -> Deal Memory Graph -> Briefing Agent

Technologies used

Python, Hindsight AI, OpenAI API, Streamlit

How the agent remembers clients/deals

from hindsight import Hindsight
hindsight = Hindsight()

hindsight.store(
content="Acme Corp call on 2026-09-20",
metadata={
"deal_id": "acme_corp_q4",
"objection": "pricing too high vs CompetitorX",
"stakeholder": "CTO - John Miller",
"competitor": "CompetitorX",
"next_step": "send ROI calculator"
}
)

query = "What are the key blockers for Acme Corp?"
deal_context = hindsight.recall(query=query, filter={"deal_id": "acme_corp_q4"}, top_k=5)

Example workflow

BEFORE Hindsight:
"Acme Corp is a prospect. Last contact was 5 days ago."

AFTER Hindsight:
"Briefing for Acme Corp ($28k Deal):
Blocker 1: CTO thinks 30% expensive vs CompetitorX
Blocker 2: CFO worried about implementation
Last Promise: Send ROI calculator
Winning Tactic: Comparison Sheet + Quarterly Payment closed 70% similar deals"

Challenges & solutions

Challenge: Vector DB couldn't link "budget too high" and "pricing concern" as same objection. Solution: Hindsight's semantic memory understands intent.

Demo / Screenshots

[Add your frontend screenshot here]
[Add your briefing output screenshot here]

Future improvements

  • Gong / Chorus call auto-integration
  • Deal Health Score based on memory sentiment
  • Auto Email Drafting

GitHub / Demo links

Code: https://github.com/fatimamadiha0333-max/deal-intelligence-agent
Memory: github.com/hindsight-ai/hindsight

Top comments (0)