<?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: Manya Agarwal</title>
    <description>The latest articles on DEV Community by Manya Agarwal (@manya_agarwal_4b2212d02ea).</description>
    <link>https://dev.to/manya_agarwal_4b2212d02ea</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%2F4231593%2F12c8323f-b507-4476-8770-4b6db9dc5593.png</url>
      <title>DEV Community: Manya Agarwal</title>
      <link>https://dev.to/manya_agarwal_4b2212d02ea</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manya_agarwal_4b2212d02ea"/>
    <language>en</language>
    <item>
      <title>I Gave My SRE Agent Hindsight. Its Commands Got Safer.</title>
      <dc:creator>Manya Agarwal</dc:creator>
      <pubDate>Sat, 07 Nov 2026 06:38:28 +0000</pubDate>
      <link>https://dev.to/manya_agarwal_4b2212d02ea/i-gave-my-sre-agent-hindsight-its-commands-got-safer-3b34</link>
      <guid>https://dev.to/manya_agarwal_4b2212d02ea/i-gave-my-sre-agent-hindsight-its-commands-got-safer-3b34</guid>
      <description>&lt;p&gt;At 3 AM, a generic AI assistant will tell you to “check your database connection.” That is not an answer to a Postgres deadlock on a checkout table. Worse, it will sometimes hand you a destructive command with full confidence and no idea what your environment looks like.&lt;/p&gt;

&lt;p&gt;I built NerveCenter to fix that. It’s an on-call agent that answers production alerts using what my team has already learned from past outages, instead of what a language model remembers from the internet.&lt;/p&gt;

&lt;p&gt;What NerveCenter does&lt;/p&gt;

&lt;p&gt;NerveCenter is a Streamlit dashboard with a chat box. You type an alert like Redis OOM Error or Kubernetes pods failing with CrashLoopBackOff. The agent then:&lt;/p&gt;

&lt;p&gt;Looks up similar past incidents in a memory layer built around Hindsight&lt;br&gt;
Shows the retrieved incident record in the UI so you can verify it&lt;br&gt;
Sends that record to an LLM (openai/gpt-oss-120b on Groq) with strict instructions to base its answer on it&lt;br&gt;
Returns exact terminal commands plus the post-mortem warnings from last time&lt;/p&gt;

&lt;p&gt;The stack is small on purpose: Streamlit for the UI, Groq for fast inference, and an agent memory layer for institutional knowledge.&lt;/p&gt;

&lt;p&gt;The story: memory is the difference between a textbook and a teammate&lt;/p&gt;

&lt;p&gt;The most important design decision was putting a switch in the UI. One toggle in the sidebar turns memory on or off:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
use_hindsight = st.sidebar.toggle("🧠 Enable Hindsight Memory", value=True)&lt;/p&gt;

&lt;p&gt;With memory off, the agent gets this system prompt and nothing else:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
system_prompt = (&lt;br&gt;
    "You are an elite Site Reliability Engineer (SRE) AI. "&lt;br&gt;
    "Provide exact terminal commands, root cause analysis, and post-mortem advice for server outages. "&lt;br&gt;
    "Structure your response with clear markdown headings."&lt;br&gt;
)&lt;/p&gt;

&lt;p&gt;That produces competent but generic advice. It’s what any assistant would give.&lt;/p&gt;

&lt;p&gt;With memory on, the agent first recalls a past incident and injects it into the prompt:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
if retrieved_context:&lt;br&gt;
    system_prompt += (&lt;br&gt;
        f"\n\nCRITICAL HINDSIGHT MEMORY:\n"&lt;br&gt;
        f"You MUST base your solution strictly on this past incident memory. "&lt;br&gt;
        f"Quote the specific commands used and highlight the post-mortem warnings:\n"&lt;br&gt;
        f"{retrieved_context}"&lt;br&gt;
    )&lt;/p&gt;

&lt;p&gt;Now the model isn’t guessing. It’s working from a record that looks like this:&lt;/p&gt;

