Project Inspiration

We built this project because we kept noticing the same patterns—friends, colleagues, and even ourselves experiencing emotional strain from confusing or draining relationships. The anxiety of waiting for a reply, the self-doubt caused by mixed signals, and the gradual exhaustion from boundary testing are not just dating frustrations; they are real contributors to stress, anxiety, and depression that affect millions of people. Mental health isn’t only shaped by what happens inside our minds; it is deeply influenced by the interactions we have every day. Yet when you're in the middle of a conversation, emotions can cloud your perception. By the time someone realizes they are being manipulated, breadcrumbed, or love-bombed, the psychological toll has often already occurred. We wanted to build the friend whose advice you sometimes ignore, but probably shouldn’t. A system that doesn’t judge, but simply points out patterns:

“Hey, you’ve been carrying this conversation for a week.” “Notice how they only reappear when you pull away?”

By surfacing these behavioral signals early, we aim to help people recognize unhealthy communication patterns before they escalate into emotional harm.

What We Learned

This project taught us that behavioral signals are everywhere in text conversations, but they are not always obvious. One key insight was that pure machine learning is not enough. Models like BERT and other transformers are powerful for understanding language, but they cannot reliably infer interaction dynamics such as response times, reciprocity, or reappearance cycles. These patterns require structured behavioral features.

The most effective approach turned out to be a hybrid system:

1) Machine learning for language understanding

2) Engineered behavioral features for interaction dynamics

We also learned that explainability matters more than black‑box accuracy. Users don’t want random scores they want real suggestions and insights that they can act one. That’s what makes the system trustworthy and actionable.

Finally, we realized that mental health tools don’t have to be reactive. By identifying patterns early, we can help prevent the stress and anxiety that often develop from unhealthy relationships. This transforms the system from a diagnostic tool into a preventative support system.

How We Built It (and the Challenges We Faced)

Our system uses a three-layer architecture:

Message-level analysis – evaluates sentiment, tone, and linguistic patterns.

Interaction-level analysis – measures behavioral features such as response times, message counts, and reciprocity.

Pattern memory – tracks how behaviors evolve across the entire conversation.

For each conversation, we compute features including: Message frequency, Response delays, Reciprocity ratios, Phrase and sentiment patterns,

These features power scoring models that estimate:

  • Ghosting probability
  • Breadcrumbing risk
  • Love-bombing signals
  • Boundary violation likelihood
  • Effort Balance

One of the biggest challenges we faced was data scarcity. Real-world conversations labeled with unhealthy relationship patterns are difficult to obtain. To address this, we created a synthetic training dataset using transcripts from relationship-focused reality shows such as Love Is Blind, combined with manually constructed behavioral scenarios. We then validated our scoring rules against real-world examples to ensure reasonable performance.

We also designed a lightweight scoring engine that can analyze conversations incrementally without requiring constant retraining, making the system efficient and scalable.

Technology Stack

Languages

Python – core language for data processing, feature engineering, and machine learning.

Frameworks & Libraries

  • scikit-learn
  • TfidfVectorizer – text feature extraction
  • TruncatedSVD – dimensionality reduction
  • ExtraTreesRegressor – ensemble model for robust prediction
  • MultiOutputRegressor – predicts multiple behavioral risk scores simultaneously

Frontend

  • Next.js 16, React 19, Tailwind CSS 4, TypeScript

Real-time

  • Socket.io 4

Vector Storage

  • Moorcheh API (semantic message history)

AI

  • Anthropic Claude API

Data Processing

  • pandas – structured data manipulation and aggregation, numerical operations and feature computation

Model Management

  • joblib – model serialization and persistence for saving and loading trained models

Utilities

  • datetime : timestamp parsing and response-time calculations
  • random : synthetic data generation for simulation and testing

Project Summary

We realized that one of the most powerful places to support mental well-being is within the conversations that shape our relationships.

Unhealthy dynamics—such as breadcrumbing, love bombing, ghosting, and effort imbalance—are difficult to recognize in real time because emotions often cloud our judgment. By the time someone recognizes these patterns, the emotional damage may already have occurred.

Between The Lines acts as a proactive mental wellness companion.

Instead of simply analyzing individual messages, the system evaluates behavioral patterns over time—including response delays, conversational reciprocity, language tone, and consistency. By combining language understanding with behavioral analytics, the system can detect signals such as:

  • Gradual emotional withdrawal
  • Manipulative affection patterns
  • Repeated boundary violations

It then translates these insights into clear, plain-language feedback and recommendations, empowering users to protect their emotional energy and make healthier relationship decisions.

Built With

Share this project:

Updates