What Happened When DealMind Could Recall Past Objections
What Happened When DealMind Could Recall Past Objections Building persistent deal memory with Hindsight changed how I thought about context, retrieval, and the boundary between application state and agent memory. The fir
What Happened When DealMind Could Recall Past Objections
Building persistent deal memory with Hindsight changed how I thought about context, retrieval, and the boundary between application state and agent memory.
The first version of DealMind could answer questions about a deal. The more useful version could remember what had happened in previous meetings and use that history when preparing for the next one.
That sounds like a small difference. Architecturally, it is not.
I was not trying to build another chatbot with a larger prompt. I wanted to build a system where an interaction could become durable experience, and where that experience could influence a later decision. Hindsight became the memory layer that made that loop practical.
DealMind in one view
DealMind is a B2B deal-intelligence application built around a simple workflow: capture what happens during a deal, retain the important parts, recall relevant history when a decision is being made, and use that context to produce a more specific recommendation.
The application has three distinct responsibilities:
• Application state — customers, deals, interactions, stages, and other structured data.
• LLM processing — extracting useful information from interactions and generating meeting preparation or recommendations.
• Persistent memory — storing and retrieving experience that should remain useful across future interactions.
I deliberately kept those responsibilities separate.
A relational database is a good source of truth for:
deal.stage
deal.customer_id
deal.value
interaction.timestamp
interaction.type
It is less natural for a question such as:
What objections has this customer raised before, and what happened after we addressed them?
That is an experience-retrieval problem.
For that layer, I use Hindsight's agent memory system.
The resulting architecture is roughly:
+----------------------+
| DealMind Frontend |
+----------+-----------+
|
v
+----------------------+
| Backend / API |
+----------+-----------+
|
+-------------+-------------+
| |
v v
+------------------+ +------------------+
| Structured Data | | Hindsight Memory |
| deals, customers | | retain / recall |
| interactions | | historical |
+------------------+ | experience |
+--------+---------+
|
v
+------------------+
| LLM reasoning |
+------------------+
|
v
Meeting brief /
recommendation
Figure 1. DealMind project overview and deal-intelligence workflow.
The important part is the feedback path.
A meeting is not simply the end of a request. The useful information from that meeting can become memory for the next request.
The problem was not storing transcripts
My first instinct was to treat memory as another persistence problem.
Sales systems already store plenty of information: notes, transcripts, CRM records, emails, meeting summaries. It is tempting to assume that if the data exists somewhere, the agent effectively has memory.
It doesn't.
Consider a customer saying:
"The pricing is higher than we expected."
A transcript system can store that sentence indefinitely.
A month later, the useful question is different:
How should I handle the pricing objection in my next meeting?
Now the agent needs context around the original statement.
Was pricing the only concern? Was a competitor mentioned? Was a security review required? Which stakeholders were involved? Had the customer already heard an ROI argument? What commitments were made?
The difference is important:
Storage preserves information. Memory makes previous experience available to a future decision.
That distinction drove the way I integrated Hindsight into DealMind.
The Hindsight GitHub repository exposes a memory model built around operations such as retain, recall, and reflect. In DealMind, the core application loop uses retention and recall to make previous interactions available when they are relevant to a new task.
Keeping Hindsight behind a service boundary
I did not want Hindsight calls scattered throughout API handlers, business logic, and frontend code.
The repository has a dedicated hindsight_service.py integration point. That gives the application one boundary around the memory system.
A simplified version of the integration looks like this:
def retain_interaction(deal_id: str, content: str, context: str):
bank_id = f"deal-{deal_id}"
return hindsight_client.retain(
bank_id=bank_id,
content=content,
context=context,
)
Figure 2. Actual DealMind Hindsight retention integration from hindsight_service.py.
The important design decision is not the number of lines in the function. It is the ownership boundary.
The application knows that it wants to retain an interaction. The memory service owns the details of talking to Hindsight.
That gives me a natural place to handle:
• memory configuration
• connection management
• error handling
• memory scope
• logging
• changes to the Hindsight integration
It also prevents the rest of the application from becoming tightly coupled to a particular memory API.
For DealMind, I associate memory with the deal context so that a customer's history can accumulate across interactions.
The lifecycle becomes:
Meeting
|
v
Extract useful facts
|
+------> Save structured deal state
|
+------> Retain useful experience
|
v
Hindsight
That is the first half of the loop.
Recall should happen when a decision needs context
The next question was harder:
When should the agent retrieve memory?
The obvious implementation is to load every historical memory whenever the deal is opened and put everything into the prompt.
I did not want that.
The useful question is not:
What does this deal know?
It is:
What does the agent need to know for this task?
So the recall path is task-driven.
Conceptually:
def recall_for_deal(deal_id: str, query: str):
bank_id = f"deal-{deal_id}"
result = hindsight_client.recall(
bank_id=bank_id,
query=query,
)
return result.results
For meeting preparation, the query can focus on previous objections, stakeholders, competitors, commitments, and outcomes.
For a follow-up task, the relevant history might instead be recent commitments and unresolved questions.
That difference matters because persistent memory is not just about increasing the amount of context available to an LLM.
It is about selecting the right historical context for the current action.
The Hindsight documentation makes this memory lifecycle explicit, which fits the way I wanted to structure DealMind.
The interaction that changed the design
The most useful test case was a familiar sales interaction.
Imagine the first meeting contains:
Customer: The pricing is higher than we expected.
Customer: We are also comparing you with Competitor X.
Customer: Our security team will need to review this.
The interaction is useful in several different ways.
Pricing is an objection.
Competitor X is competitive context.
The security review is a stakeholder and process constraint.
Those facts should not disappear after the meeting summary is generated.
They become durable context.
Later, the rep asks:
Prepare me for my next meeting with this customer.
Without persistent memory, the answer depends on whatever current deal context happens to be supplied to the model.
With memory, DealMind can first retrieve relevant history:
Previous objection:
Pricing was considered high.
Competitive context:
Competitor X was mentioned.
Process constraint:
Security review is required.
Previous discussion:
Value and ROI were discussed.
The LLM can then use that recalled context when generating the meeting brief.
Figure 3. Task-driven recall of relevant historical deal memories.
That is the behavior I was looking for.
The agent is not simply generating a plausible sales answer. It is generating an answer about this customer, based on what happened before.
Why structured data and memory should remain separate
Once persistent memory became useful, there was an obvious temptation to put everything into Hindsight.
I resisted that.
There are two different questions:
Current state
What is the current stage of this deal?
Historical experience
What happened in previous conversations that might matter now?
The first is deterministic application state. The second is contextual experience.
I want the database to remain the source of truth for entities and current state.
I want Hindsight to provide historical context that helps the agent reason about what to do next.
That separation also makes the system easier to debug.
If the current deal stage is wrong, I inspect the application data.
If the agent failed to remember a previous objection, I inspect the retention and recall path.
If the memory was recalled correctly but the recommendation ignored it, I inspect the reasoning and prompt construction.
Those are different failure modes, and the architecture gives them different places to investigate.
Memory has to change behavior
One of the easiest mistakes in an agent application is to build a memory screen and declare the system "memory-enabled."
I don't think that is a meaningful test.
The real test is simple:
Does removing memory change the behavior?
The conceptual difference is:
No historical context
response = generate_recommendation(
deal_context=deal_context,
memory_context=[],
)
versus:
Current deal state + relevant history
memories = recall_for_deal(
deal_id,
"previous objections, stakeholders, competitors, commitments",
)
response = generate_recommendation(
deal_context=deal_context,
memory_context=memories,
)
Figure 4. Actual DealMind Hindsight recall implementation from hindsight_service.py.
The second path is where Hindsight actually contributes.
If both paths consistently produce the same answer, the memory layer is decorative.
A useful memory system should make the response more specific when the history contains relevant information.
For example, a repeated pricing objection should affect preparation for that customer. A competitor that appeared in previous meetings should be considered when relevant. A previous commitment should be visible when preparing the next conversation.
That is a much stronger definition of memory than "we can search old notes."
Making the memory visible to the user
There is another problem with agent memory: invisible context is difficult to trust.
If the system produces a recommendation based on historical information, the user should be able to understand where that context came from.
That is why DealMind includes memory-oriented workflows alongside meeting and deal workflows.
The goal is not to expose every internal memory record.
The goal is to make the relevant historical context inspectable.
Figure 5. DealMind meeting brief showing recalled context and Hindsight memory sources.
The end-to-end flow is:
User asks for meeting preparation
|
v
Backend identifies the current task
|
v
Build a task-specific recall query
|
v
Hindsight returns relevant memories
|
v
LLM receives current deal state
- recalled historical context | v Meeting brief / recommendation | v User can inspect the supporting context Hindsight is not replacing the LLM here. It is giving the LLM a better set of facts and experiences to reason over. The part I would watch in production I would not use "number of memories stored" as the primary metric. That number is easy to increase and tells me very little. I would instead monitor the quality of the memory loop:
- Retention quality — Did the system preserve the information that could matter later?
- Recall relevance — Did it retrieve memories related to the current task?
- Grounded generation — Did the recommendation actually use the recalled context?
- Traceability — Can the user understand why the recommendation contains customer-specific details?
- Memory reuse — Did information from one interaction become useful in a later interaction? I would also pay attention to irrelevant retrieval. Too little memory makes an agent forgetful. Too much irrelevant memory makes an agent noisy. The engineering problem is not "remember everything." It is "remember enough of the right things, and retrieve them at the right time." What I learned
- Persistent memory is an architectural concern I initially viewed memory as something that could be bolted onto an existing LLM application. Once memory affects recommendations, that stops being true. Retention, recall, memory scope, failure handling, and evidence presentation all become part of the application's architecture.
- Retrieval should be driven by the task I found it more useful to ask what the agent needs for the current decision than to dump the entire history into context. That makes recall an intentional operation rather than a generic search step.
- A database and a memory system answer different questions I do not want Hindsight to become a second CRM. The database owns structured truth. Hindsight provides historical experience that can help interpret the current situation. Keeping that boundary clear makes both systems easier to reason about.
- Memory is only valuable when it changes a later interaction A successful retain() call is not the outcome. A successful recall() call is not the outcome either. The outcome is a better-informed later decision. That is the behavior I would test first.
- The interesting unit is the loop The most important part of the design is not any individual API call. It is the complete lifecycle: interaction | v retain | v recall | v decision | v outcome | v retain again That is what turns an LLM application from a sequence of isolated requests into a system that can accumulate experience. Where I ended up The most important change in DealMind was not another prompt, another dashboard, or another model. It was giving previous interactions a durable path back into the next decision. A customer can object to price in one meeting, mention a competitor in another, introduce a security requirement later, and change priorities again after that. A stateless interaction treats those as separate inputs. A persistent agent can treat them as one evolving history. That is where Hindsight fits into DealMind: retain provides a durable path for experience, recall makes relevant history available to later tasks, and the application LLM turns that history into a decision or recommendation. The result is still an LLM application. The difference is that the next interaction does not have to start from zero.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.



