DEV Community

Sasidhar Prathipati
Sasidhar Prathipati

Posted on

How We Built a Churn Detection Agent That Remembers Every Meeting

The Problem
Every B2B sales team has the same silent killer: nobody remembers what was said three weeks ago.

A client mentions "budget is tight" in a discovery call. Two weeks later, they ask about flexible payment terms. A week after that, they mention a competitor's demo. Then they start "reconsidering priorities."

Individually, each of these signals looks minor. Together, they're a churn trajectory. But by the time a human notices the pattern, the deal is already lost.

We built an AI agent that catches this pattern before it becomes obvious. Not because the model is smarter than a sales rep — but because it remembers every meeting, and connects the dots across time.

The Insight: Memory Isn't a Feature. It's the Product.
Most AI agents today are stateless. You have a conversation, close the tab, and everything is forgotten. The next conversation starts from zero.

That's fine for one-off tasks. But it's useless for workflows where context accumulates over weeks — sales, customer support, incident response, compliance.

The shift is simple but profound:

Without memory: The agent sees one meeting and says "the client seems hesitant."

With memory: The agent sees one meeting, recalls six previous ones, and says "this client is exhibiting the same pattern as three deals we lost last quarter. Here's the action to take."

That's not a better prompt. That's a different category of agent.

We built our project on Hindsight, a memory system by Vectorize that gives AI agents persistent, queryable memory. Hindsight stores interactions, recalls them using multiple search strategies (semantic, keyword, graph, temporal), and lets the agent improve over time.

The Architecture
Our stack has three layers:

text
Meeting transcripts → Hindsight memory → Groq LLM analysis → Churn alert

  1. Hindsight (memory layer)
    Each meeting is stored with retain(), tagged with a timestamp, client ID, and context. When a new meeting arrives, recall() searches the entire memory bank to surface related signals — even if the words used are different.

  2. Groq (reasoning layer)
    We use openai/gpt-oss-120b on Groq to analyze the new meeting against the recalled memories. Groq's speed matters here — the agent needs to respond in seconds, not minutes.

  3. Meeting transcripts (input)
    Synthetic but realistic. Six meetings for a fictional client "Acme Corp" over three weeks. Each one contains a subtle signal: price concern, budget delay, competitor mention, contract flexibility request.

The Demo
Here's what happens when you run the agent.

First, it stores all six past meetings in Hindsight memory:

text
Stored 6 meetings for Acme Corp
Then a new meeting arrives — the kind that a sales rep would treat as just another check-in:

"Client said they are 'reconsidering the entire initiative' and asked whether we can pause the contract. Leadership is now looking at a cheaper alternative."

The agent queries Hindsight for related signals. Hindsight returns eight memories spanning three weeks. Groq analyzes them and produces:

text
RISK: HIGH

SIGNALS:

  • Budget concerns and request for flexible payment terms (≈ 2026-09-10)
  • Competing vendor demo scheduled (week of 2026-09-07)
  • Competing vendor offered a discount (≈ 2026-09-15)
  • Client expressed hesitation and need to justify spend internally (≈ 2026-09-15)
  • Request for contract flexibility and pilot program due to ROI concerns (≈ 2026-09-20)
  • Inquiry about cancellation policy (≈ 2026-09-20)
  • Reconsideration of project priorities and request to delay start (≈ 2026-09-25)
  • New request to pause the contract while leadership evaluates cheaper alternatives (≈ 2026-09-28)

ACTION: Initiate an executive-level retention plan — schedule a senior leadership call to co-create a customized, short-term pilot with revised, value-based pricing and clear ROI metrics, while offering a flexible exit clause to alleviate cancellation concerns.
That's the moment. The agent didn't just summarize one meeting. It connected eight signals across three weeks into a single coherent risk assessment with a concrete recommendation.

A human sales rep, reading the new meeting in isolation, would see "client is hesitant." The agent sees a pattern that's been building for a month.

Why This Matters Beyond Sales
The same architecture applies anywhere context accumulates over time:

Customer support: An agent that remembers every ticket a customer has filed, every workaround that worked, and every escalation pattern.

Incident response: An agent that recalls how similar incidents were resolved before, and which runbooks actually fixed them.

Compliance: An agent that remembers every past audit finding, which controls were tested, and what remediation is still pending.

Product feedback: An agent that connects feedback across support tickets, sales calls, and reviews — and spots emerging themes humans miss.

In all of these, the value isn't in the LLM. It's in the memory layer that lets the LLM reason across time.

The Code
The core loop is simple:

python

Store each meeting

client.retain(
bank_id=f"client-{client_name}",
content=meeting["transcript"],
context=f"Meeting {meeting['meeting_id']} on {meeting['date']}",
timestamp=meeting["date"],
)

When a new meeting arrives, recall related signals

memories = client.recall(
bank_id=f"client-{client_name}",
query="concerns, objections, delays, competitor mentions, budget issues",
)

Analyze with Groq

response = groq_client.chat.completions.create(
model="openai/gpt-oss-120b",
messages=[{"role": "user", "content": prompt}],
)
Three operations. That's the entire intelligence layer.

The magic isn't in the code — it's in what Hindsight does with recall(). It searches semantically, by keyword, by graph relationships, and by temporal proximity. That's why it can find "budget concerns" from three weeks ago when the new meeting says "reconsidering the initiative."

Top comments (0)