<?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: Bharath N</title>
    <description>The latest articles on DEV Community by Bharath N (@bharathbuoy).</description>
    <link>https://dev.to/bharathbuoy</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%2F4232511%2F191d196e-3269-4572-8c6a-d53fa653d51a.jpg</url>
      <title>DEV Community: Bharath N</title>
      <link>https://dev.to/bharathbuoy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bharathbuoy"/>
    <language>en</language>
    <item>
      <title>I Used Hindsight to Remember a Real Backend Failure</title>
      <dc:creator>Bharath N</dc:creator>
      <pubDate>Sat, 07 Nov 2026 17:15:48 +0000</pubDate>
      <link>https://dev.to/bharathbuoy/i-used-hindsight-to-remember-a-real-backend-failure-4bjn</link>
      <guid>https://dev.to/bharathbuoy/i-used-hindsight-to-remember-a-real-backend-failure-4bjn</guid>
      <description>&lt;h1&gt;
  
  
  I Used Hindsight to Remember a Real Backend Failure
&lt;/h1&gt;

&lt;p&gt;An AI agent can explain an error, suggest a fix, and even write a detailed troubleshooting guide. But what happens when the same problem occurs again?&lt;/p&gt;

&lt;p&gt;Does it remember how the team solved it last time, or does it start investigating from zero?&lt;/p&gt;

&lt;p&gt;That question led me to build &lt;strong&gt;OpsRecall&lt;/strong&gt;, an AI incident response agent that uses persistent memory to help engineers investigate recurring technical problems.&lt;/p&gt;

&lt;p&gt;The interesting part wasn't getting an LLM to explain an error. It was making sure the agent could remember a verified solution and use that experience during a future investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem: Engineers forget, systems don't
&lt;/h2&gt;

&lt;p&gt;Imagine you're working on a backend application. One evening, the service suddenly stops responding. You investigate the logs, identify the root cause, fix the issue, and move on.&lt;/p&gt;

&lt;p&gt;A few days later, something similar happens.&lt;/p&gt;

&lt;p&gt;You might remember the problem. Another developer on your team might not. The fix could be buried in an old Slack conversation, a terminal history, or someone's personal notes.&lt;/p&gt;

&lt;p&gt;This is a knowledge-retention problem.&lt;/p&gt;

&lt;p&gt;Traditional chatbots are mostly designed around the current conversation. Even when they have access to previous messages, conversation history isn't necessarily a reliable way to store, retrieve and reuse verified engineering experience.&lt;/p&gt;

&lt;p&gt;I wanted to explore a different approach: what if an incident response agent could build up a memory of problems and their confirmed solutions?&lt;/p&gt;

&lt;p&gt;That's the idea behind OpsRecall.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is OpsRecall?
&lt;/h2&gt;

&lt;p&gt;OpsRecall is an AI-assisted incident response application designed for software engineers and DevOps teams.&lt;/p&gt;

&lt;p&gt;An engineer submits an incident with information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Service name&lt;/li&gt;
&lt;li&gt;Incident severity&lt;/li&gt;
&lt;li&gt;Error description&lt;/li&gt;
&lt;li&gt;Application logs&lt;/li&gt;
&lt;li&gt;Additional technical evidence&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The agent then searches its historical memory for similar incidents and uses the retrieved information to generate a troubleshooting plan.&lt;/p&gt;

&lt;p&gt;Once the engineer investigates and confirms the actual root cause and resolution, that experience is stored in Hindsight.&lt;/p&gt;

&lt;p&gt;The next time a similar incident occurs, OpsRecall can retrieve the previous experience instead of relying only on the language model's general knowledge.&lt;/p&gt;

&lt;p&gt;The workflow looks like this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;New Incident → Hindsight Recall → Groq Analysis → Engineer Verification → Hindsight Retain → Future Recall&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The central idea is simple: the system should become more useful as it accumulates verified engineering experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  The architecture behind it
&lt;/h2&gt;

&lt;p&gt;I built OpsRecall using a relatively straightforward architecture.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Frontend: React + Vite&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The frontend provides the incident investigation workspace. Engineers can submit incidents, review AI-generated recommendations, inspect historical memory matches and record confirmed resolutions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Backend: Python + FastAPI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;FastAPI handles API requests, validates incident information using Pydantic schemas and coordinates communication between Hindsight and Groq.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Persistent memory: Hindsight Cloud&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Hindsight is responsible for storing and retrieving incident experience. It is the application's durable memory layer, rather than a collection of temporary Python dictionaries or manually maintained JSON files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM: Groq&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I integrated Groq using the &lt;code&gt;openai/gpt-oss-120b&lt;/code&gt; model for incident analysis and recommendation generation.&lt;/p&gt;

