A real-time, browser-based voice assistant powered by Mistral AI and the Web Speech API. Talk to it — it listens, thinks, and speaks back in a natural human voice. Built with Python + Streamlit.
- 🎙️ Always-on voice listening — click once, it keeps listening after every reply
- 🤖 Mistral AI backend — fast, intelligent conversational responses
- 🔊 Natural voice output — uses browser's Neural TTS (Google/Microsoft voices)
- 💬 Text input fallback — type if you prefer
- 🧠 Conversation memory — remembers context across the full session
- ⚡ Zero heavy dependencies — no PyAudio, no C++ build tools needed
- 🌐 Runs in the browser — works on Windows, Mac, Linux
| Layer | Technology |
|---|---|
| LLM / AI | Mistral AI (mistral-small-latest) |
| Speech-to-Text | Web Speech API (Chrome/Edge built-in) |
| Text-to-Speech | Web Speech Synthesis API (Neural voices) |
| UI Framework | Streamlit + HTML/CSS/JS component |
| Language | Python 3.10+ |
| API Client | OpenAI-compatible SDK → Mistral endpoint |
git clone https://github.com/MaazzAlii/ai-voice-chatbot-python.gitpython -m venv venv
# Windows:
venv\Scripts\activate
# Mac/Linux:
source venv/bin/activatepip install -r requirements.txtCreate the file .streamlit/secrets.toml:
MISTRAL_API_KEY = "your_mistral_api_key_here"🔑 Get a free API key at console.mistral.ai
streamlit run app.pyOpen Chrome or Edge at http://localhost:8501
- Click the 🎙️ mic button — turns red, starts listening
- Speak naturally — auto-transcribes and replies
- After replying, auto-resumes listening for your next message
- Click ⏹️ anytime to stop
- Toggle 🔊 Speak to turn voice on/off
- Or just type in the text box
maaz-ai-assistant/
│
├── app.py # Main app (Streamlit + JS voice engine)
├── requirements.txt # Python dependencies
├── .streamlit/
│ └── secrets.toml # API key — DO NOT commit this
├── .gitignore
└── README.md
| Browser | Works? |
|---|---|
| ✅ Google Chrome | Full support |
| ✅ Microsoft Edge | Full support |
| ❌ Firefox | Not supported |
Use Google Chrome for the best experience.
Maaz Ali — BS Computer Science, NUML Islamabad
- 🐙 GitHub: @maazzalii
- 💼 LinkedIn: maazzalii
⭐ Star this repo if you found it useful!