DEV Community

Satya Narasimha kumar
Satya Narasimha kumar

Posted on

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

I built a sales agent that still remembers the deal after I
close the tab
A Streamlit sales assistant that uses Hindsight for persistent deal memory and Groq for answers.
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 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. Persistent memory for sales conversations Page 1 Deal Intelligence Agent Technical Article
  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: memories = recall(prompt) Those memories are injected into the system context so the model answers with deal history, not just the current sentence. Retain. After the response is produced, the user’s deal information is stored: remember(prompt) Later questions can retrieve that information even if the Streamlit process was restarted. That is the difference between session chat history and durable deal memory. Example A representative can write: “Acme Corp is evaluating our product. Sarah, the CFO, is the main decision-maker. Their main objection is that our price is too high. They are also considering CompetitorX.” Later they can ask: “What do you know about the Acme deal?” The agent should answer with the remembered stakeholders, objection, and competitive set—without the user restating any of it. A strong demonstration is: enter a deal detail, ask a follow-up, add another fact, ask the agent to recall it, restart the application, and ask again. If the last step still works, persistent memory is doing its job. Stack The stack is intentionally small: Python for application logic, Streamlit for the chat UI, Hindsight by Vectorize for recall and retain, the Groq API with openai/gpt-oss-20b for generation, the OpenAI Python SDK against Groq’s OpenAI-compatible API, and python-dotenv for environment variables. deal-intelligence-agent/ app.py requirements.txt .env.example .gitignore README.md Persistent memory for sales conversations Page 2 Deal Intelligence Agent Technical Article docs/ architecture.md demo-script.md submission-checklist.md Setup Clone the repository, create a virtual environment, install dependencies from requirements.txt, and copy .env.example to .env. Add: HINDSIGHT_API_KEY=your_key GROQ_API_KEY=your_key Never commit .env. Then run streamlit run app.py and open http://localhost:8501. Security API keys come from environment variables only. Do not upload .env files, keys, passwords, private customer data, or confidential company information. For public demos, use synthetic deal data unless there is permission to publish real accounts. Why this works Most sales copilots fail in the same place: they sound fluent in one thread and forgetful in the next. CRM systems store records, but they are not conversational. Chatbots are conversational, but they usually forget. This agent sits between those two worlds. It accepts natural language, remembers people, objections, competitors, pricing, and status, and improves across interactions rather than only within a single session. An agent that remembers the Acme CFO, the price objection, and CompetitorX is already more useful on the fifth question than on the first. What I would add next Natural next steps include structured deal profiles; automatic extraction of customer, stakeholder, objection, competitor, and next-action fields; deal-stage tracking; ROI and pricing analysis; memory confidence and source display; CRM integration; and human approval before external actions. Those extensions make memory more inspectable. They do not change the core idea: persist the deal, then talk to it. Sales teams do not need another chatbot that forgets the deal when the tab closes. They need an agent that can be told “Sarah is the CFO and price is the objection” once, and still know it tomorrow. That is what this project does: Streamlit for the conversation, Groq for the language, and Hindsight for the memory that makes the conversation compound over time. Persistent memory for sales conversations  github repositiores - deal-intelligence-agent

team photo - satya and jathin

Top comments (1)