Voice-Directed Autonomous Computer-Use Agent powered by the Solari Desktop SDK, LangGraph Reasoning Loops, OpenAI Whisper & TTS, and a Real-Time "War Room" WebSocket Observability Dashboard.
Most autonomous agent demos are either basic browser scrapers or text-in/text-out terminal scripts. Solari Voice Agent is a full-stack, voice-directed computer-use agent that takes natural spoken instructions, breaks them into visual GUI milestones with LangGraph, controls a managed Linux virtual desktop via the Solari Desktop API, and speaks back a synthesized answer using OpenAI TTSโall while streaming live screenshots, thought tokens, and action bounding boxes to a real-time Mission Control War Room.
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐๏ธ Spoken Voice โ โโโ> โ OpenAI Whisper STT โ โโโ> โ LangGraph Planner โ
โ (Mic / Web) โ โ (Audio -> Text) โ โ (Milestone Breakdown) โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโฌโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ ๐ LangGraph Screenshot-Reason-Act Loop โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โ
โ โ ๐๏ธ Solari Desktop โ โ> โ ๐ง Multimodal Vision โ โ> โ โก Solari Action โ โ
โ โ Screenshot Stream โ โ Reasoner (GPT-4o)โ โ API (Click/Type)โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ (On Task Completion)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ OpenAI TTS Synthesizer (Spoken Voice Summary) + ๐ฅ๏ธ War Room Live Stream โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-
End-to-End Voice Loop (STT -> Vision Action -> TTS):
- Voice Input: Captures spoken commands directly from the browser microphone (HTML5 Web Audio + frequency waveform canvas) or local microphone, transcribed via OpenAI Whisper.
- Voice Output: Speaks back extracted information naturally using OpenAI Speech API (
tts-1).
-
LangGraph State Machine:
- Structured
StateGraphwith dedicated nodes:plannerโperceiveโreasonโexecuteโsynthesize. - Dynamic conditional routing between action execution and task completion.
- Structured
-
Solari Desktop Cloud Integration & Gotcha Handling:
- Programmatic mouse movement, click simulation, keyboard typing, and window control.
- Handles all documented Solari platform gotchas:
- ๐ก๏ธ VM Lifecycle: Solari's
close()method ends the connection stream, butkill()/destroy()is required to shut down the VM and avoid idle billing leaks. - ๐ Shell Command Interpretation: Desktop commands in Solari are not shell-interpreted by default. The client automatically wraps raw strings into
["bash", "-c", cmd]so pipes, subshells, and environment variables execute correctly. - โก Local Emulated Mode: Built-in mock desktop mode with dynamic PIL rendering for offline testing, demos, and CI without incurring VM credits.
- ๐ก๏ธ VM Lifecycle: Solari's
-
Real-Time "War Room" Observability Dashboard:
- Live Viewport: Streams screenshots with interactive coordinate tracking, bounding boxes, and animated red action crosshairs.
- Reasoning Inspector: Watch the Vision LLM's chain-of-thought in real time.
- Milestone Checklist: Tracks high-level plan progress.
- Action Timeline: Chronological log of GUI interactions with execution latency and observations.
solari/
โโโ .env.example # Environment variables template
โโโ requirements.txt # Production dependencies
โโโ pyproject.toml # Project packaging metadata
โโโ README.md # Complete documentation
โโโ SOCIAL_POSTS.md # Ready-to-publish X & LinkedIn post copy
โโโ demo.py # Automated demo script for video recordings
โโโ cli.py # Interactive terminal CLI runner
โโโ run_dashboard.py # FastAPI War Room dashboard launcher
โโโ main.py # Unified root entrypoint
โ
โโโ src/
โ โโโ config.py # Pydantic Settings & environment validation
โ โโโ agent/
โ โ โโโ state.py # LangGraph typed state schema (AgentState)
โ โ โโโ prompts.py # Planner & Vision Reasoner prompts
โ โ โโโ vision_reasoner.py# GPT-4o multimodal vision reasoning engine
โ โ โโโ graph.py # Compiled LangGraph workflow & WebSocket hooks
โ โโโ desktop/
โ โ โโโ interface.py # BaseDesktopClient ABC
โ โ โโโ solari_client.py # Solari Cloud Desktop SDK / REST API client
โ โ โโโ mock_desktop.py # Emulated desktop with dynamic PIL screen rendering
โ โโโ voice/
โ โ โโโ stt.py # Whisper Speech-to-Text transcriber
โ โ โโโ tts.py # OpenAI Text-to-Speech synthesizer & audio streaming
โ โโโ server/
โ โ โโโ app.py # FastAPI REST & static asset server
โ โ โโโ websocket_manager.py # WebSocket broadcaster for War Room
โ โโโ utils/
โ โโโ logger.py # Rich terminal formatting & action cards
โ โโโ image_utils.py # Base64, thumbnails, & visual marker overlays
โ
โโโ static/
โ โโโ index.html # Mission Control War Room UI
โ โโโ style.css # Cyberpunk dark mode styling
โ โโโ app.js # Web Audio recording, canvas waveform, & WebSocket client
โ
โโโ tests/
โโโ test_agent_graph.py # LangGraph execution tests
โโโ test_solari_client.py # Solari lifecycle & gotcha tests
โโโ test_voice_stt_tts.py # STT & TTS tests
โโโ test_server.py # FastAPI endpoint & WebSocket tests
- Python 3.10 or higher
- Solari API Key (
slr_live_...from getsolari.com) - OpenAI API Key (
sk-...)
# Clone the repository
git clone https://github.com/your-username/solari-voice-agent.git
cd solari-voice-agent
# Create and activate virtual environment
python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtCopy .env.example to .env and fill in your API keys:
cp .env.example .envEdit .env:
SOLARI_API_KEY=slr_live_your_key_here
OPENAI_API_KEY=sk-your_openai_key_here
# Optional: Set to true to test locally without consuming Solari/OpenAI credits
USE_MOCK_DESKTOP=falsepython run_dashboard.pyOpen http://localhost:8000 in your browser:
- Click the glowing Microphone button and speak an instruction (e.g. "Check the weather in Tokyo and tell me").
- Watch the live desktop stream, action crosshairs, chain-of-thought, and milestone checklist update in real time.
- Hear the agent read back the final answer through your speakers!
# Interactive selection:
python cli.py
# Direct voice instruction via local mic:
python cli.py --mic
# Direct text command:
python cli.py --task "Find the top post on Hacker News and summarize it"# Runs the Tokyo Weather demonstration:
python demo.py weather
# Runs the Hacker News demonstration:
python demo.py hnRun the comprehensive test suite:
pytest -vOutput:
tests/test_agent_graph.py::test_reasoner_milestone_planning PASSED [ 9%]
tests/test_agent_graph.py::test_full_langgraph_execution_loop PASSED [ 18%]
tests/test_server.py::test_status_endpoint PASSED [ 27%]
tests/test_server.py::test_index_html_endpoint PASSED [ 36%]
tests/test_server.py::test_kill_desktop_endpoint PASSED [ 45%]
tests/test_server.py::test_run_task_endpoint_mock PASSED [ 54%]
tests/test_solari_client.py::test_mock_desktop_lifecycle PASSED [ 63%]
tests/test_solari_client.py::test_solari_command_wrapping PASSED [ 72%]
tests/test_solari_client.py::test_image_utils_annotation PASSED [ 81%]
tests/test_voice_stt_tts.py::test_stt_initialization_and_fallback PASSED [ 90%]
tests/test_voice_stt_tts.py::test_tts_initialization_and_data_uri PASSED [100%]
============================= 11 passed in 3.83s ==============================
| Environment Variable | Default | Description |
|---|---|---|
SOLARI_API_KEY |
"" |
Solari Cloud authentication key (slr_live_...) |
SOLARI_API_BASE |
https://api.getsolari.com |
Solari API base endpoint |
OPENAI_API_KEY |
"" |
OpenAI API key for Whisper, GPT-4o Vision, and TTS |
VISION_MODEL |
gpt-4o |
Multimodal Vision model for GUI screenshot inspection |
PLANNING_MODEL |
gpt-4o |
LLM used for initial milestone breakdown |
WHISPER_MODEL |
whisper-1 |
OpenAI Whisper model for audio transcription |
TTS_MODEL |
tts-1 |
OpenAI Speech synthesis model |
TTS_VOICE |
alloy |
Voice style (alloy, echo, fable, onyx, nova, shimmer) |
DESKTOP_WIDTH |
1024 |
Desktop screen width in pixels |
DESKTOP_HEIGHT |
768 |
Desktop screen height in pixels |
DESKTOP_TIMEOUT |
600 |
Session timeout in seconds |
DESKTOP_ON_TIMEOUT |
kill |
Teardown behavior on timeout (pause or kill) |
MAX_STEPS |
15 |
Maximum LangGraph reasoning iterations per task |
USE_MOCK_DESKTOP |
false |
Enable simulated desktop rendering for offline tests |
- Session
close()vs VMkill(): In Solari, callingclose()simply disconnects the WebSocket stream. To prevent runaway cloud billing, always callkill()ordestroy()upon task completion or error handling to terminate the underlying microVM. - Command Execution Interpreter:
Commands run through Solari's action API are not executed through a shell by default. Our client wraps string commands in
["bash", "-c", cmd]so environment variables, pipes (|), and bash redirects work as expected. - Viewport Coordinate Mapping: Normalized coordinates from Vision models are scaled to the remote resolution (e.g. 1024x768) with visual marker compensation.
MIT License. Free for open source and commercial use.