A privacy-focused voice assistant with immersive 3D orb UI, powered by local AI
Mareen is a calm, immersive, voice-first AI assistant featuring a glowing particle sphere interface. Experience the future of private, offline AI interaction with beautiful visualizations and natural voice conversations.
Powered by:
- ๐ง Ollama - Local LLM processing (model
j) - ๐ค Vosk - Offline speech recognition
- ๐ EdgeTTS / pyttsx3 - Natural text-to-speech
- ๐จ pywebview - Stunning 3D Voice Orb UI
- ๐๏ธ Voice Interaction - Natural speech recognition with real-time transcription streaming
- ๐ Offline First - Complete privacy with local LLM processing (no data leaves your machine)
- ๐ฎ๐ณ Hindi Support - Native Hindi language understanding and responses
- ๐ฎ 3D Orb UI - Immersive particle sphere visualization with dynamic color states
- ๐ฏ System Control - Open applications, find files, and execute commands
- ๐ง Smart Intent - Understands natural language commands and context
- ๐ Text-to-Speech - Natural voice responses with emotion
- โก Lightweight - Runs efficiently on local hardware
- ๐ Privacy Focused - No cloud dependencies, no telemetry
- ๐พ Conversation Memory - Persistent logging of all sessions and conversations
- ๐ก๏ธ Soul Protection - Immutable personality protected from prompt injection attacks
- ๐ง RAG System - Retrieval-Augmented Generation for context-aware responses
Microphone โ Vosk STT โ Intent Parser โ Ollama LLM โ Edge TTS โ Speaker
โ
System Commands
File Operations
Coming soon: Screenshots of idle, listening, and speaking states
- Python 3.10+ - Ensure you have a compatible Python version installed
- Ollama - Download and install from ollama.com
- Pull a model:
ollama pull llama2or create your custom modelj - Verify installation:
ollama list
- Pull a model:
- Microphone - Set as default recording device in system settings
- Git - For cloning the repository (optional)
git clone https://github.com/saxil/mareen.git
cd mareenpip install -r requirements.txtNote: If you encounter errors with PyAudio:
- Windows: Download pre-built wheel from unofficial binaries
- Linux:
sudo apt-get install portaudio19-dev python3-pyaudio - macOS:
brew install portaudio && pip install pyaudio
For better offline speech recognition:
python scripts/setup_model.pyThis downloads the Vosk model for English and Hindi support.
Ensure your LLM model is ready:
ollama pull llama2
# Or use your custom model 'j'python src/main.pyOnce the orb appears and turns yellow (listening), try:
- ๐ฌ General conversation: "Hello", "Tell me a joke", "What's the weather?"
- ๐ System commands:
- "Open calculator"
- "Open notepad"
- "Open Chrome"
- "Find files named report"
- ๐ Exit: "Stop", "Exit", "Goodbye"
- ๐ก Amber - Idle / Ready
- ๐ข Yellow - Listening
- ๐ต Blue - Speaking / Responding
- ๐ฃ Purple - Processing / Thinking
Mareen now includes a comprehensive memory system that logs every conversation and session to a local SQLite database.
- ๐ Automatic Logging - Every message (user and assistant) is saved automatically
- ๐ Session Tracking - Each conversation session is tracked with timestamps
- ๐ Search Capability - Search through all past conversations
- ๐ Statistics - View usage statistics and patterns
- ๐ค Export - Export sessions to JSON format for backup or analysis โโโ intent.py # Command parser โ โ โโโ memory.py # Conversation memory system โ โโโ modules/ โ โ โโโ system.py # System commands โ โ โโโ files.py # File operations โ โโโ ui/ โ โโโ index.html # 3D Orb interface โ โโโ gui.py # GUI components โโโ models/ # Vosk models directory โโโ scripts/ โ โโโ setup_model.py # Model downloader โโโ view_memory.py # Memory viewer utility โโโ memory.db # Conversation database (auto-created) python view_memory.py stats
python view_memory.py sessions
python view_memory.py view <session_id>
python view_memory.py search "hello"
python view_memory.py export <session_id> output.json
### Memory Database Location
All conversations are stored in `memory.db` in the project root directory. This file is created automatically on first run.
### Privacy Note
Your conversation history is stored **locally only** on your machine. No data is sent to external servers. You can delete `memory.db` at any time to clear your history.
## ๐ก๏ธ Soul Protection System
Mareen's personality is protected by a **Soul System** that prevents prompt injection attacks and personality manipulation.
### What is the Soul?
The soul ([soul.md](soul.md)) is Mareen's core identity file that defines:
- Personality traits and behavior
- Language preferences (Hindi)
- Response guidelines
- Protected instructions that cannot be overridden
### Injection Protection
Mareen automatically detects and blocks attempts to:
- Override system instructions
- Change personality or identity
- Ignore core directives
- Pretend to be other AI assistants
- Execute harmful commands through manipulation
### Testing Protection
```bash
# Test the soul protection system
python test_soul.py
- Soul Loading: System prompt loaded from
soul.md(immutable) - Input Scanning: Every user input checked for 34+ injection patterns
- Automatic Blocking: Injection attempts rejected with polite Hindi responses
- Memory Logging: All injection attempts logged for security review
Prevents users from:
- "Jailbreaking" the assistant
- Making Mareen act inappropriately
- Bypassing safety guidelines
- Compromising the user experience for others
Mareen uses RAG to remember past conversations and provide contextual responses based on your history.
RAG combines your conversation memory with AI responses:
- When you ask a question, Mareen searches past conversations
- Relevant context is retrieved and added to the prompt
- The LLM generates a response aware of your history
- You get personalized, context-aware answers
- ๐ Semantic Search - Finds relevant past conversations (not just keywords)
- โฐ Time Decay - Recent conversations weighted higher
- ๐ฏ Smart Context - Top 3 most relevant memories included
- ๐พ Embedding Cache - Fast retrieval with cached vectors
- ๐ Fallback Mode - Works with keyword matching if embeddings unavailable
User: "How do I learn Python?"
โ
RAG searches memory for similar past conversations
โ
Finds: "Can you help me with programming?"
โ
Adds context to LLM prompt
โ
Mareen: "เคเฅเคธเคพ เคเคฟ เคฎเฅเคเคจเฅ เคชเคนเคฒเฅ เคฌเคคเคพเคฏเคพ เคฅเคพ programming เคเฅ เคฒเคฟเค..."python test_rag.pyFor better context matching, install sentence-transformers:
pip install sentence-transformersWithout it, RAG uses keyword matching (still effective but less nuanced).
mareen/
โโโ src/
โ โโโ main.py # Application entry point
โ โโโ core/
โ โ โโโ llm.py # Ollama LLM integration
โ โ โโโ stt.py # Speech-to-text (Vosk)
โ โ โโโ tts.py # Text-to-speech
โ โ โโโ intent.py # Command parser
โ โ โโโ memory.py # Conversation memory system
โ โโโ soul.py # Soul protection system
โ โโโ rag.py # RAG retrieval system
โ โโโ modules/
โ โ โโโ system.py # System commands
โ โ โโโ files.py # File operations
โ โโโ ui/
โ โโโ index.html # 3D Orb interface
โ โโโ gui.py # GUI components
โโโ models/ # Vosk models directory
โโโ scripts/
โ โโโ setup_model.py # Model downloader
โโโ soul.md # Protected personality definition
โโโ view_memory.py # Memory viewer utility
โโโ test_soul.py # Soul protection tests
โโโ test_rag.py # RAG system tests
โโโ memory.db # Conversation database (auto-created)
โโโ embeddings_cache.pkl # RAG embeddings cache (auto-created)
โโโ requirements.txt # Python dependencies
Edit soul.md to customize:
- AI personality and language
- Response style and tone
- System prompts
- Behavioral guidelines
Note: After editing soul.md, restart the application or use the reload feature.
Edit src/core/llm.py for:
- Model selection (default: 'j2')
- Advanced LLM parameters
Issue: Microphone not detected
- Solution: Check system audio settings and set default input device
Issue: Ollama connection failed
- Solution: Ensure Ollama is running:
ollama serve
Issue: Poor speech recognition
- Solution: Use Vosk models for better offline accuracy
Issue: Application won't start
- Solution: Check Python version (3.10+) and reinstall dependencies
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Context-aware conversations with memory
- Soul protection against prompt injection
- RAG system for contextual responses
- Wake word detection ("Hey Mareen")
- Multi-language support (Spanish, French, etc.)
- Plugin system for custom commands
- Mobile companion app
- Voice cloning for personalized TTS
- Integration with smart home devices
- Memory-based context retention across sessions
- Advanced injection detection with ML
This project is licensed under the MIT License - see the LICENSE file for details.
- Ollama - For making local LLMs accessible
- Vosk - For offline speech recognition
- pywebview - For the beautiful UI framework
- Edge TTS - For natural voice synthesis
โญ Star this repository if you find it helpful!
For issues and questions, please open an issue.
Made with โค๏ธ for privacy-conscious AI enthusiasts