<?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: Karanam Lakshmi Sai Amogha</title>
    <description>The latest articles on DEV Community by Karanam Lakshmi Sai Amogha (@flora1007).</description>
    <link>https://dev.to/flora1007</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%2F4150039%2F8253f0c2-6f4c-41d1-9447-7f7c1ac69895.png</url>
      <title>DEV Community: Karanam Lakshmi Sai Amogha</title>
      <link>https://dev.to/flora1007</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/flora1007"/>
    <language>en</language>
    <item>
      <title>Two API Calls Gave My Sales Agent a Memory</title>
      <dc:creator>Karanam Lakshmi Sai Amogha</dc:creator>
      <pubDate>Tue, 29 Sep 2026 15:36:03 +0000</pubDate>
      <link>https://dev.to/flora1007/two-api-calls-gave-my-sales-agent-a-memory-2jan</link>
      <guid>https://dev.to/flora1007/two-api-calls-gave-my-sales-agent-a-memory-2jan</guid>
      <description>&lt;p&gt;The most expensive moment in a sales call is when the rep asks a question the client already answered three weeks ago.&lt;/p&gt;

&lt;p&gt;I built a small AI Sales Agent to solve that problem. It stores previous client conversations and recalls the relevant information before the next call to generate a more useful pre-call briefing.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;The Deal Intelligence Agent is a FastAPI application that connects a simple browser interface with Hindsight memory and a Groq LLM.&lt;/p&gt;

&lt;p&gt;The main flow is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A salesperson enters the client name and call transcript.&lt;/li&gt;
&lt;li&gt;The transcript is stored using Hindsight.&lt;/li&gt;
&lt;li&gt;Before the next call, the agent recalls relevant information about that client.&lt;/li&gt;
&lt;li&gt;The recalled memories are sent to the LLM.&lt;/li&gt;
&lt;li&gt;The LLM generates a tactical pre-call briefing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The main technologies used are Python, FastAPI, Hindsight and Groq.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhzkdev34dit5wh4tyi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwhzkdev34dit5wh4tyi.png" alt="Deal Intelligence Agent Architecture" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Architecture of the Deal Intelligence Agent: Browser UI → FastAPI Backend → Hindsight memory and Groq LLM.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The memory layer
&lt;/h2&gt;

&lt;p&gt;The Hindsight client is configured directly in the FastAPI application:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;hindsight_client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Hindsight&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;base_url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;https://api.hindsight.vectorize.io&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;api_key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;HINDSIGHT_API_KEY&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;BANK_ID&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;deal-intelligence-bank&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;br&gt;
`&lt;/p&gt;

&lt;p&gt;The API key is loaded from an environment variable, while the bank ID identifies the memory bank used by the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmcxjv34d0tc6tg7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmcxjv34d0tc6tg7d.png" alt="Hindsight client setup" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Hindsight client setup and memory bank configuration in &lt;code&gt;main.py&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Storing a conversation
&lt;/h2&gt;

&lt;p&gt;When a sales call is completed, the transcript is sent to the &lt;code&gt;/process-call&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`python&lt;br&gt;
@app.post("/process-call")&lt;br&gt;
def process_call(data: CallInput):&lt;br&gt;
    content_text = f"Client: {data.client_name}. Call Details: {data.transcript}"&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hindsight_client.retain(
    bank_id=BANK_ID,
    content=content_text
)

return {
    "status": "success",
    "message": "Call stored successfully in Hindsight memory!"
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The original conversation is stored instead of creating a separate extraction schema. This keeps the transcript as the source of truth.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recalling information before a call
&lt;/h2&gt;

&lt;p&gt;When the salesperson requests a briefing, the application creates a query based on the information that matters for the client:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
query_text = f"Objections, preferences, and history for {client_name}"&lt;/p&gt;

&lt;p&gt;memories = hindsight_client.recall(&lt;br&gt;
    bank_id=BANK_ID,&lt;br&gt;
    query=query_text&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;The important part is that the agent is not simply looking up a fixed database record. It is asking memory for relevant context about the client.&lt;/p&gt;

&lt;p&gt;The recalled information is then provided to the LLM:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
prompt = f"""&lt;br&gt;
You are an expert sales strategist.&lt;/p&gt;

&lt;p&gt;Based on the following historical memories recalled from Hindsight:&lt;/p&gt;

&lt;p&gt;{memory_context}&lt;/p&gt;

&lt;p&gt;Generate a precise, tactical pre-call briefing for {client_name},&lt;br&gt;
highlighting past objections and suggested strategies.&lt;br&gt;
"""&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmcxjv34d0tc6tg7d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frmcxjv34d0tc6tg7d.png" alt="main.py" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The FastAPI application, environment configuration, Hindsight client and memory bank in &lt;code&gt;main.py&lt;/code&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The complete flow
&lt;/h2&gt;

&lt;p&gt;The complete process is:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The salesperson enters a client name and transcript.&lt;/li&gt;
&lt;li&gt;FastAPI receives the request.&lt;/li&gt;
&lt;li&gt;Hindsight &lt;code&gt;retain()&lt;/code&gt; stores the conversation.&lt;/li&gt;
&lt;li&gt;Before the next call, the application creates a recall query.&lt;/li&gt;
&lt;li&gt;Hindsight &lt;code&gt;recall()&lt;/code&gt; retrieves relevant memories.&lt;/li&gt;
&lt;li&gt;The memories are added to the LLM prompt.&lt;/li&gt;
&lt;li&gt;Groq generates the pre-call briefing.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The central idea is simple:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retain the conversation → Recall the relevant history → Generate a client-specific briefing.&lt;/strong&gt;&lt;/p&gt;

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

&lt;p&gt;The biggest lesson from this project was that an AI agent becomes much more useful when it can access relevant context from previous interactions.&lt;/p&gt;

&lt;p&gt;Instead of generating a generic sales response every time, the agent can use information from earlier conversations to make the briefing specific to the client.&lt;/p&gt;

&lt;p&gt;The memory layer also keeps the application architecture simple. Hindsight handles storing and recalling the information while the application focuses on the sales workflow and the LLM handles generation.&lt;/p&gt;

&lt;p&gt;There are still improvements I would make for a production version, including stronger authentication, better separation between different client accounts, structured handling of recalled memories and more robust error handling.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;The Deal Intelligence Agent started with a simple idea: a sales agent should not have to forget everything after every conversation.&lt;/p&gt;

&lt;p&gt;By combining FastAPI, Hindsight memory and an LLM, the application can retain previous conversations, recall relevant information and use that context to generate a more useful pre-call briefing.&lt;/p&gt;

&lt;p&gt;The source code is available in the &lt;a href="https://github.com/chintalapatiakhila1702-coder/deal-intelligence-agent" rel="noopener noreferrer"&gt;Deal Intelligence Agent repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can learn more about Hindsight in the &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight documentation&lt;/a&gt; and &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight GitHub repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;`&lt;/p&gt;

&lt;p&gt;Available next action: :contentReference[oaicite:0]{index=0}&lt;br&gt;
`&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