&lt;p&gt;The application uses the Hindsight Python client and its asynchronous methods to work with memory without blocking FastAPI's event loop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I chose Hindsight
&lt;/h2&gt;

&lt;p&gt;The most important architectural decision was separating language-model reasoning from persistent memory.&lt;/p&gt;

&lt;p&gt;An LLM can analyse an incident and suggest possible causes. However, I didn't want to treat every generated response as established engineering knowledge.&lt;/p&gt;

&lt;p&gt;That distinction matters.&lt;/p&gt;

&lt;p&gt;An AI-generated hypothesis is not the same as an engineer-confirmed root cause.&lt;/p&gt;

&lt;p&gt;Hindsight provides three important operations for this workflow:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Recall – Search previous experience
&lt;/h3&gt;

&lt;p&gt;When an incident arrives, OpsRecall sends the incident context to Hindsight.&lt;/p&gt;

&lt;p&gt;The memory system searches for relevant historical information and returns matching memories.&lt;/p&gt;

&lt;p&gt;The retrieved information becomes additional context for Groq's analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Retain – Remember verified solutions
&lt;/h3&gt;

&lt;p&gt;After an engineer investigates the incident, they enter the confirmed root cause, resolution and prevention steps.&lt;/p&gt;

&lt;p&gt;OpsRecall sends that information to Hindsight through its Retain operation.&lt;/p&gt;

&lt;p&gt;The important design decision is that investigation and retention are separate operations. The agent does not automatically save its own hypotheses as verified solutions.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Reflect – Identify recurring patterns
&lt;/h3&gt;

&lt;p&gt;As the memory bank grows, the application can use Hindsight Reflect to generate insights across stored experiences.&lt;/p&gt;

&lt;p&gt;This can help identify recurring failure patterns and operational lessons.&lt;/p&gt;

&lt;p&gt;The core SDK operations used in my integration look like this:&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="c1"&gt;# Retrieve relevant historical incidents
&lt;/span&gt;&lt;span class="n"&gt;memories&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;hindsight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arecall&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;opsrecall&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;incident_text&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;low&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Store an engineer-verified resolution
&lt;/span&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;hindsight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;aretain&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;opsrecall&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;verified_resolution&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;verified incident resolution&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;metadata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;tags&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;document_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;incident_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;update_mode&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;replace&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Generate insights from accumulated experience
&lt;/span&gt;&lt;span class="n"&gt;insights&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;hindsight&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;areflect&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;opsrecall&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;query&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;What recurring causes and resolutions appear?&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;budget&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;low&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;max_tokens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;These are the actual Hindsight client operations used by the application, with the surrounding application-specific values simplified.&lt;/p&gt;

&lt;p&gt;You can explore the &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight GitHub repository&lt;/a&gt; and its &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; to understand the memory architecture in more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  The incident that proved the idea
&lt;/h2&gt;

&lt;p&gt;The most interesting part of building OpsRecall was testing it with a genuine technical issue from my development environment.&lt;/p&gt;

&lt;p&gt;I encountered a problem where my FastAPI backend could not bind to &lt;code&gt;127.0.0.1:8000&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The parent Uvicorn process had exited, but an orphaned &lt;code&gt;uvicorn --reload&lt;/code&gt; child process was still holding the listening socket.&lt;/p&gt;

&lt;p&gt;The application couldn't restart because the port was already occupied.&lt;/p&gt;

&lt;p&gt;I investigated the issue, verified the root cause, and resolved it.&lt;/p&gt;

&lt;p&gt;Instead of treating that experience as another forgotten debugging session, I used it as the first genuine incident in OpsRecall's Hindsight memory bank.&lt;/p&gt;

&lt;p&gt;The stored incident received the ID:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;INC-8A5C0380&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Here is what happened during the subsequent verification:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Operation&lt;/th&gt;
&lt;th&gt;Result&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Initial memory bank&lt;/td&gt;
&lt;td&gt;0 memories&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;First incident investigation&lt;/td&gt;
&lt;td&gt;No historical matches&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Verified resolution&lt;/td&gt;
&lt;td&gt;Successfully retained&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hindsight indexing&lt;/td&gt;
&lt;td&gt;7 memory units&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subsequent investigation&lt;/td&gt;
&lt;td&gt;Previous incident recalled&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Top similarity score&lt;/td&gt;
&lt;td&gt;1.0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The most important result was the Retain → Recall cycle.&lt;/p&gt;

&lt;p&gt;After storing the verified resolution, I submitted another investigation with similar symptoms.&lt;/p&gt;

&lt;p&gt;Hindsight retrieved the previous incident, including the detail about the orphaned Uvicorn child process keeping the listening socket open.&lt;/p&gt;

