An AI-powered Flutter application designed to foster kindness and empathy in digital communication. Empathy Exchange uses OpenAI's GPT-5.2 to evaluate conversations in real-time, rewarding positive interactions through a karma system and creating a safer, more supportive online environment.
- AI-Powered Conversation Analysis: Real-time evaluation of messages for empathy, kindness, and positivity using OpenAI GPT-5.2
- Karma System: Gamified positive reinforcement with karma points (-10 to +10) based on message quality
- Profanity Filter: Automatic detection and filtering of inappropriate content
- Real-Time Chat: Live messaging powered by Firebase Realtime Database
- Karma History Visualization: Interactive charts showing karma trends over time
- User Profiles: Customizable profiles with pictures, bios, and display names
- Badge System: Users can give and receive badges recognizing positive contributions
- Cross-Platform: Works on Web, iOS, and Android
- Frontend: Flutter (Dart)
- Backend Services:
- Firebase Authentication
- Firebase Realtime Database
- Cloud Firestore
- Firebase Storage
- AI Integration: OpenAI GPT-5.2 API
- Additional Libraries:
- Google Fonts
- fl_chart (data visualization)
- HTTP client for API communication
Before you begin, ensure you have the following installed:
- Flutter SDK (>=3.4.4)
- Dart SDK (comes with Flutter)
- Firebase CLI (optional, for Firebase setup)
- Google Cloud SDK (for Python scripts, optional)
git clone <repository-url>
cd empathy-exchangeflutter pub get- Create a Firebase project at Firebase Console
- Enable the following services:
- Authentication (Email/Password and Google Sign-In)
- Realtime Database
- Cloud Firestore
- Storage
- Download configuration files:
- For Android:
google-services.jsonβ place inandroid/app/ - For iOS:
GoogleService-Info.plistβ place inios/Runner/ - For Web: Add Firebase config to
lib/main.dart(already configured)
- For Android:
Create a .env file in the root directory:
FIREBASE_API_KEY=your_firebase_api_key
OPENAI_API_KEY=your_openai_api_keyThe .env file is already configured in pubspec.yaml to be included as an asset.
- Sign up for an OpenAI account at OpenAI Platform
- Create an API key
- Add the key to your
.envfile
# For web
flutter run -d chrome
# For iOS (requires macOS and Xcode)
flutter run -d ios
# For Android (requires Android Studio/Android SDK)
flutter run -d androidempathy-exchange/
βββ lib/
β βββ main.dart # App entry point
β βββ firebase_options.dart # Firebase configuration
β βββ screens/ # App screens
β β βββ chat_screen.dart
β β βββ login_screen.dart
β β βββ profile_screen.dart
β β βββ signup_screen.dart
β βββ services/ # Business logic
β β βββ auth_service.dart
β β βββ fcm_service.dart
β β βββ openai_service.dart
β β βββ profanity_check.dart
β β βββ profile_service.dart
β βββ widgets/ # Reusable widgets
β βββ material.dart
β βββ message.dart
β βββ profile_picture_widget.dart
β βββ sidetooltip.dart
βββ python/ # Python scripts (optional)
β βββ chat_bot.py
β βββ requirements.txt
β βββ SETUP.md
βββ android/ # Android-specific files
βββ ios/ # iOS-specific files
βββ web/ # Web-specific files
βββ pubspec.yaml # Flutter dependencies
The AI system evaluates conversations through a multi-stage process:
- Message Collection: Every 5 messages (or on manual trigger), the system collects recent conversation history
- Context Building: The AI receives both recent messages and an existing conversation summary to maintain context
- Evaluation: Messages are analyzed for:
- Tone and language
- Constructiveness
- Respectfulness
- Overall positive or negative impact
- Karma Assignment: Points are assigned from -10 (very negative) to +10 (very positive)
- Feedback: Evaluation results are posted as system messages with reasoning
A custom pattern-based profanity filter:
- Scans messages for inappropriate content
- Automatically deducts karma points
- Censors inappropriate language
- Maintains a comprehensive database of encoded profanity patterns
- Users receive karma points based on message quality
- Points range from -10 to +10 per evaluation
- Accounts with karma below -100 are automatically terminated
- Karma history is visualized through interactive charts
- Powered by Firebase Realtime Database
- Supports multiple concurrent users
- Automatic AI evaluation every 5 messages
- Manual evaluation triggers for chat owners
- Customizable display names and bios
- Profile picture upload
- Karma history visualization
- Badge system for recognition
- User authentication through Firebase
- Minimal data sent to external APIs (only necessary conversation context)
- Secure storage of API keys in environment variables
- Account termination for users with excessive negative karma
This project is open source. Contributions are welcome! Please feel free to submit a Pull Request.
Open Source - See LICENSE file for details
Status: Active Development (Alpha Version)
Platform: Web, iOS, Android
Developed for: 2025 Presidential AI Challenge
Click this link to watch a demo of the app's main features
For questions or issues, please open an issue in the repository.
Empathy Exchange - Building a kinder digital world, one conversation at a time. π