Inspiration

We are facing a crisis of communication. Every day, millions of gamers and developers interact on platforms like Discord, but text-based chat strips away the tone, facial expressions, and social cues of real life. A simple misunderstanding about code can turn into a flame war; a lost game can turn into harassment.

Existing moderation bots are punitive—they just ban or mute people. They silence the noise, but they don't fix the interaction.

I wanted to build something restorative. I asked myself: What if AI didn’t just police us? What if it actually taught us to be kinder? This inspired The Empathy Bridge—a tool designed not just to filter toxicity, but to translate raw emotion into constructive dialogue using the principles of Non-Violent Communication (NVC).

What it does

The Empathy Bridge is a real-time Discord bot that acts as an intelligent layer between a user's keyboard and the public server.

  1. The Interception: When a user types a message, Agent A (The Watcher) analyzes the sentiment and toxicity score in milliseconds. If it detects aggression, the message is intercepted—it never reaches the public channel.
  2. The Translation: Agent B (The Diplomat) analyzes the user's intent (e.g., frustration with a bug, anger at a teammate) and rewrites the message using NVC principles (Observation, Feeling, Need, Request).
  3. The Coaching: Agent C (The Coach) sends a private DM to the user: "Hey, that sounded a bit heated. I drafted a version that might get a better response. Want to send this instead?"
  4. The Choice: The user can click "YES" to post the empathetic version or "NO" to discard it.

It turns a moment of conflict into a moment of reflection.

How we built it

I built this as a modular Multi-Agent System using Python and Discord.py.

  • The Brain: The core intelligence is powered by Google Gemini 1.5 Flash. I chose Flash because speed is critical for chat applications—we needed near-instant inference.
  • The Architecture:
    • Agent A: Uses a specialized prompt for rapid sentiment classification.
    • Agent B: Uses a "Chain of Thought" prompt to identify the underlying need behind the toxic emotion.
    • Agent C: Handles the asynchronous user interaction flows via Discord Embeds and Buttons.
  • The Bridge: The entire system runs asynchronously to ensure the Discord server remains responsive even while complex processing happens in the background.

Challenges we ran into

  • Latency vs. Quality: The biggest hurdle was speed. Chat moves fast. If the bot takes 5 seconds to analyze a message, the conversation has moved on. I had to optimize the prompt engineering to be concise and switch to the Gemini 1.5 Flash model to get the response time under 2 seconds.
  • The "Robotic" Diplomat: Early versions of the Diplomat agent sounded too corporate or like a therapy bot. It took several iterations of "few-shot prompting" to make the rewritten messages sound like something a real gamer or developer would actually say.
  • Discord Async Hell: Managing the state between the public server (where the message was intercepted) and the private DM (where the user clicks a button) was complex. Ensuring the bot knew where to post the final message after the user clicked "Yes" required careful state management.

Accomplishments that we're proud of

  • Real-Time NVC: Successfully implementing Non-Violent Communication principles into an AI model that works on live internet slang and "gamer speak."
  • The Seamless UI: The "Intercept -> DM -> Post" flow feels incredibly smooth. It doesn't feel like a punishment; it feels like a helper tool.
  • Solo Development: Building a full multi-agent architecture from scratch in a single hackathon timeline.

What we learned

  • Prompt Engineering is Psychology: I learned that to get good results from an LLM, you don't just ask for a rewrite; you have to ask it to understand the emotion first.
  • The Power of the "Pause": Just the act of stopping a user for 1 second to let them read a DM is often enough to de-escalate anger, even without the AI rewrite.
  • Asynchronous Programming: I gained a much deeper understanding of Python's asyncio library and the Discord API's event loop.

What's next for Empathy Bridge

  • Voice Integration: The next frontier is audio. I plan to integrate LiveKit to analyze tone of voice in real-time voice channels, giving users a visual "heat check" warning if they start shouting.
  • Personalized Coaching: The bot could learn a user's specific communication style over time, making the suggestions sound even more like them.
  • Server Health Analytics: Providing server admins with a dashboard showing how many conflicts were "bridged" and de-escalated.

Built With

Share this project:

Updates