DEV Community

Cover image for Building Conversation Repairer for Aishwarya: Grounded Relationship Memory with Gemma
Daksh Lalwani
Daksh Lalwani

Posted on

Building Conversation Repairer for Aishwarya: Grounded Relationship Memory with Gemma

Hacktoberfest Weekend Challenge: Build for a Friend Submission 🤝

My friend Aishwarya often runs into a tough communication pattern. When tensions or awkward moments happen in a chat, she swings between two extremes: either she feels too kind and shy to state what she needs, or she swings the other way and sounds completely nonchalant and detached.

Both reactions cause confusion. People misread her silence as indifference, or her detachment as rudeness, even when her actual intention was simply to avoid conflict. When we talked about it, she mentioned that she often forgets past commitments or mutual preferences agreed upon weeks earlier in long chat threads. When an argument flares up, she has no quick way to recall what was actually said.

I built Conversation Repairer for her. It takes an exported WhatsApp conversation (.txt), extracts relationship context backed by exact quotes, stores everything strictly in the browser, and helps draft grounded responses when a chat gets tense.

## What I Built

Conversation Repairer is a full-stack tool that turns chat logs into a searchable relationship memory dashboard.
When you paste a tense message exchange into the app, it does not invent an arbitrary apology. Instead, it retrieves relevant past promises, recurring patterns, and communication preferences from your history. Then it suggests three distinct response options:

  1. Soft: Gentle, acknowledging emotions without being overly apologetic.
  2. Casual: Low-friction and conversational, de-escalating tension without drama.
  3. Direct: Clear and honest, setting boundaries without sounding cold. It also highlights things to avoid saying and flags honest uncertainties about the situation.

## Demo

## Code

Tip for testing: If you do not have a WhatsApp export handy, clone the repo and upload samples/ios_sample.txt. It contains a realistic synthetic conversation between Kabir and Ananya covering canceled plans, late shows, and texting preferences.

## How I Built It

The core idea is simple: keep the server stateless, store personal memories only in the user's browser, and force the model to prove its claims with exact quotes.

WhatsApp Export (.txt)
│
▼
┌──────────────────┐
│ Browser Parser │ (Runs 100% in browser; strips bidi unicode)
└─────────┬────────┘
│
▼
┌──────────────────┐
│ Message Chunker │ (Recent ~1,500 messages, 120-msg chunks)
└─────────┬────────┘
│
▼
┌──────────────────┐
│ Gemma Extraction │ (Extracts memories with exact quotes)
└─────────┬────────┘
│
▼
┌──────────────────┐
│ Quote Check Code │ (Drops memory if quote is not in chunk)
└─────────┬────────┘
│
▼
┌──────────────────┐
│ LocalStorage │ (cr:memories stored strictly in browser)
└─────────┬────────┘
│
Tense chat snippet
│
▼
┌──────────────────┐
│ Keyword Retrieve │ (Scores overlap, category weight & recency)
└─────────┬────────┘
│
▼
┌──────────────────┐
│ Gemma Repair │ (Analyzes conflict + retrieved evidence)
└─────────┬────────┘
│
▼
3 Response Options: Soft, Casual, Direct

I built and iterated on this application using AI coding assistants (Google Antigravity) for scaffold generation, refactoring, and test runners, while Google Gemma 4 powers the extraction and repair intelligence of the live product. I designed the architecture, quote verification engine, and retrieval scoring, and validated the pipeline across synthetic test cases.

## Why Does Open Innovation Matter?

Personal conversations are deeply private. If you build communication tools using closed proprietary APIs, users are locked into third-party cloud platforms with no say over where their personal relationship history travels.

Because Gemma is an open-weight model family, Conversation Repairer is not trapped inside a single vendor's walled garden. Anyone who wants complete privacy can run the entire application offline by setting LLM_PROVIDER=ollama in their .env file and running gemma3:4b on their own computer. No chat text ever needs to leave their machine.

To be honest about the live deployment: the public demo on Render connects to Google's hosted Gemma API (gemma-4-26b-a4b-it) for inference, meaning text chunks travel over HTTPS to Google during analysis requests. However, the server remains completely stateless, stores nothing on disk, and saves all memories in local browser storage. Open weights make it possible for anyone to take the exact same code, run it locally, and have total data isolation.

What Aishwarya Said

I sent the working deployment to Aishwarya to test on her own chats.

Her immediate reaction was honest and funny. She laughed and told me she wants to send the link directly to people who struggle with communication skills. She noted that she runs into this problem with people around her all the time, and having a tool that grounds replies in what was actually agreed upon is a relief. For her, seeing past preferences lined up side by side with the three response styles gave her an easy way to reply without spiraling into over-apologizing or shutting down.

Privacy Note

Because personal chats contain sensitive information:

The server stores zero logs, zero conversation text, and zero user data.
All memories and sender names stay inside your browser localStorage.
If you prefer total isolation from cloud APIs, you can run Conversation Repairer offline by setting LLM_PROVIDER=ollama in your .env file and running gemma3:4b locally.

Top comments (0)