<?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: Chiranth.K.L</title>
    <description>The latest articles on DEV Community by Chiranth.K.L (@chiranthart).</description>
    <link>https://dev.to/chiranthart</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%2F4231570%2Fa5922aa9-7da5-406a-bfbe-aa7bb2c87203.jpg</url>
      <title>DEV Community: Chiranth.K.L</title>
      <link>https://dev.to/chiranthart</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chiranthart"/>
    <language>en</language>
    <item>
      <title>AI Incident Response Agent That Learns From Past Incidents Using Hindsight</title>
      <dc:creator>Chiranth.K.L</dc:creator>
      <pubDate>Sat, 07 Nov 2026 09:03:38 +0000</pubDate>
      <link>https://dev.to/chiranthart/ai-incident-response-agent-that-learns-from-past-incidents-using-hindsight-2518</link>
      <guid>https://dev.to/chiranthart/ai-incident-response-agent-that-learns-from-past-incidents-using-hindsight-2518</guid>
      <description>&lt;h1&gt;
  
  
  How I Built an AI Incident Response Agent That Learns From Past Incidents Using Hindsight
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;Building a memory-driven assistant that helps on-call engineers investigate production issues using historical incident knowledge.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When a production service fails, engineers need to identify the cause quickly. Searching previous incident reports, comparing symptoms, and finding successful resolutions can take valuable time.&lt;/p&gt;

&lt;p&gt;Our team built &lt;strong&gt;OnCall Memory&lt;/strong&gt;, an AI-assisted incident response system that uses historical incident knowledge to support engineers during new production issues.&lt;/p&gt;

&lt;p&gt;The project uses &lt;strong&gt;Hindsight&lt;/strong&gt; as its memory layer, a Python backend for incident processing, and Groq for language-model inference.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem
&lt;/h2&gt;

&lt;p&gt;Imagine a payment service experiencing database connection errors during checkout. Engineers need to investigate whether the issue is caused by connection-pool exhaustion, traffic spikes, database failures, or recent deployments.&lt;/p&gt;

&lt;p&gt;Similar problems may have occurred previously, but finding and comparing those incidents can be difficult.&lt;/p&gt;

&lt;p&gt;Our goal was to build a system that retrieves relevant historical incidents, compares them with current symptoms, and generates an organised investigation briefing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing OnCall Memory
&lt;/h2&gt;

&lt;p&gt;The application follows this workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An engineer submits a production error.&lt;/li&gt;
&lt;li&gt;The backend searches Hindsight for related memories.&lt;/li&gt;
&lt;li&gt;Retrieved information is used as historical evidence.&lt;/li&gt;
&lt;li&gt;Groq analyses the current error using that evidence.&lt;/li&gt;
&lt;li&gt;The application displays an investigation report.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The system supports engineers rather than making production changes automatically.&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture and Technologies
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Python:&lt;/strong&gt; Backend logic and memory integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hindsight:&lt;/strong&gt; Retaining, recalling, and reflecting on incident information.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Groq:&lt;/strong&gt; Language-model inference for incident analysis.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;React and Vite:&lt;/strong&gt; Frontend interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Streamlit:&lt;/strong&gt; Initial interface and testing workflow.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The key design principle is to use retrieved historical information as evidence instead of allowing the language model to invent incident history.&lt;/p&gt;

&lt;h2&gt;
  
  
  My Contribution: Hindsight Memory Layer
&lt;/h2&gt;

&lt;p&gt;My primary responsibility was developing the memory integration in &lt;code&gt;memory.py&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Retaining Incidents
&lt;/h3&gt;

&lt;p&gt;I implemented functionality to store incident information in Hindsight so historical symptoms, affected services, and resolution details could be reused.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Recording Outcome Feedback
&lt;/h3&gt;

&lt;p&gt;The system supports recording whether a proposed resolution worked. This adds useful context about previous troubleshooting attempts.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Recalling Similar Incidents
&lt;/h3&gt;

&lt;p&gt;For a new error, the application retrieves potentially relevant memories. I also implemented result limits and exact duplicate removal to avoid unnecessary repetition.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Reflecting on Patterns
&lt;/h3&gt;

&lt;p&gt;Reflection helps explore recurring patterns across stored memories, such as repeated connection failures or similar incident symptoms.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Reliability and Error Handling
&lt;/h3&gt;

&lt;p&gt;I worked on input validation, retry handling, fallback behaviour, and secure certificate configuration using &lt;code&gt;certifi&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;These improvements help the application handle memory-service failures without falsely reporting that a historical search succeeded.&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Hindsight World Facts
&lt;/h2&gt;

&lt;p&gt;World Facts provides a way to inspect general knowledge retained by Hindsight. It helps us understand how information from historical incidents is represented.&lt;/p&gt;

