<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: D Rupika gouri</title>
    <description>The latest articles on DEV Community by D Rupika gouri (@rupikagouri).</description>
    <link>https://dev.to/rupikagouri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4148152%2F7aebfc85-3514-4ca2-abb3-e355becc2dd6.jpg</url>
      <title>DEV Community: D Rupika gouri</title>
      <link>https://dev.to/rupikagouri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rupikagouri"/>
    <language>en</language>
    <item>
      <title>I Gave My AI Assistant a Memory. Turns Out, That Was the Whole Problem.</title>
      <dc:creator>D Rupika gouri</dc:creator>
      <pubDate>Mon, 28 Sep 2026 22:36:43 +0000</pubDate>
      <link>https://dev.to/rupikagouri/i-gave-my-ai-assistant-a-memory-turns-out-that-was-the-whole-problem-5441</link>
      <guid>https://dev.to/rupikagouri/i-gave-my-ai-assistant-a-memory-turns-out-that-was-the-whole-problem-5441</guid>
      <description>&lt;h1&gt;
  
  
  I Gave My AI Assistant a Memory. Turns Out, That Was the Whole Problem.
&lt;/h1&gt;

&lt;p&gt;The hardest part of building an AI assistant for a long-running sales process wasn't getting a language model to answer questions.&lt;/p&gt;

&lt;p&gt;That part is almost suspiciously easy.&lt;/p&gt;

&lt;p&gt;The harder problem was making the answer &lt;strong&gt;change when something important in the deal changed&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That distinction is what led me to build Foresight around &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight&lt;/a&gt;. I didn't want deal history to sit around as a giant pile of documents that the model occasionally got to rummage through. I wanted it to behave more like actual state.&lt;/p&gt;

&lt;p&gt;Because a sales deal isn't just a conversation.&lt;/p&gt;

&lt;p&gt;It's a moving target with commitments, constraints, people, deadlines, budgets, and approximately seventeen things that someone promised three weeks ago and has now forgotten.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with a stateless sales assistant
&lt;/h2&gt;

&lt;p&gt;Enterprise sales is basically accumulated context.&lt;/p&gt;

&lt;p&gt;A deal can run for weeks or months. Different people enter at different stages. A technical evaluator cares about architecture. Security has its own requirements. Finance has a budget. Procurement has contract constraints. And somehow the salesperson is expected to remember what was promised to all of them.&lt;/p&gt;

&lt;p&gt;A conventional LLM interface starts with the latest message:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Can you give us 40% off and get us into production in two weeks?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Technically, that's a perfectly understandable request.&lt;/p&gt;

&lt;p&gt;Practically, it tells me almost nothing about whether that request makes sense for &lt;strong&gt;this particular deal&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the ACME example I built, the model needs to know that the current quote is $72,000, the customer's budget is $50,000, a competitor is around $48,000, the normal deployment time is four to six weeks, and the security team is still waiting for a SOC 2 report.&lt;/p&gt;

&lt;p&gt;And then there's the tiny detail that tends to ruin everything:&lt;/p&gt;

&lt;p&gt;The customer never actually agreed to a two-week deployment.&lt;/p&gt;

&lt;p&gt;So the useful question isn't:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"How should I answer this message?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What does this message mean given everything that has already happened?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That became the central design problem for Foresight.&lt;/p&gt;

&lt;h2&gt;
  
  
  I started treating the deal like living state
&lt;/h2&gt;

&lt;p&gt;I split the system into two kinds of knowledge.&lt;/p&gt;

&lt;p&gt;The first is relatively stable company knowledge: standard deployment timelines, discount authority, security requirements, and other rules that apply to the seller.&lt;/p&gt;

&lt;p&gt;The second is deal memory: what actually happened with this particular customer.&lt;/p&gt;

&lt;p&gt;Foresight stores that second category in a separate Hindsight memory bank for the deal. The architecture in the repository makes that boundary pretty clear.&lt;/p&gt;

&lt;p&gt;The important part is that I'm not asking the LLM to somehow remember an entire three-month conversation and then hope it develops a photographic memory overnight.&lt;/p&gt;

&lt;p&gt;Instead, the application can retain what happened and later recall the parts that matter to the current request.&lt;/p&gt;

