A Windows-native voice automation assistant that translates natural speech (including Hinglish) into executable OS action graphs β launching apps, browsing the web, searching documents, automating text, and sending messages, all without touching a mouse.
[ Β·
Architecture Β·
Installation Β·
Usage Examples Β·
Roadmap]
| Section | Description |
|---|---|
| π¬ Demo | Screenshots and GIF placeholders |
| π Project Overview | What it is, what problem it solves |
| β¨ Features | Full feature matrix |
| π Project Workflow | End-to-end Mermaid flowchart |
| π System Architecture | Component diagram and data flows |
| βοΈ Detailed Execution Pipeline | Stage-by-stage breakdown |
| π Stateful Execution Engine | State machine, wait utils, launch verification, recovery |
| π Folder Structure | Directory tree |
| π§© Module Explanation | Per-module reference |
| π Technology Stack | Libraries and frameworks |
| βοΈ Configuration | Environment variables |
| π Installation Guide | Setup steps and troubleshooting |
| π¬ Usage Examples | Voice β Plan β Result walkthroughs |
| π§ͺ Testing | Test suite overview |
| Honest capability boundaries | |
| πΊ Roadmap | Planned improvements checklist |
πΉ Demo GIF β Record a short screen capture of a voice command and drop it here. Suggested:
docs/assets/demo.gif
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β [ π¬ Demo GIF Placeholder ] β
β Voice command β App launches automatically β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
π₯οΈ Dashboard Screenshot β
docs/assets/dashboard.png
π Safety Confirmation Dialog β
docs/assets/confirm_dialog.png
π€ Voice Recording Waveform β
docs/assets/recording_animation.gif
β Execution Result Panel β
docs/assets/execution_result.png
This project is a Windows-compatible voice-control application that maps speech or text inputs to executable action graphs (plans) on the host computer. It combines:
- π€ Local speech-to-text (Faster-Whisper, quantized model inference or remote Colab GPU offloading)
- π§ Pattern-based NLP (Hinglish normalization, intent classification, entity slot extraction)
- π LLM task planning (remote Qwen3-8B / Colab API with offline heuristic fallback)
- π₯οΈ Multi-tiered application resolution & launch verification (Start Apps, Win32 App Paths, UWP, WSL, PATH executables)
- π Contextual document retrieval (drive-wide semantic search with FAISS, BM25, and multi-format extractors)
- π Modern web UI & streaming engine (React 18 + Vite dashboard with Server-Sent Events live visualizer)
It eliminates manual user interaction β mouse clicking, keyboard typing, directory navigating, menu searching β for common desktop workflows. By listening to natural commands, it:
- Resolves and launches installed desktop applications or web-first services
- Searches local documents, drive locations, and the web
- Automates text typing, Notepad sessions, and file management
- Sends WhatsApp messages via web automation
- Monitors stateful execution and recovers automatically when steps stall
...all completely hands-free.
| Audience | Use Case |
|---|---|
| π§βπ» Power users | Hands-free desktop control via voice |
| βΏ Accessibility developers | Building system integrations for users with mobility impairments |
| π€ Automation engineers | Exploring voice-driven OS agent execution |
A basic speech recognizer only transcribes audio to text. This assistant:
- Parses semantic intents and resolves contextual references ("it", "here")
- Dynamically resolves local applications across UWP, Start Menu, Registry, WSL, and PATH
- Performs strict launch verification (gates success on visible window & foreground state rather than raw process creation)
- Protects slow-starting applications with a time-limited launch guard
- Employs contextual document search using hybrid FAISS vector embeddings and BM25 ranking
- Streams real-time pipeline status to a React + Vite frontend via Server-Sent Events (SSE)
- Manages stateful execution logs in an SQLite database and stops dangerous operations via confirmation gates
Only features fully implemented in the codebase are listed below.
| Feature | Module | Status |
|---|---|---|
| π€ Voice Recording (silence detection) | stt/audio_capture.py |
β |
| π Local Speech-to-Text (Faster-Whisper) | stt/whisper_engine.py |
β |
| π Remote STT (Colab GPU server) | stt/remote_whisper.py |
β |
| π€ Hinglish Normalization | agent/preprocess.py |
β |
| π§ Intent Classification | agent/intent_classifier.py |
β |
| π― Entity Slot Extraction | agent/entity_extractor.py |
β |
| π‘ Remote LLM Planner | agentic/llm/manager.py |
β |
| π Rule-Based Fallback Planner | agentic/llm/fallback.py |
β |
| π Desktop Resource & App Discovery | agentic/discovery/apps.py |
β |
| π₯οΈ Multi-Tiered App Resolution | automation/applications.py |
β |
| π‘οΈ Strict Launch Verification & Guard | automation/applications.py, execution/verifier.py |
β |
| π Web-First Target Routing | automation/applications.py |
β |
| π Contextual Document Search (FAISS + BM25) | agentic/document_retrieval/ |
β |
| π Notepad & Text Automation | automation/notepad.py |
β |
| π‘οΈ Safety Confirmation Gate | agentic/permissions.py, web/confirm_service.py |
β |
| π₯οΈ Desktop & Win32 Automation | automation/desktop.py |
β |
| π File System Management | automation/filesystem.py |
β |
| π Browser Automation | automation/browser.py |
β |
| π¬ WhatsApp Web Automation | automation/whatsapp.py |
β |
| π Neural TTS (Edge-TTS) | tts/edge_engine.py |
β |
| π Offline TTS Fallback (Pyttsx3) | tts/pyttsx3_engine.py |
β |
| πΎ SQLite Session History | storage/database.py |
β |
| π Stateful Execution Engine | execution/executor.py |
β |
| π©Ή Automated Failure Recovery | execution/recovery.py |
β |
| βοΈ React 18 + Vite Dashboard | frontend/ |
β |
| π‘ SSE Live Execution Stream | web/stream_service.py |
β |
| π Multi-step Execution Workflows | β | π§ Partial |
| ποΈ OCR / Vision Integration | β | π² Planned |
| π Wake Word Detection | β | π² Planned |
The complete end-to-end pipeline from voice input to system action:
flowchart TD
A([π€ User Speaks]) --> B[ποΈ Audio Capture\nstt/audio_capture.py]
B -->|WAV file| C[π Speech-to-Text\nFaster-Whisper Local / Remote]
C -->|Raw transcript| D[βοΈ Text Preprocessing\nHinglish β English]
D -->|Normalized text| E[π§ Intent & Entity Extraction\nagent/intent_classifier.py]
E -->|Parsed intent + entities| F[π Task Planning\nagentic/llm/manager.py]
F --> G{π Remote LLM\nAvailable?}
G -->|Yes| H[π Remote Planner API\nQwen3-8B / Colab]
G -->|No / Timeout| I[π Fallback Planner\nRule-based heuristics]
H -->|JSON plan steps| J[π‘οΈ Safety Gate\nagentic/permissions.py]
I -->|JSON plan steps| J
J --> K{β οΈ Dangerous\nTool?}
K -->|Yes| L[π Web Confirmation\nweb/confirm_service.py]
L -->|User approves| M[βοΈ Execution Engine\nexecution/executor.py]
L -->|User cancels| N([π§Ή Clear Session])
K -->|No - Safe tool| M
M -->|Step dispatch| O[π οΈ Automation Layer\nautomation/*]
O --> P[π» Windows OS / Apps / Web]
P --> Q{β
Verified via\nWindow & PID?}
Q -->|Yes| R[π TTS Response\ntts/manager.py]
Q -->|No| S[π©Ή Recovery Engine\nexecution/recovery.py]
S -->|Retry| O
R --> T([πΎ SQLite History\nstorage/database.py])
The following diagram maps all components, streams, and data flows:
graph TD
User([π€ User Audio / Text Input]) -->|Audio WAV / Text| WebAPI[π Flask REST API & SSE Stream\nweb/app.py]
WebAPI --> STT[π stt/whisper_engine.py / remote_whisper.py]
STT -->|Raw Transcript| Normalizer[βοΈ agent/preprocess.py]
Normalizer -->|Normalized Text| IntentClassifier[π§ agent/intent_classifier.py]
IntentClassifier -->|Parsed Intent & Entities| PlannerManager[π agentic/llm/manager.py]
PlannerManager -->|System Discovery Context| RemoteLLM{π Remote LLM Planner?}
RemoteLLM -- Yes --> API[requests / remote_client]
RemoteLLM -- No/Fallback --> Heuristic[π agentic/llm/fallback.py]
API -->|JSON Steps| SafetyGate[π‘οΈ agentic/permissions.py]
Heuristic -->|JSON Steps| SafetyGate
SafetyGate -- Dangerous Tool --> Queue[π± web/confirm_service.py]
Queue -->|Wait for approval| Approval{User Approves?}
Approval -- Proceed --> Executor[βοΈ execution/executor.py]
Approval -- Cancel --> Clear[π§Ή Clear Session]
SafetyGate -- Safe Tool --> Executor
Executor -->|Step Dispatch| AppResolver[π οΈ automation/applications.py & registry.py]
AppResolver -->|App / Web / Doc Search| Automation[π» Windows OS / Apps / Browser / FAISS]
Automation -->|Launch Verification| Verifier{π‘οΈ Process PID & Visible Window?}
Verifier -- Succeeded --> TTS[π tts/manager.py]
Verifier -- Failed --> Recovery[π©Ή execution/recovery.py]
Recovery -->|Restore / Focus / Relaunch| Automation
TTS -->|Edge-TTS / Pyttsx3| Playback[π Pygame / Web Audio]
TTS -->|Record Turn| DB[πΎ storage/database.py]
WebAPI -->|SSE Stream Events| Frontend[βοΈ React 18 + Vite Frontend\nfrontend/src/App.jsx]
π Click to expand all pipeline stages
| Property | Value |
|---|---|
| Module | stt/audio_capture.py |
| Input | Physical acoustic signals from microphone |
| Output | Temporary .wav file path on disk |
| Key Classes | AudioRecorder |
| Key Functions | record(), record_until_silence() |
| Failure Cases | No default microphone, sounddevice query failure |
| Recovery | Falls back to warning logs and empty recording blocks |
| Property | Value |
|---|---|
| Module | stt/whisper_engine.py, stt/remote_whisper.py |
| Input | WAV file path |
| Output | TranscriptionResult β transcribed text, language details, timing |
| Key Classes | WhisperSTT, RemoteWhisperSTT |
| Key Functions | transcribe() |
| Model | deepdml/faster-whisper-large-v3-turbo-ct2 (local) or Colab GPU server |
| GPU Mode | float16 on CUDA, int8 on CPU |
| Failure Cases | Model download failure, remote server timeout |
| Recovery | Falls back to local Whisper engine or empty transcript with warning |
| Property | Value |
|---|---|
| Module | agent/preprocess.py |
| Input | Raw text string |
| Output | Normalized, clean English string |
| Key Classes | TextPreprocessor |
| Key Functions | normalize_text(), tokenize() |
| Capabilities | Hinglish β English, typo correction, punctuation removal |
| Failure Cases | Long strings with non-ASCII symbols |
| Recovery | Keeps raw alphanumeric tokens, discards unmapped symbols |
| Property | Value |
|---|---|
| Modules | agent/intent_classifier.py, agent/entity_extractor.py |
| Input | Normalized string |
| Output | CommandIntent β intent string, entities dict, confidence score |
| Key Classes | IntentClassifier, EntityExtractor |
| Key Functions | classify(), extract_entities(), rank_intents() |
| Failure Cases | Sentence matches multiple conflicting patterns |
| Recovery | Splits on conjunctions; returns highest-scoring intent |
| Property | Value |
|---|---|
| Modules | agentic/llm/manager.py, agentic/llm/fallback.py |
| Input | Transcript string + system discovery context dict |
| Output | PlannerOutput β reasoning + list of action steps |
| Key Classes | PlannerManager |
| Key Functions | plan(), apply_heuristic_fallback(), _inject_context() |
| Failure Cases | Remote API timeout, JSON schema mismatch |
| Recovery | Activates apply_heuristic_fallback() for offline rule-based planning |
| Property | Value |
|---|---|
| Modules | agentic/permissions.py, web/confirm_service.py |
| Input | PlannerOutput plan step details |
| Output | Execution permit OR blocked confirmation UUID |
| Key Classes | PermissionManager, PendingActionManager |
| Key Functions | check_permissions(), handle_confirm() |
| Failure Cases | User closes browser during a safety block |
| Recovery | Ephemeral confirmation states expire automatically after 60 seconds |
| Property | Value |
|---|---|
| Module | execution/executor.py, execution/verifier.py |
| Input | ExecutionPlan with action steps (wait_for, timeout, requires) |
| Output | List of step-by-step results with lifecycle states and LaunchVerification metadata |
| Key Classes | DesktopExecutor, StepRecord, ExecutionContext, StepStatus |
| Key Functions | execute(), execute_step(), dispatch_wait(), dispatch_verify(), recover_step() |
| Failure Cases | App unresponsive, window fails to load, UI focus mismatch |
| Recovery | State machine: screenshot β restore β focus β relaunch β retry (up to max_retries, default: 2) |
| Property | Value |
|---|---|
| Module | automation/*, agentic/document_retrieval/* |
| Input | Execution payload arguments |
| Output | ExecutionResult model |
| Drivers / Engines | PyAutoGUI, Win32 APIs, Playwright, FAISS vector index, BM25 ranking, subprocess |
| Key Functions | open_application(), open_browser(), find_document_by_context(), send_whatsapp_message(), automate_notepad_typing() |
| Failure Cases | Playwright Chromium locks, OS lock-screen blocks |
| Recovery | Returns failed ExecutionResult to trigger executor recovery logic |
The execution engine is built around a state-aware sequential state machine that validates each action before proceeding to the next step.
stateDiagram-v2
[*] --> PENDING
PENDING --> EXECUTING : Dispatch handler
EXECUTING --> WAITING : Handler success & wait_for is set
EXECUTING --> VERIFYING : Handler success & no wait
WAITING --> VERIFYING : Wait condition met / Timeout
VERIFYING --> SUCCESS : Verification passed (Process PID + Window confirmed)
VERIFYING --> RECOVERY : Verification failed
RECOVERY --> RETRY : Recovery action completed
RETRY --> VERIFYING : Re-run handler
RECOVERY --> FAILURE : Max retries exhausted
SUCCESS --> [*]
FAILURE --> [*]
| State | Description |
|---|---|
PENDING |
Step is queued and waiting to run |
EXECUTING |
Registered tool handler is actively running |
WAITING |
Engine is polling for a post-execution readiness condition |
VERIFYING |
Engine inspects OS state (PID, visible window, foreground focus) |
RECOVERY |
Verification failed; recovery engine applies corrective strategies |
RETRY |
Tool handler is executed again after recovery |
SUCCESS |
Terminal: step completed successfully |
FAILURE |
Terminal: remaining plan steps are aborted |
The application resolution layer in automation/applications.py uses a multi-tiered discovery pipeline to eliminate execution failures and prevent false-positive launches.
- Canonical Aliases & Executables: Maps common names (
word,calc,cmd,vscode,spotify,notepad) to system executables or URI protocols. - Web-First Target Routing (
KNOWN_WEB_DESTINATIONS): Targets like Gmail, YouTube, GitHub, Google Drive, ChatGPT, Spotify, WhatsApp, Telegram, or web Office links automatically route to browser execution rather than failing desktop lookup. - Windows Start Apps Index (
Get-StartApps): Queries PowerShellGet-StartAppswith in-memory caching to resolve UWP applications and Start Menu shortcuts. - Win32 App Paths Registry: Searches
HKLMandHKCUunderSoftware\Microsoft\Windows\CurrentVersion\App Pathsfor installed desktop application paths. - PATH Executable Search: Performs
shutil.whichlookups across system environment paths. - WSL / Linux Distribution Launcher: Detects installed WSL distros (
wsl.exe -l -q) for commands referencing Ubuntu or Linux terminals.
Process creation alone is not considered successful execution. Application success is gated through strict launch verification:
pid: Verifies active process ID created bysubprocess.Popenoros.startfile.window_found&window_visible: Confirms a visible window handle (win32gui) exists for the process.foreground: Verifies whether the window was successfully brought to host foreground focus.status: Returnsverified_open,already_open,launched_no_window, orfailed.
Strict launch verification is designed to reduce false-positive execution results by validating actual visible OS window states before declaring success.
To prevent unnecessary duplicate process creation when launching slow-starting applications, the system maintains a time-limited _LAUNCH_GUARD tracking recent app launch timestamps with a 5.0-second cooldown period.
Implemented in agentic/document_retrieval/, the document retrieval system allows searching host files by filename or semantic context:
- Drive & Folder Scope: Scans drive roots (
C:\,D:\, etc.) and user priority locations (Desktop,Documents,Downloads,Pictures,Projects,OneDrive). - Hybrid Retrieval: Combines local
all-MiniLM-L6-v2dense vector embeddings indexed with FAISS (faiss-cpu) alongside BM25 sparse keyword ranking. - Document Extractors: Extracts text from PDF (
PyMuPDF), Word (python-docx), PowerPoint (python-pptx), Excel (openpyxl), Markdown, Text, and JSON.
Instead of bare time.sleep() calls, the engine uses condition-polling primitives from execution/wait_utils.py:
| Utility | Condition Polled |
|---|---|
wait_until_process_running(name) |
psutil process list β waits until app appears |
wait_until_window_exists(title) |
win32gui β waits until window title is visible |
wait_until_window_active(title) |
Waits for target window to become foreground |
wait_until_application_ready(name) |
Composite: process + window + active |
wait_until_element_ready(label) |
Polls coordinate locators for a specific UI element |
wait_until_browser_loaded() |
Monitors browser window title stability |
If a step fails verification, the engine applies recovery strategies in priority order (up to max_retries = 2):
flowchart LR
A[Verification Failed] --> B[πΈ Debug Screenshot\nSaved to data/]
B --> C[π Restore Minimized Window\nif window is iconic]
C --> D[π₯οΈ Bring to Foreground\nre-assert window focus]
D --> E{Process\nRunning?}
E -->|No| F[π Relaunch Application]
E -->|Yes| G[βΊ Retry Tool Handler]
F --> G
G --> H{Succeeded?}
H -->|Yes| I([β
SUCCESS])
H -->|No, retries left| B
H -->|No, max retries| J([β FAILURE])
AI-VOICE-ASSISTANT/
β
βββ π§ agent/ # Local NLP pipeline (text β intent)
β βββ preprocess.py # Hinglish normalization, tokenization
β βββ intent_classifier.py # Keyword scoring + regex pattern matcher
β βββ entity_extractor.py # Slot parameter extraction
β βββ command_registry.py # Intent definitions and categories
β βββ schemas.py # NLP data models
β
βββ π€ agentic/ # High-level agent: planning, memory, discovery
β βββ llm/
β β βββ manager.py # Remote + fallback planner orchestrator
β β βββ fallback.py # Rule-based offline planner
β β βββ remote_client.py # Remote Colab LLM API client
β β βββ schemas.py # Planner output models
β βββ discovery/
β β βββ apps.py # PowerShell Get-StartApps + UWP scanner
β β βββ browser.py # Browser bookmark/history extractor
β β βββ indexer.py # System resource indexer daemon
β β βββ manager.py # Resource resolution router
β βββ document_retrieval/ # Context-based document search engine
β β βββ search.py # Semantic + BM25 document query router
β β βββ indexer.py # Background document chunk & vector indexer
β β βββ embeddings.py # SentenceTransformer embedding loader
β β βββ retriever.py # FAISS vector store & BM25 ranker
β β βββ scanner.py # Multi-drive recursive folder walker
β β βββ config.py # Supported extensions & path configuration
β βββ document_search/ # Context document search module
β βββ file_context_search/ # File context discovery & ranking
β βββ memory/
β β βββ session_state.py # Singleton session context tracker
β β βββ app_context.py # Active app/window state
β β βββ pending_action.py # Confirmation payload manager
β βββ conversation/
β β βββ confirmation_manager.py # Multi-turn confirmation flows
β βββ permissions.py # Safety gate + tool permission checks
β βββ tool_registry.py # LLM tool definitions schema
β βββ schemas.py # ExecutionPlan, ActionStep models
β
βββ π automation/ # Low-level OS drivers
β βββ applications.py # Multi-tiered app launch & verification
β βββ browser.py # Web browser + search launcher
β βββ desktop.py # Keyboard/mouse simulation, screenshots
β βββ filesystem.py # Folder/file CRUD operations
β βββ notepad.py # Automated Notepad typing & session controls
β βββ document_retrieval_tool.py # Document search tool execution handler
β βββ whatsapp.py # Playwright WhatsApp Web automation
β
βββ βοΈ execution/ # Step-execution state machine
β βββ executor.py # Stateful DesktopExecutor lifecycle
β βββ registry.py # Tool name β handler function map
β βββ verifier.py # Post-step OS state & window verifier
β βββ recovery.py # Failure recovery strategy engine
β βββ wait_utils.py # Intelligent condition-polling primitives
β βββ step_state.py # StepRecord, StepStatus, ExecutionContext
β βββ schemas.py # ExecutionResult, ExecutionTimer
β
βββ π£ stt/ # Speech input processing
β βββ audio_capture.py # Microphone recording + silence detection
β βββ whisper_engine.py # Local Faster-Whisper engine wrapper
β βββ remote_whisper.py # Remote Colab GPU Whisper client
β
βββ π tts/ # Voice response synthesis
β βββ manager.py # TTSManager: engine selector + coordinator
β βββ edge_engine.py # Neural Edge-TTS async client
β βββ pyttsx3_engine.py # Offline system TTS fallback
β βββ response_generator.py # Execution outcome β natural language
β
βββ πΎ storage/ # Persistence layer
β βββ database.py # SQLite CRUD operations
β βββ history_manager.py # Session log manager
β
βββ π web/ # Flask web backend + REST/SSE API
β βββ app.py # App factory + server entry point
β βββ routes.py # REST API endpoint definitions
β βββ services.py # Core voice pipeline orchestration
β βββ stream_service.py # Server-Sent Events (SSE) streaming service
β βββ confirm_service.py # Safety confirmation webhook handler
β
βββ βοΈ frontend/ # React 18 + Vite Web Application
β βββ src/
β β βββ App.jsx # Main UI component & stream handler
β β βββ components/
β β β βββ desktop/ # LiveExecutionVisualizer, ConfirmationCard, MicRecorder
β β β βββ history/ # HistoryView session log list
β β β βββ notepad/ # NotepadControls, QuickShortcuts
β β β βββ search/ # DocumentViewer, FileSearchModal
β β βββ hooks/ # usePipelineStream, usePermissions, useAudioRecorder
β βββ package.json # Frontend npm dependencies
β βββ vite.config.js # Vite proxy & build configuration
β
βββ π§ͺ tests/ # 30-file test suite
βββ π evaluation/ # Pipeline evaluation benchmark runner
βββ π scripts/ # Dev utilities and startup helpers
βββ π colab_stt_server.ipynb # Colab GPU Whisper server notebook
βββ π colab_rag_server.ipynb # Colab GPU RAG server notebook
βββ π colab_inference_server.ipynb # Colab GPU LLM planner server notebook
βββ config.py # Central configuration (loaded from .env)
βββ .env.example # Environment variable template
βββ requirements.txt # Central Python dependencies
π§ NLP Agent Layer β click to expand
| Field | Detail |
|---|---|
| Purpose | Translates Hinglish β English, fixes typos, removes punctuation |
| Classes | TextPreprocessor |
| Functions | normalize_text(), tokenize() |
| Input | Raw string text |
| Output | Normalized clean string or token list |
| Dependencies | re, logging |
| Called By | agent/intent_classifier.py |
| Field | Detail |
|---|---|
| Purpose | Matches normalized text to named intents via keyword scoring and regex |
| Classes | IntentClassifier |
| Functions | classify(), rank_intents() |
| Input | Clean normalized string |
| Output | CommandIntent structures |
| Dependencies | re, dataclasses, command_registry, entity_extractor |
| Called By | web/services.py |
| Field | Detail |
|---|---|
| Purpose | Extracts slot variables from transcripts (app names, paths, contacts, queries) |
| Classes | EntityExtractor |
| Functions | extract_entities() |
| Input | Utterance string + intent parameters |
| Output | Dict of extracted slot values |
| Dependencies | logging, re |
| Called By | agent/intent_classifier.py |
π€ Planning & Discovery Layer β click to expand
| Field | Detail |
|---|---|
| Purpose | Orchestrates remote planning requests and offline fallbacks |
| Classes | PlannerManager |
| Functions | plan(), _inject_context() |
| Input | Transcription string |
| Output | PlannerOutput plan step models |
| Dependencies | json, requests, fallback.py, discovery/indexer.py |
| Called By | web/services.py |
| Field | Detail |
|---|---|
| Purpose | Rule-based planner mapping transcriptions to steps when offline |
| Functions | apply_heuristic_fallback() |
| Input | Transcript string |
| Output | PlannerOutput plan steps |
| Called By | agentic/llm/manager.py |
| Field | Detail |
|---|---|
| Purpose | Queries Windows Start Menu apps via PowerShell Get-StartApps with caching |
| Functions | get_start_apps(), find_start_app() |
| Output | Dict of AppUserModelID and app display names |
| Called By | automation/applications.py |
| Field | Detail |
|---|---|
| Purpose | Drive-wide document search using semantic FAISS embeddings & BM25 ranking |
| Functions | find_document_by_context(), open_document_result() |
| Dependencies | faiss, sentence_transformers, rank_bm25, fitz (PyMuPDF), docx, pptx |
| Called By | automation/document_retrieval_tool.py |
π Automation Drivers β click to expand
| Field | Detail |
|---|---|
| Purpose | Launch process handles, resolve Windows executables/UWP/WSL/Web-first targets, verify launch |
| Functions | open_application(), find_windows_app_paths(), resolve_wsl_distribution(), verify_launch_state() |
| Classes | LaunchVerification |
| Dependencies | psutil, win32gui, win32process, subprocess, shutil, winreg |
| Field | Detail |
|---|---|
| Purpose | Automate opening Notepad, focus window, typing text, and save dialog interaction |
| Functions | open_notepad_and_write(), type_into_notepad(), save_notepad_file() |
| Dependencies | pyautogui, win32gui, psutil |
| Field | Detail |
|---|---|
| Purpose | Launch web links and perform web searches |
| Functions | open_browser(), search_web() |
| Dependencies | webbrowser |
| Field | Detail |
|---|---|
| Purpose | Create files/folders, read content, list files, delete targets |
| Functions | create_folder(), create_file(), list_files(), delete_file() |
| Dependencies | os, shutil |
| Field | Detail |
|---|---|
| Purpose | Automate sending messages on WhatsApp Web |
| Functions | send_whatsapp_message() |
| Dependencies | playwright.sync_api |
| Note | Requires manual QR code login on first run |
βοΈ Execution Engine β click to expand
| Field | Detail |
|---|---|
| Purpose | Stateful, sequential plan execution with lifecycle management |
| Classes | DesktopExecutor (alias: SystemExecutor) |
| Functions | execute(), execute_step(), _run_step_lifecycle(), _verify_and_recover() |
| Dependencies | execution/registry, execution/wait_utils, execution/verifier, execution/recovery |
| Field | Detail |
|---|---|
| Purpose | Post-step OS state verification (process PID + visible window check) |
| Functions | dispatch_verify(), verify_application_launched(), _enumerate_all_windows() |
| Field | Detail |
|---|---|
| Purpose | Structured failure recovery: restore β focus β relaunch β retry |
| Functions | recover_step(), bring_to_foreground(), restore_minimized_window(), relaunch_application() |
βοΈ Frontend & Web Streaming β click to expand
| Field | Detail |
|---|---|
| Purpose | Yields Server-Sent Events (SSE) at each stage boundary for real-time visualization |
| Functions | run_pipeline_stream(), run_confirmation_stream() |
| Events | transcript, intent, entities, discovery, planner, execution, response, done |
| Field | Detail |
|---|---|
| Purpose | React 18 single-page dashboard rendering execution stream, history, and modals |
| Components | LiveExecutionVisualizer.jsx, ConfirmationCard.jsx, CompletionPopup.jsx, FileSearchModal.jsx |
All configuration lives in config.py and is overridable via a .env file:
# Copy the template
copy .env.example .env| Variable | Description | Default |
|---|---|---|
LOG_LEVEL |
Logging verbosity (DEBUG, INFO, WARNING, ERROR) |
INFO |
FLASK_PORT |
Flask backend port | 5000 |
COLAB_API_URL |
URL of remote LLM planning server | https://β¦/plan |
COLAB_TIMEOUT |
Network timeout for planner requests (seconds) | 120 |
STT_MODEL_ID |
Faster-Whisper model ID on Hugging Face | deepdml/faster-whisper-large-v3-turbo-ct2 |
STT_BEAM_SIZE |
Decode beam size | 5 |
STT_VAD_FILTER |
Enable VAD filter to strip silence | True |
STT_USE_REMOTE |
Route transcription to remote Colab GPU server | false |
STT_API_URL |
Remote STT /transcribe endpoint URL |
https://β¦/transcribe |
STT_API_TIMEOUT |
HTTP timeout for remote STT requests (seconds) | 60 |
SILENCE_THRESHOLD |
RMS amplitude threshold for silence detection | 0.01 |
SILENCE_DURATION |
Seconds of silence before recording stops | 2.0 |
| Requirement | Version |
|---|---|
| Operating System | Windows 10 or Windows 11 |
| Python | 3.10.x or 3.11.x (added to PATH) |
| Node.js & npm | Node 18+ (for React + Vite frontend) |
| Git | Any recent version |
| Microphone | Default audio input device configured in Windows |
1. Clone the repository
git clone https://github.com/Ashmita1206/AI-VOICE-ASSISSTANT.git
cd "AI-VOICE-ASSISSTANT"2. Create and activate a Python virtual environment
python -m venv .venv
.\venv\Scripts\Activate.ps13. Install Python dependencies
pip install -r requirements.txt4. Install Playwright browser binaries
playwright install chromium5. Install Frontend dependencies
cd frontend
npm install
cd ..6. Configure environment variables
copy .env.example .env
# Edit .env with your planner URL or logging preferences7. Run the application
In Terminal 1 (Backend Server):
python -m web.appIn Terminal 2 (Frontend Dev Server):
cd frontend
npm run devOpen your browser and navigate to http://localhost:5173 (or http://localhost:5000) to access the dashboard.
β Pywin32 / DLL Import Failure
If you receive import errors for win32gui or win32process on startup, force-reinstall pywin32 to register the system DLLs:
pip install --force-reinstall pywin32β Sounddevice / PortAudio Missing Device
If sounddevice warns that no input devices are available:
- Ensure a default microphone is plugged in
- Confirm it is set as the default input device in Windows Sound Settings
- Verify no other application has exclusive lock on the device
β CUDA / GPU Setup
By default, the STT engine auto-detects GPU drivers. If CUDA is not installed, the system falls back to CPU execution with INT8 quantization β functional but slower.
To enable GPU acceleration:
- Install CUDA Toolkit 11.x or 12.x matching your PyTorch build
- Verify with
python -c "import torch; print(torch.cuda.is_available())"
Each example shows the full pipeline: voice input β planner JSON β tool executed β result.
π€ User says: "Open browser" / "Browser kholo"
Normalizes: "browser open"
Planner Output:
{
"steps": [
{ "tool": "open_browser", "args": {} }
],
"response": "Opening your browser."
}Result: β Default browser opens
π€ User says: "Open Chrome"
Planner Output:
{
"steps": [
{
"tool": "launch_application",
"args": { "application": "chrome" },
"wait_for": "window_ready",
"timeout": 15
}
],
"response": "Launching Chrome."
}Result: β
Chrome launches via find_windows_app_paths, process ID and visible window are verified via LaunchVerification, and window is brought to foreground.
π€ User says: "Find my project proposal document"
Planner Output:
{
"steps": [
{
"tool": "find_document_by_context",
"args": { "query": "project proposal" }
}
],
"response": "Searching documents for project proposal."
}Result: β Drive-wide FAISS vector search and BM25 rank documents across PDF, Word, and text files, presenting matching paths in the Document Viewer.
π€ User says: "Delete report.pdf"
Planner Output:
{
"steps": [
{ "tool": "delete_file", "args": { "path": "report.pdf" } }
]
}Pipeline: delete_file is a dangerous tool β Safety gate blocks execution β Web dashboard shows:
"Are you sure you want to delete report.pdf?" [Proceed] | [Cancel]
Result: β File deleted only after explicit user confirmation β or β cancelled if user clicks Cancel
π€ User says: "Message Harshita and write hi"
Planner Output:
{
"steps": [
{
"tool": "send_whatsapp_message",
"args": { "contact": "Harshita", "message": "hi" }
}
]
}Pipeline:
Result: β Message delivered to Harshita on WhatsApp Web
The project contains a comprehensive 30-file test suite in tests/.
| Area | Test Files |
|---|---|
| NLP Pipeline | test_nlp_preprocess.py, test_nlp_intent_classifier.py, test_nlp_entity_extractor.py, test_nlp_pipeline.py, test_nlp_schemas.py, test_nlp_command_registry.py |
| Planning | test_remote_planner.py |
| Memory & Session | test_memory.py, test_confirm_api.py, test_confirmation.py |
| App Discovery & Resolution | test_agentic_discovery.py, test_resolution.py, test_generic_launch_architecture.py |
| Document Search | test_document_search.py, test_document_retrieval.py, test_remote_embeddings.py |
| Execution Engine | test_stateful_executor.py, test_executor.py, test_execution_dispatch.py, test_execution_pipeline_fix.py |
| Automation | test_automation.py, test_launch_and_confirm.py, test_notepad.py, test_spotify_automation.py, test_whatsapp_automation.py |
| Permissions | test_permissions.py, test_interrupts.py |
| Storage & Persistence | test_storage_persistence.py |
| TTS & Web API | test_tts.py, test_web_api.py |
# Run the full test suite
.\venv\Scripts\python -m pytest tests/ -v
# Run a specific execution test file
.\venv\Scripts\python -m pytest tests/test_execution_pipeline_fix.py -vThese are honest descriptions of current technical boundaries. No capabilities are exaggerated.
| Limitation | Details |
|---|---|
| πͺ Windows-only | Low-level win32gui calls, UWP app discovery (Get-StartApps), and registry shortcut indexing rely on Windows APIs. macOS/Linux are not supported. |
| π± Active UI Focus Required | PyAutoGUI dispatches keystrokes to the active foreground window. If the user locks the screen, automated typing tasks may fail or target the wrong window. |
| π No Visual Reasoning (OCR/Vision) | The assistant cannot analyze on-screen elements visually. It relies on process parameters, window handles, accessibility trees, and pre-calculated bounds. |
| π¬ WhatsApp Web Login | Automated messaging requires manual QR code login on first run (Playwright shares the Chromium profile folder). |
| π Remote Planner Dependency | The default planning engine requires an active HTTP connection to the external Colab LLM API. Offline mode uses rule-based fallback only. |
| π Multi-step Workflows | π§ Partially implemented. Sequential execution works but complex inter-step dependencies and branching are not fully tested. Do not rely on this for production multi-step flows. |
Core Features
[x] Faster-Whisper local speech-to-text
[x] Hinglish normalization
[x] Intent classification + entity extraction
[x] Remote LLM planner (Qwen3-8B / Colab API)
[x] Rule-based fallback planner
[x] Multi-tiered app resolution & launch verification
[x] Time-limited launch guard (duplicate suppression)
[x] Web-first destination target routing
[x] Contextual document search (FAISS + BM25)
[x] Safety confirmation gate (web UI)
[x] Desktop & Notepad automation (PyAutoGUI + Win32)
[x] Browser automation (Playwright)
[x] WhatsApp Web messaging
[x] File system management
[x] SQLite session history
[x] Neural TTS (Edge-TTS) + offline fallback (Pyttsx3)
[x] Stateful execution engine (state machine)
[x] Automated failure recovery (screenshot, refocus, relaunch)
[x] React 18 + Vite Web Dashboard with SSE live execution stream
[x] Remote STT (Colab GPU server)
In Progress
[~] Multi-step execution workflows (partial implementation)
Planned
[ ] OCR / Computer Vision (click text labels without coordinates)
[ ] Wake word detection (Porcupine / Snowboy)
[ ] Self-healing parameter resolution (alternate path search on errors)
[ ] Cross-platform support (macOS / Linux drivers)
[ ] Voice command history replay
[ ] Plugin / tool extension system
This project is licensed under the MIT License β see the LICENSE file for details.
Built with β€οΈ for hands-free Windows automation
β Star this repository if you find it useful!