&lt;p&gt;The top retrieved match had a similarity score of 1.0.&lt;/p&gt;

&lt;p&gt;For me, this was the moment the project became more than an ordinary chatbot.&lt;/p&gt;

&lt;p&gt;The agent wasn't simply generating another generic explanation about a port conflict. It had access to an actual engineering experience stored during an earlier investigation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing beyond the happy path
&lt;/h2&gt;

&lt;p&gt;I also wanted to understand how the application behaved when its dependencies failed.&lt;/p&gt;

&lt;p&gt;I tested several scenarios:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An empty Hindsight memory bank.&lt;/li&gt;
&lt;li&gt;Hindsight becoming unavailable.&lt;/li&gt;
&lt;li&gt;A missing Groq API key.&lt;/li&gt;
&lt;li&gt;An invalid Groq model.&lt;/li&gt;
&lt;li&gt;An upstream Groq API error.&lt;/li&gt;
&lt;li&gt;Retaining a verified resolution and retrieving it again.&lt;/li&gt;
&lt;li&gt;Reflecting over the stored incident.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The exercised failure-handling checks returned the expected application errors rather than pretending the operations had succeeded.&lt;/p&gt;

&lt;p&gt;There are still limitations.&lt;/p&gt;

&lt;p&gt;I did not deliberately exhaust the Groq quota to trigger a live HTTP 429 rate-limit response. Its handling has not been independently verified with a real upstream 429.&lt;/p&gt;

&lt;p&gt;The engineer-confirmation workflow also needs stronger server-side authentication and authorization before the application can be considered production-ready.&lt;/p&gt;

&lt;p&gt;Reflect's provenance metadata requires further investigation as well. Its generated insights described the stored incident, but the SDK result did not populate the &lt;code&gt;based_on&lt;/code&gt; field as expected.&lt;/p&gt;

&lt;p&gt;I prefer documenting these limitations instead of claiming everything is perfect.&lt;/p&gt;

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

&lt;p&gt;There were a few lessons that stood out.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Conversation history is not the same as useful memory.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent needs a way to retain relevant experiences and retrieve them when the situation calls for it. Simply storing previous messages isn't enough.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. AI-generated suggestions should not automatically become facts.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There should be a clear boundary between an AI hypothesis and a verified engineering resolution.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Memory needs to be tested, not just connected.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Successfully connecting an API doesn't prove that persistent learning works. I needed to verify the actual sequence: Retain, then Recall, then confirm that the retrieved experience was relevant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Failure handling matters as much as successful execution.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An agent should be honest when memory is unavailable. It shouldn't invent historical incidents or pretend that a failed memory operation succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next?
&lt;/h2&gt;

&lt;p&gt;OpsRecall is currently a working prototype, not a complete production incident-management platform.&lt;/p&gt;

&lt;p&gt;There is more to build, particularly authentication, team-level memory isolation, structured model responses, audit trails and stronger provenance.&lt;/p&gt;

&lt;p&gt;But the foundation is working.&lt;/p&gt;

&lt;p&gt;I started with a simple question: can an AI agent remember how an engineering problem was actually solved?&lt;/p&gt;

&lt;p&gt;After building the integration, testing a real backend failure and retrieving the stored resolution through Hindsight, I have a working example of how that can be done.&lt;/p&gt;

&lt;p&gt;The goal isn't to replace engineers or automate every operational decision.&lt;/p&gt;

&lt;p&gt;It's to help engineers avoid solving the same problem from scratch every time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The first incident teaches the agent. The next incident gives it a chance to prove what it remembers.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Project and resources
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Project:&lt;/strong&gt; OpsRecall – AI Incident Response with Persistent Memory&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Source code:&lt;/strong&gt; &lt;a href="https://github.com/Bharath-buoy/opsrecall-starter" rel="noopener noreferrer"&gt;GitHub – OpsRecall&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Memory layer:&lt;/strong&gt; &lt;a href="https://github.com/vectorize-io/hindsight" rel="noopener noreferrer"&gt;Hindsight by Vectorize&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation:&lt;/strong&gt; &lt;a href="https://hindsight.vectorize.io/" rel="noopener noreferrer"&gt;Hindsight Developer Documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Agent memory concepts:&lt;/strong&gt; &lt;a href="https://vectorize.io/what-is-agent-memory" rel="noopener noreferrer"&gt;What Is Agent Memory? – Vectorize&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Technology stack:&lt;/strong&gt; React, Vite, Python, FastAPI, Hindsight Cloud and Groq.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>devops</category>
      <category>agents</category>
    </item>
  </channel>
</rss>
