DEV Community

k.Jathin Sri varma
k.Jathin Sri varma

Posted on

I built a sales agent that still remembers the deal after I close the tab

Sales work is not one conversation. It is weeks of meetings, emails, objections, pricing talks, and changing stakeholders. The details that matter most—who the CFO is, why price is a blocker, which competitor just entered the shortlist—are easy to lose between sessions.

I built a conversational deal agent for that problem. It uses Hindsight as persistent agent memory and Groq to generate answers, so it can recall deal context across interactions instead of starting from zero every time.

The problem

Sales representatives often reopen CRM notes, meeting transcripts, Slack threads, and personal notebooks just to reconstruct an active deal. That retrieval tax is expensive. Context is scattered across tools. Objections get buried. New teammates inherit incomplete history. Simple questions such as “What did we already say about pricing?” require hunting rather than asking.

A chatbot that only remembers the current session is not enough. The useful agent is the one that still knows the deal after the app is restarted. This project gives the agent that capability. Over time it can recall customer and stakeholder details, objections, competitors, pricing discussions, deal status, and previous interaction context. The design goal is simple: the agent should get more useful the longer it is used.

What I built

The Deal Intelligence Agent is a Streamlit chat application. A sales rep talks to it in natural language. Before each reply, the app asks Hindsight for memories related to the latest message. Those memories are added to the model context. After the reply, new deal information is stored so later questions can retrieve it.

That loop—recall, generate, retain—is the product. It is not a full CRM replacement. It is a memory-first conversation layer on top of deal knowledge: fast to query, persistent across sessions, and designed around how reps actually talk about deals.

Architecture

The flow is linear:

  1. A sales rep sends a message in the Streamlit chat UI.
  2. The app calls Hindsight Recall and pulls persistent memories relevant to that prompt.
  3. Recalled context is combined with the user message and sent to a Groq LLM (openai/gpt-oss-20b via an OpenAI-compatible API).
  4. The model produces the agent reply.
  5. The app calls Hindsight Retain and stores the new deal information.

Memory sits in the critical path of every turn, not off to the side.

How memory works

Hindsight is used in two places.

Recall. Before generation, the application requests memories related to the latest user message:


python
memories = recall(prompt)
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/6ev27p34qwheunnvrkm3.png)
github - deal-intelligence-agent

![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/q0qhwg51s2a5jafdk04z.png)
app interface
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/gp5qvce6bj6ppk4vtul2.png) 
in termal

![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/9x4dugr6czqs75uh8xgf.png)

Architecture
                    ┌──────────────────────┐
                    │      User / Sales Rep│
                    └──────────┬───────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │   Streamlit Chat UI  │
                    └──────────┬───────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │  Hindsight Recall    │
                    │  Persistent Memory   │
                    └──────────┬───────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │      Groq LLM        │
                    │  openai/gpt-oss-20b  │
                    └──────────┬───────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │      Agent Reply     │
                    └──────────┬───────────┘
                               │
                               ▼
                    ┌──────────────────────┐
                    │ Hindsight Retain     │
                    │ Save new deal memory │
                    └──────────────────────┘.  

team satya and jathin 
![ ](https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/n6x6zlqi8xe3to5i073j.jpg)


Enter fullscreen mode Exit fullscreen mode

Top comments (0)