Inspiration

Communication is more than just choosing the right words—it's about understanding how those words are perceived. We've all experienced moments where we typed a message, paused before pressing Send, and wondered, "Does this sound rude?" or "Will they misunderstand what I mean?"

While many AI tools focus on generating text, very few help people understand the emotional impact of the messages they have already written.

ToneLens was created to solve that problem. Instead of replacing your words, it helps you understand how they may be interpreted by different people and gives you the confidence to communicate more effectively.


What it does

ToneLens is an AI-powered communication assistant that analyzes the tone of written messages before they're sent.

Given any message, it can:

  • Detect the primary emotion behind the text
  • Measure confidence, urgency, and passive-aggression levels
  • Highlight the exact words or phrases influencing the tone
  • Show how different audiences (such as a boss, friend, or professor) may interpret the same message
  • Rewrite the message into different tones while preserving its original meaning

Rather than simply generating new text, ToneLens helps users understand the impact of their own communication.


How we built it

ToneLens was built using Next.js, React, TypeScript, and Tailwind CSS.

The frontend provides a clean, responsive interface where users can enter messages, review AI-generated insights, and compare rewritten versions.

On the backend, secure API routes communicate with Google Gemini to perform tone analysis and message rewriting. Carefully designed prompts ensure structured JSON responses, while validation logic checks response integrity before displaying results.

The application also includes exact phrase matching, error handling, loading states, accessibility improvements, and responsive layouts to provide a polished user experience.


Challenges we ran into

One of the biggest challenges was making AI responses reliable and consistent.

Large language models don't always return perfectly structured JSON, so we implemented validation logic and fallback error handling to manage malformed responses and API failures gracefully.

Another challenge was ensuring that highlighted phrases always matched the user's original message exactly. This required additional validation and matching logic so explanations always corresponded to real text rather than generated approximations.

Designing prompts that produced realistic audience interpretations without exaggeration also took several iterations.


Accomplishments that we're proud of

We're proud of building a complete AI-powered communication assistant that focuses on understanding rather than simply generating text.

Some highlights include:

  • AI-powered tone analysis
  • Audience-specific interpretation
  • Intelligent message rewriting
  • Exact phrase highlighting
  • Responsive and accessible user interface
  • Secure server-side AI integration
  • Successful deployment on Vercel

Most importantly, we built a tool that addresses a real communication problem people face every day.


What we learned

This project gave us hands-on experience with prompt engineering, AI response validation, API integration, server-side security, and production deployment using Next.js.

We also learned that designing AI applications is about more than calling an API—it requires thoughtful user experience, careful prompt design, and robust validation to ensure reliable results.

Most importantly, we learned how AI can be used to improve human communication rather than replace it.


What's next for ToneLens

We're excited to continue expanding ToneLens with new capabilities, including:

  • Support for multiple languages
  • Additional audience personas (HR, recruiter, client, interviewer)
  • Browser extension for Gmail and messaging platforms
  • Conversation history and analytics
  • Personalized tone suggestions based on writing style
  • Team collaboration features
  • Dark mode and additional accessibility improvements

Our long-term vision is to make ToneLens a communication companion that helps people write with greater confidence across work, education, and everyday conversations.

Built With

Share this project:

Updates

Submission history