&lt;p&gt;This is where Hindsight's GitHub repository and its agent memory documentation fit naturally into the architecture.&lt;/p&gt;

&lt;p&gt;That changed how I thought about the problem.&lt;/p&gt;

&lt;p&gt;Memory stopped being a UI feature.&lt;/p&gt;

&lt;p&gt;It became an input to the reasoning pipeline.&lt;/p&gt;

&lt;p&gt;And honestly, that felt much more useful.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why retrieval alone wasn't enough
&lt;/h2&gt;

&lt;p&gt;At first glance, the obvious approach is pretty simple:&lt;/p&gt;

&lt;p&gt;Retrieve some memories, shove them into the prompt, and ask the LLM what it thinks.&lt;/p&gt;

&lt;p&gt;Technically, that works.&lt;/p&gt;

&lt;p&gt;But it leaves out the interesting question:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when the new request contradicts something I already know?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For Foresight, the retrieved memories aren't just background information. They're evidence.&lt;/p&gt;

&lt;p&gt;The system checks that evidence against the new request and against company constraints.&lt;/p&gt;

&lt;p&gt;That's where the Collision Check comes in.&lt;/p&gt;

&lt;p&gt;For example, if the customer asks for a two-week deployment, Foresight can recall that the engineering team previously established a four-to-six-week deployment window.&lt;/p&gt;

&lt;p&gt;If the customer asks for a large discount, it can recall the customer's budget, the current quote, the competitor's price, and the salesperson's discount authority.&lt;/p&gt;

&lt;p&gt;If security is still waiting for a document that was promised earlier, that's another collision.&lt;/p&gt;

&lt;p&gt;The model is still doing the language reasoning.&lt;/p&gt;

&lt;p&gt;The difference is that it's reasoning over a deliberately assembled representation of the deal rather than staring at one isolated prompt like it just woke up five minutes ago.&lt;/p&gt;

&lt;h2&gt;
  
  
  The interesting part: memory can actually change the answer
&lt;/h2&gt;

&lt;p&gt;This is the part of Foresight I found most useful.&lt;/p&gt;

&lt;p&gt;Initially, the ACME deal has an unresolved security blocker. The memory records that the SOC 2 report was promised to the security lead and that no fulfilment has been recorded.&lt;/p&gt;

&lt;p&gt;Then the customer's new request arrives:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Can you give us 40% off and get us into production in two weeks?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The Collision Check finds several pieces of context.&lt;/p&gt;

&lt;p&gt;First, security has said that production data cannot be used until the SOC 2 review is complete.&lt;/p&gt;

&lt;p&gt;Second, the technical team has established a normal deployment window of four to six weeks.&lt;/p&gt;

&lt;p&gt;Third, the commercial request has to be considered alongside a $50,000 budget, a $48,000 competitor price, a $72,000 current quote, and the salesperson's discount authority.&lt;/p&gt;

&lt;p&gt;So the resulting recommendation isn't simply "accept" or "reject."&lt;/p&gt;

&lt;p&gt;Instead, the application can point to the evidence and tell the salesperson what needs to happen first.&lt;/p&gt;

&lt;p&gt;That's a much more useful answer.&lt;/p&gt;

&lt;p&gt;The system isn't just saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Here's a paragraph that sounds reasonable."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's saying:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Here's what I remember, here's what conflicts, and here's why that matters."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That distinction ended up being one of the most important design decisions I made.&lt;/p&gt;

&lt;h2&gt;
  
  
  The commitment ledger makes the state visible
&lt;/h2&gt;

&lt;p&gt;This is also where the commitment ledger became useful.&lt;/p&gt;

&lt;p&gt;Instead of storing promises as random pieces of text buried somewhere in conversation history, Foresight exposes them as actual state.&lt;/p&gt;

&lt;p&gt;It sounds like a small UI decision, but it makes the reasoning much easier to follow.&lt;/p&gt;

&lt;p&gt;A salesperson can look at the deal and immediately understand why the system is raising a warning.&lt;/p&gt;

&lt;p&gt;And more importantly, the system has something concrete to update.&lt;/p&gt;

&lt;p&gt;Which brings me to the part I cared about most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Updating memory matters more than displaying it
&lt;/h2&gt;

&lt;p&gt;Suppose the salesperson actually sends the SOC 2 report.&lt;/p&gt;

