Building Empathy, One Keystroke at a Time.
ReflectAI is an intelligent background assistant designed to help children and young adults "Think Before They Type." Developed for the Nitzanim 2026 Hackathon, this tool acts as a gentle guardian against cyberbullying by detecting hurtful language in real-time and suggesting kinder alternatives.
- Real-Time Intervention: Automatically intercepts the 'Enter' key when a potentially harmful message is detected.
- AI-Powered Alternatives: Uses Groq-hosted Llama 3.1 models to provide context-aware, kinder ways to express emotions.
- Educational UI: Features a modern, friendly interface that encourages reflection rather than just punishing negative behavior.
- Seamless Integration: Runs quietly in the background, compatible with most chat applications and browsers.
- Listen: The app monitors global keyboard input (locally and privately).
- Analyze: Upon pressing 'Enter', the current line is securely analyzed by a fast-inference AI model.
- Reflect: If the message is flagged as aggressive or hurtful, a "Reflection Prompt" appears.
- Learn: The user can choose to adopt the AI's kinder suggestion or rewrite the message themselves, turning a moment of anger into a lesson in empathy.
- Language: Python 3.x
- AI Inference: Groq (Llama 3.1 8B)
- Keyboard Handling:
keyboardlibrary for global hooks and event suppression. - UI Framework:
Tkinterwith custom styling for a modern look. - Concurrency: Multi-threading to ensure the AI check doesn't freeze the user's computer.
- Python 3.8+
- A Groq API Key (Get one at console.groq.com)
-
Clone the repository:
git clone https://github.com/korenyosef/ReflectAI.git cd reflect-ai -
Install dependencies:
pip install keyboard groq
-
Configure API Key: Open
.env.example, change it's name to.envand changegsk_to your actual Groq API key. -
Run the application: (Note: Keyboard hooks usually require Administrator/Root privileges on Windows/Linux)
python main.py
ReflectAI is designed with privacy in mind. Text is only sent for analysis when the 'Enter' key is pressed, and no keystrokes are logged permanently or stored on any server.
Created with ❤️ for Nitzanim 2026 Hackathon.