LEO is a Python-based personal AI voice assistant designed to provide natural voice interaction, AI-powered responses, memory, desktop control, utility tools, and contextual assistance from a local Windows environment.
LEO combines speech recognition, text-to-speech, Google's Gemini API, utility tools, memory functions, and desktop automation into a single extensible assistant.
LEO is designed as a practical desktop AI assistant rather than a simple chatbot.
You can communicate with LEO using your voice, ask questions, perform calculations, open websites, retrieve useful information, store or retrieve memories, and interact with supported desktop functionality.
The project is built with Python and is designed to be modular so additional capabilities can be added over time.
- Speech-to-text input
- Text-to-speech responses
- Natural conversational interaction
- Continuous assistant workflow
- Powered by Google's Gemini API
- Natural-language understanding
- Context-aware responses
- General-purpose question answering
LEO includes a memory layer that allows supported information to be stored and retrieved.
Example capabilities include:
- Remembering user-provided facts
- Retrieving stored information
- Forgetting previously stored information
- Viewing stored memories
LEO can perform supported utility actions such as:
- Opening websites
- Getting the current time
- Performing calculations
- Executing supported desktop actions
LEO uses separate tools/functions for specific capabilities.
This makes the assistant easier to:
- Extend
- Debug
- Maintain
- Customize
Sensitive configuration such as API keys is stored through environment variables rather than being hard-coded into the source code.
| Technology | Purpose |
|---|---|
| Python | Core application |
| Google Gemini API | AI responses |
| SpeechRecognition | Speech-to-text |
| PyAudio | Microphone input |
| pyttsx3 | Text-to-speech |
| python-dotenv | Environment configuration |
| Web/browser utilities | Website and desktop actions |
Before installing LEO, make sure you have:
- Windows 10/11
- Python 3.10 or compatible Python version
- A working microphone
- Speakers or headphones
- Internet connection
- A Google Gemini API key
git clone https://github.com/MobeenFatimaa/LEO.gitMove into the project directory:
cd LEOCreate a Python virtual environment:
python -m venv .venvActivate it in PowerShell:
.venv\Scripts\Activate.ps1If activation is successful, your terminal should show something similar to:
(.venv)
Install the required Python packages:
pip install -r requirements.txtCreate a file named:
.env
inside the project root.
Add your Gemini API key:
GEMINI_API_KEY=your_api_key_hereReplace:
your_api_key_here
with your actual API key.
Never publish your real API key to GitHub.
The .env file should remain private and should be excluded through .gitignore.
After completing the installation and environment configuration, run:
python main.pyLEO should initialize and begin its assistant workflow.
Make sure your microphone is connected and accessible by Windows.
Depending on the enabled tools and configuration, you can interact with LEO using commands such as:
What time is it?
Open YouTube.
Calculate 25 * 48.
Remember that my favorite programming language is Python.
What do you remember about me?
Forget that my favorite programming language is Python.
You can also ask general questions and have normal conversations with the AI assistant.
LEO includes a memory system that provides persistent storage for supported user-provided facts.
The memory functionality includes operations for:
- Remembering information
- Retrieving information
- Forgetting information
- Listing stored memories
This allows LEO to maintain useful information across interactions.
LEO is organized around a modular assistant architecture.
User
│
▼
Microphone
│
▼
Speech Recognition
│
▼
LEO Core
│
├── Gemini AI
│
├── Memory System
│
├── Utility Tools
│
└── Desktop Actions
│
▼
Response
│
▼
Text-to-Speech
│
▼
User
The architecture is designed so additional tools and capabilities can be integrated without rewriting the entire assistant.
A simplified representation of the project:
LEO/
│
├── main.py
├── requirements.txt
├── .env.example
├── .gitignore
├── README.md
│
├── tools/
│ └── ...
│
├── memory/
│ └── ...
│
└── ...
The exact structure may evolve as new capabilities are added.
LEO requires an API key to access Gemini-powered functionality.
Do not commit sensitive credentials to GitHub.
Your .env file should contain your private credentials locally:
GEMINI_API_KEY=your_private_keyNever replace the placeholder in .env.example with your real API key before committing it.
If an API key is accidentally exposed, revoke or rotate it immediately through the relevant provider.
Make sure:
- Your microphone is connected.
- Windows has microphone permissions enabled.
- The correct microphone is selected as the Windows input device.
- Required audio dependencies are installed.
You can verify the installed packages with:
pip listVerify Python installation:
python --versionIf Python is installed but the command is unavailable, check that Python has been added to your system PATH.
Check that:
- Your
.envfile exists. - The variable name is correct.
- Your API key is valid.
- Your internet connection is working.
- The required Gemini API access is available for your account.
Make sure the virtual environment is activated:
.venv\Scripts\Activate.ps1Then reinstall dependencies:
pip install -r requirements.txtPossible future development areas include:
- Expanded desktop automation
- More external tools
- Improved conversational context
- Additional memory capabilities
- Custom wake-word support
- More advanced system controls
- Local/offline AI capabilities
- Improved error handling
- Configurable assistant personality
- Plugin-style tool architecture
Mobeen Fatima
AI / Machine Learning Developer
GitHub: https://github.com/MobeenFatimaa
LinkedIn: https://www.linkedin.com/in/mobeen-fatima-599a35347/
Portfolio: https://mobeenfatima.netlify.app/
This project is distributed under the license included in this repository.
See the LICENSE file for details.
If you find LEO interesting or useful, consider giving the repository a ⭐ on GitHub.
Contributions, suggestions, and improvements are welcome.