&lt;p&gt;If memory is only being used as a read-only retrieval feature, not much has fundamentally changed.&lt;/p&gt;

&lt;p&gt;The UI might show a new status, but unless that change reaches the reasoning layer, the system is still operating on yesterday's understanding of the deal.&lt;/p&gt;

&lt;p&gt;Foresight instead treats the update as a memory operation.&lt;/p&gt;

&lt;p&gt;The salesperson marks the SOC 2 report as sent.&lt;/p&gt;

&lt;p&gt;Hindsight gets updated.&lt;/p&gt;

&lt;p&gt;The Collision Check runs again.&lt;/p&gt;

&lt;p&gt;The recommendation is recalculated.&lt;/p&gt;

&lt;p&gt;Now the security collision disappears.&lt;/p&gt;

&lt;p&gt;The system can move from:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Don't discuss deployment dates until the security requirement is satisfied."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;toward:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The security blocker has changed. Now we can actually discuss the commercial request and deployment timeline."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the point where Hindsight stopped feeling like some external memory service I had bolted onto the application.&lt;/p&gt;

&lt;p&gt;It started feeling like part of the application's state model.&lt;/p&gt;

&lt;p&gt;The memory isn't there just to make the assistant sound more conversational.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The memory changes what the system concludes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And that's a much more interesting use of memory than teaching an AI assistant to remember someone's name.&lt;/p&gt;

&lt;h2&gt;
  
  
  Foresight also looks forward
&lt;/h2&gt;

&lt;p&gt;I also wanted to keep a distinction between remembering the past and anticipating what might happen next.&lt;/p&gt;

&lt;p&gt;That's where the Predictive Foresight section comes in.&lt;/p&gt;

&lt;p&gt;It uses the current deal stage, unresolved stakeholder requirements, and previous inquiries to anticipate likely customer questions.&lt;/p&gt;

&lt;p&gt;For example, if the CFO has a hard budget deadline and procurement is becoming involved, the next questions probably aren't going to be about the technical architecture.&lt;/p&gt;

&lt;p&gt;They might be about payment terms, renewal increases, or contract timing.&lt;/p&gt;

&lt;p&gt;Foresight can surface those likely questions before they arrive and suggest counter-questions for the salesperson.&lt;/p&gt;

&lt;p&gt;So the broader flow becomes pretty simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember what happened.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understand what's happening now.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anticipate what might happen next.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hindsight supplies the first part.&lt;/p&gt;

&lt;p&gt;The rest of the application turns that memory into current and forward-looking reasoning.&lt;/p&gt;

&lt;p&gt;For a deeper explanation of the underlying concept, I found &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;Vectorize's explanation of agent memory&lt;/a&gt; useful because it frames memory as something an agent can retain and retrieve over time rather than simply stuffing increasingly absurd amounts of text into every prompt.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I learned building it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Memory needs a reason to exist
&lt;/h3&gt;

&lt;p&gt;Adding memory because an application is "AI" isn't really a design.&lt;/p&gt;

&lt;p&gt;It's a checkbox.&lt;/p&gt;

&lt;p&gt;I found it much more useful to start with a specific failure mode:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The assistant gives an answer that is locally reasonable but globally wrong for the deal.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once that failure is clear, the memory requirements become much easier to define.&lt;/p&gt;

&lt;p&gt;I need previous commitments.&lt;/p&gt;

&lt;p&gt;I need stakeholder requirements.&lt;/p&gt;

&lt;p&gt;I need commercial context.&lt;/p&gt;

&lt;p&gt;I need decisions and changes over time.&lt;/p&gt;

&lt;p&gt;I don't need every sentence ever exchanged to be treated as equally important.&lt;/p&gt;

&lt;p&gt;That last part matters more than it sounds. More context isn't automatically better context. Sometimes it's just more text wearing a fake moustache and pretending to be useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Retrieval should produce evidence, not just context
&lt;/h3&gt;

&lt;p&gt;The useful output of memory retrieval isn't a giant block of text that gets dumped into a prompt.&lt;/p&gt;

&lt;p&gt;For Foresight, recalled information needs to participate in an actual check.&lt;/p&gt;