&lt;p&gt;[Hindsight ID: INC-892 | Severity: P1]&lt;br&gt;
Symptom: Redis OOM Error on Primary API Cluster.&lt;br&gt;
Root Cause: Stale session keys failed to expire due to a misconfigured TTL policy.&lt;br&gt;
Resolution: Executed &lt;code&gt;redis-cli FLUSHALL ASYNC&lt;/code&gt;. Scaled ElastiCache node to r6g.2xlarge.&lt;br&gt;
Post-Mortem: The FLUSHALL command caused a 12-second latency spike.&lt;br&gt;
Route traffic to standby cluster before flushing next time.&lt;br&gt;
Why the commands get safer&lt;/p&gt;

&lt;p&gt;This is the part I care about most. The fix for the Redis incident was FLUSHALL, which is dangerous on its own. A generic assistant might suggest it without a word of warning. But the stored incident includes the lesson from last time: it caused a 12-second latency spike, so route traffic to a standby cluster first.&lt;/p&gt;

&lt;p&gt;Because the prompt tells the model to quote the post-mortem, that warning arrives together with the command.&lt;/p&gt;

&lt;p&gt;The Kubernetes case works the same way. The memory says a CrashLoopBackOff came from a liveness probe timing out against a third-party payment gateway, fixed by raising the timeout from 3s to 10s. The post-mortem adds the real lesson: don’t fail liveness probes on external API latency, use readiness probes for external dependencies. That is the kind of knowledge that lives in one senior engineer’s head. Memory moves it into the tool.&lt;/p&gt;

&lt;p&gt;Transparency was a deliberate choice&lt;/p&gt;

&lt;p&gt;The retrieved record is shown in an expander before the answer:&lt;/p&gt;

&lt;p&gt;python&lt;br&gt;
with st.expander("🔍 View Retrieved Hindsight Memory Log", expanded=True):&lt;br&gt;
    st.code(retrieved_context.strip(), language="log")&lt;/p&gt;

&lt;p&gt;During an outage, an engineer shouldn’t have to trust a black box. If the agent says “terminate PID 4821,” I want to see the incident it came from. Showing the source makes the answer checkable in seconds.&lt;/p&gt;

&lt;p&gt;What I’d be honest about&lt;/p&gt;

&lt;p&gt;I want to be direct about the current state, because I’d want that from an article like this:&lt;/p&gt;

&lt;p&gt;The memory store is still seeded by hand. Today the recall step is a keyword match over three incident records. It works for a demo flow, but it doesn’t generalize to an alert phrased differently. Moving this to Hindsight’s retain and recall, where incidents are stored as they happen and retrieved by meaning, is the next step. The recall(query) interface was built so that swap touches one class.&lt;br&gt;
Some dashboard numbers are placeholders. The “32ms ping” metric is static, and a short sleep simulates database latency. I’d rather say so than let a screenshot imply otherwise.&lt;br&gt;
The model still needs guardrails. I set temperature=0.1 to keep it from improvising, but “you MUST base your solution on this memory” is a prompt instruction, not a guarantee. A real deployment should validate generated commands before anyone runs them.&lt;br&gt;
Lessons&lt;br&gt;
Memory is about warnings as much as answers. The most valuable field in each record is the post-mortem, because it prevents repeat mistakes.&lt;br&gt;
Put a memory toggle in your UI. The before/after comparison sells the idea better than any explanation.&lt;br&gt;
Show retrieved context to the user. It builds trust and makes bad retrievals easy to spot.&lt;br&gt;
Design the memory interface first. Keeping recall behind one method means the storage backend can change without touching the rest of the agent.&lt;br&gt;
Be upfront about what’s placeholder. Engineers forgive limitations. They don’t forgive surprises.&lt;/p&gt;

&lt;p&gt;If you’re building agents that need to learn from past events, start with the Hindsight docs and the GitHub repo. The code for NerveCenter is at github.com/nagurukethankumarreddy-alt/nervecenter-sre-agent.&lt;/p&gt;

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