&lt;p&gt;Hindsight provides three visualization options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timeline:&lt;/strong&gt; Explores retained information chronologically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table:&lt;/strong&gt; Displays structured information and associated metadata.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constellation:&lt;/strong&gt; Visualises relationships between memories and entities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Figure 1: Hindsight World Facts Timeline view.&lt;/em&gt;&lt;br&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%2Fec17ggxl2rzcqrcshfg2.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%2Fec17ggxl2rzcqrcshfg2.png" alt=" " width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 2: Hindsight World Facts Table view.&lt;/em&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%2F5znr85c1qx60tjgajhxj.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%2F5znr85c1qx60tjgajhxj.png" alt=" " width="800" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 3: Hindsight World Facts Constellation view.&lt;/em&gt;&lt;br&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%2Fkzb4u4ij6jzcas3hxaif.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%2Fkzb4u4ij6jzcas3hxaif.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring Hindsight Observations
&lt;/h2&gt;

&lt;p&gt;Observations provide a more detailed view of individual pieces of information retained by Hindsight, including incident symptoms, technical details, and resolution context.&lt;/p&gt;

&lt;p&gt;The same three visualization options help us inspect these records:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Timeline:&lt;/strong&gt; Understands the sequence of recorded observations.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table:&lt;/strong&gt; Makes individual observations easier to inspect.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Constellation:&lt;/strong&gt; Shows connections between observations and related entities.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Figure 4: Hindsight Observations Timeline view.&lt;/em&gt;&lt;br&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%2Fmvwnlfb767tv00m5ek8b.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%2Fmvwnlfb767tv00m5ek8b.png" alt=" " width="799" height="451"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 5: Hindsight Observations Table view.&lt;/em&gt;&lt;br&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%2Faztf5p04a9edam73bwie.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%2Faztf5p04a9edam73bwie.png" alt=" " width="800" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Figure 6: Hindsight Observations Constellation view.&lt;/em&gt;&lt;br&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%2Fldkkfj9yqvc7q382c8ep.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%2Fldkkfj9yqvc7q382c8ep.png" alt=" " width="800" height="453"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Practical Example: Payment-Service Incident
&lt;/h2&gt;

&lt;p&gt;We tested the workflow using a payment-service scenario involving database connection errors.&lt;/p&gt;

&lt;p&gt;The engineer submits the incident details, and the backend retrieves potentially relevant historical memories. Groq then generates a structured briefing containing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Possible root causes.&lt;/li&gt;
&lt;li&gt;Historical incident comparison.&lt;/li&gt;
&lt;li&gt;Ordered investigation steps.&lt;/li&gt;
&lt;li&gt;Possible solutions after verification.&lt;/li&gt;
&lt;li&gt;Confidence and limitations.&lt;/li&gt;
&lt;li&gt;Next immediate actions.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The investigation encourages engineers to verify connection-pool metrics, database connections, traffic patterns, deployments, and logs before applying a fix.&lt;/p&gt;

&lt;p&gt;A historical match is a lead, not proof of the current root cause.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing and Challenges
&lt;/h2&gt;

&lt;p&gt;I tested the memory layer through focused checks covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Exact duplicate removal.&lt;/li&gt;
&lt;li&gt;Retry handling.&lt;/li&gt;
&lt;li&gt;Reflection and fallback behaviour.&lt;/li&gt;
&lt;li&gt;Outcome feedback.&lt;/li&gt;
&lt;li&gt;Input validation and Python syntax.&lt;/li&gt;
&lt;li&gt;Hindsight-to-agent-to-Groq integration.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The focused tests reported passing results, and we also tested the complete incident-analysis workflow.&lt;/p&gt;

&lt;p&gt;One important challenge was semantic retrieval. Hindsight may return relevant memories without retrieving every incident expected. This taught us to distinguish historical evidence from verified facts and recommendations.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Comes Next
&lt;/h2&gt;

&lt;p&gt;Future improvements include better retrieval evaluation, stronger source references, confidence calibration, live dashboard metrics, authentication, and production monitoring.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;OnCall Memory demonstrates how AI can use organisational memory to support incident investigation. Hindsight provides the memory capabilities, Python connects the system components, and Groq generates readable investigation briefings.&lt;/p&gt;

&lt;p&gt;Working on the memory layer taught me that useful AI systems need reliable memory, relevant retrieval, proper error handling, and human verification.&lt;/p&gt;

&lt;p&gt;The goal is not to replace on-call engineers, but to help them learn from previous incidents.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Project: OnCall Memory — AI Incident Response Agent powered by Hindsight.&lt;/em&gt;&lt;/p&gt;

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