&lt;p&gt;The system should be able to identify which remembered fact conflicts with the current request and explain why that conflict matters.&lt;/p&gt;

&lt;p&gt;That's why the Collision Check exists as a separate concept rather than just being another prompt.&lt;/p&gt;

&lt;p&gt;The model gets context.&lt;/p&gt;

&lt;p&gt;The application gives that context a job.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Mutable memory is more interesting than historical memory
&lt;/h3&gt;

&lt;p&gt;A memory system becomes much more useful when it can represent change.&lt;/p&gt;

&lt;p&gt;"Security is waiting for the SOC 2 report" and "Security received the SOC 2 report" aren't two unrelated facts.&lt;/p&gt;

&lt;p&gt;They're two states of the same deal.&lt;/p&gt;

&lt;p&gt;The application needs to be able to move from one state to the other and make downstream reasoning reflect that change.&lt;/p&gt;

&lt;p&gt;That was a big shift in how I thought about memory.&lt;/p&gt;

&lt;p&gt;I wasn't trying to build an archive.&lt;/p&gt;

&lt;p&gt;I was trying to build something closer to a changing state model.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Keep company knowledge separate from deal memory
&lt;/h3&gt;

&lt;p&gt;This separation prevented a subtle class of mistakes.&lt;/p&gt;

&lt;p&gt;"Deployment normally takes four to six weeks" is a company constraint.&lt;/p&gt;

&lt;p&gt;"ACME has not completed its security review" is a deal fact.&lt;/p&gt;

&lt;p&gt;They're both relevant, but they're relevant for different reasons.&lt;/p&gt;

&lt;p&gt;Mixing them into one giant knowledge base makes it harder to understand where a recommendation came from.&lt;/p&gt;

&lt;p&gt;Keeping them separate lets the reasoning layer combine stable policy with customer-specific history without turning the whole thing into one enormous context soup.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. The best memory demo is a changed decision
&lt;/h3&gt;

&lt;p&gt;Showing that an assistant remembers someone's name isn't particularly impressive.&lt;/p&gt;

&lt;p&gt;Showing that updating one remembered fact removes a blocker and changes the recommended action is much stronger.&lt;/p&gt;

&lt;p&gt;It gives memory an observable consequence.&lt;/p&gt;

&lt;p&gt;And I think that's the real test.&lt;/p&gt;

&lt;p&gt;If I remove or update a memory and nothing meaningful changes downstream, then why is that memory there?&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I would take it next
&lt;/h2&gt;

&lt;p&gt;The architecture is deliberately small:&lt;/p&gt;

&lt;p&gt;Deal memory.&lt;/p&gt;

&lt;p&gt;Recall.&lt;/p&gt;

&lt;p&gt;Collision detection.&lt;/p&gt;

&lt;p&gt;Evidence.&lt;/p&gt;

&lt;p&gt;Action-oriented response.&lt;/p&gt;

&lt;p&gt;I would resist the temptation to turn it into a collection of agents just because that is fashionable right now.&lt;/p&gt;

&lt;p&gt;Not every software problem needs twelve agents having a meeting with each other.&lt;/p&gt;

&lt;p&gt;The interesting engineering problem here is maintaining a useful representation of deal state and making changes to that state propagate into reasoning reliably.&lt;/p&gt;

&lt;p&gt;The broader lesson I took from building Foresight is that long-running AI applications need something closer to &lt;strong&gt;state management&lt;/strong&gt; than chat history.&lt;/p&gt;

&lt;p&gt;Foresight started from a pretty simple observation:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A sales conversation cannot be understood from its latest message alone.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Using Hindsight gave me a way to make that history persistent, queryable, and updateable.&lt;/p&gt;

&lt;p&gt;The application then turns those memories into collision checks, commitments, recommendations, and predictions.&lt;/p&gt;

&lt;p&gt;So the assistant doesn't just remember what happened.&lt;/p&gt;

&lt;p&gt;It can use what happened to understand what's happening now, and prepare for what might happen next.&lt;/p&gt;

&lt;p&gt;Which, admittedly, is a much more useful definition of "AI memory" than remembering that someone's favorite color is blue.&lt;/p&gt;

</description>
      <category>agents</category>
      <category>ai</category>
      <category>llm</category>
      <category>software</category>
    </item>
  </channel>
</rss>
