Skip to content

kingsrui/tryclawchat

Repository files navigation

TryclawChat Banner

🎙️ TryclawChat

Talk to your AI assistants — hands-free, real-time, in the browser.

Open-source voice chat client for OpenClaw · Push-to-Talk · Wake Word · Multi-Bot · Free TTS

PyPI License Stars Python


✨ Why TryclawChat?

Typing to your AI assistant while driving, cooking, or carrying your kid? Not ideal.

TryclawChat gives you a Jarvis-style voice interface for your OpenClaw AI assistants — right in the browser. Say something, hear the reply. Hands-free.

  • 🗣️ Three input modes — Push-to-Talk, text, and hands-free wake word ("Hey Alexa", "Jarvis", or your custom phrase)
  • 🤖 Multi-bot switching — Talk to different AI agents (coder, tester, assistant…) with one tap
  • 🔊 Free, high-quality TTS — Microsoft Edge TTS with 60+ voices, Chinese & English, zero cost
  • Real-time streaming — Groq Whisper STT (<1s latency) + chunked audio playback for instant responses
  • 📱 Mobile-first design — Works great on phone browsers, optimized for touch
  • 🔄 Cross-channel sync — Chat history syncs with your Telegram/OpenClaw sessions automatically
  • 🏠 Self-hosted & private — Runs on your machine, your data never leaves your network

🎬 Demo

Push-to-talk → AI responds with voice — all in the browser


🏗️ Architecture

┌─────────────┐     WebSocket      ┌──────────────────┐     HTTP      ┌─────────────────┐
│   Browser    │◄──────────────────►│  TryclawChat     │◄────────────►│  OpenClaw        │
│              │                    │  Server           │              │  Gateway         │
│  • Mic input │  audio/text/cmds   │                   │  sessions    │                  │
│  • Wake word │◄──────────────────►│  • Groq STT       │  send/history│  • Claude/GPT    │
│  • TTS play  │  responses/audio   │  • Edge TTS       │              │  • Tools/Skills  │
│  • Chat UI   │                    │  • Canonical DB   │              │  • Memory        │
└─────────────┘                    └──────────────────┘              └─────────────────┘
                                           │
                                    ┌──────┴──────┐
                                    │  SQLite DB   │
                                    │  (history)   │
                                    └─────────────┘

Key design decisions:

  • STT: Groq Whisper API — blazing fast cloud transcription, supports Chinese & English
  • TTS: Microsoft Edge TTS — free, 60+ neural voices, no API key required
  • History: Canonical SQLite store synced from OpenClaw gateway — single source of truth across all clients
  • Wake Word: Picovoice Porcupine (built-in keywords + custom) or OpenWakeWord (fully free)

🚀 Quick Start

Install

pip install tryclawchat

Run

tryclawchat

On first run, a setup wizard guides you through:

  1. OpenClaw Gateway URL and token
  2. Groq API key (for speech-to-text)
  3. Picovoice access key (optional, for wake word)
  4. HTTPS certificate (optional, recommended for mic access)

Then open https://localhost:7860 in your browser. That's it! 🎉

From Source

git clone https://github.com/TryAILab/tryclawchat.git
cd tryclawchat
pip install -e ".[dev]"
tryclawchat

🎯 Features in Detail

🗣️ Three Input Modes

Mode How it works Best for
Push-to-Talk Hold mic button to record, release to send Quick commands, noisy environments
Text Type in the input box, press Enter Quiet environments, precise input
Wake Word Say "Hey Alexa" / "Jarvis" / custom phrase → auto-records until you say the end word Hands-free (cooking, driving, exercising)

🤖 Multi-Bot Support

Switch between multiple OpenClaw agents instantly. Each bot has:

  • Its own avatar & name
  • Independent session & chat history
  • Configurable TTS voice
  • Dedicated wake word mapping (e.g., "Jarvis" → coder bot, "Alexa" → main bot)

🔊 Text-to-Speech

  • 60+ neural voices — Chinese (14 voices) and English (47 voices) via Microsoft Edge TTS
  • Smart text cleanup — Strips emoji, markdown, code blocks, and URLs before speaking
  • Chunked playback — Audio starts playing while the rest is still generating
  • Voice preview — Try any voice via the built-in /voices API

🔐 Wake Word Detection

Two engine options:

Engine Cost Custom Words Accuracy
Picovoice Porcupine Free tier available ✅ Train custom High
OpenWakeWord Completely free ✅ Train custom Good

Built-in wake words: Alexa, Jarvis, Computer, Blueberry, Grasshopper, Bumblebee, and more.

📱 Cross-Channel History Sync

TryclawChat maintains a canonical history store (SQLite) that syncs bidirectionally with OpenClaw:

  • Messages sent via voice chat appear in Telegram
  • Messages sent via Telegram appear in voice chat
  • Intermediate AI thinking steps (💭) shown in real-time
  • Deduplication & conflict resolution built-in

🔒 Self-Hosted & Private

  • Runs entirely on your local machine
  • Audio is processed via Groq API (cloud STT) — or bring your own local Whisper
  • TTS runs locally via Edge TTS (no cloud dependency)
  • Chat history stored in local SQLite
  • Optional HTTPS with self-signed certificates

⚙️ Configuration

All config lives in ~/.tryclaw-chat/:

File Description
.env API keys & server settings
shared_settings.json UI preferences (synced across clients)
canonical_history.db Chat history (SQLite)
cert.pem / key.pem HTTPS certificates
logs/ Server logs

Environment Variables

Variable Required Default Description
OPENCLAW_GATEWAY_URL http://localhost:18789 OpenClaw gateway address
OPENCLAW_GATEWAY_TOKEN Gateway auth token
GROQ_API_KEY Groq API key for Whisper STT
EDGE_TTS_VOICE zh-CN-XiaoxiaoNeural Default TTS voice
PORT 7860 Server port
PICOVOICE_ACCESS_KEY For Porcupine wake word
OPENCLAW_SESSION_NAMESPACE voice-chat Session namespace (isolate from other channels)
OPENCLAW_TELEGRAM_MIRROR_ENABLED 0 Mirror messages to Telegram
OPENCLAW_SESSION_KEY_MAIN auto-generated Override session key for main bot

CLI Options

tryclawchat                    # Start with defaults
tryclawchat --host 0.0.0.0    # Expose to LAN (access from phone)
tryclawchat --port 8080        # Custom port
tryclawchat --setup            # Re-run setup wizard
tryclawchat -v                 # Verbose logging
tryclawchat --version          # Show version

📋 Prerequisites


🧩 How It Fits into the OpenClaw Ecosystem

TryclawChat is a voice frontend for OpenClaw — it doesn't replace OpenClaw, it extends it with a voice interface.

You (voice) → TryclawChat → OpenClaw Gateway → Claude/GPT/... → TryclawChat → You (audio)
You (text)  → Telegram     → OpenClaw Gateway → Claude/GPT/... → Telegram    → You (text)
                                    ↕
                            Same sessions, same memory, same tools

Your AI assistants keep the same context whether you talk to them via voice or text on Telegram.


🗺️ Roadmap

  • Push-to-Talk with real-time STT
  • Multi-bot switching with per-bot settings
  • Wake word detection (Porcupine + OpenWakeWord)
  • Cross-channel history sync (canonical store)
  • Telegram message mirroring
  • pip-installable package with setup wizard
  • VAD (Voice Activity Detection) auto-recording mode
  • Custom wake word training UI
  • WebRTC for lower latency audio
  • Local Whisper STT option (no cloud dependency)
  • Plugin system for custom STT/TTS providers

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repo
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Development Setup

git clone https://github.com/TryAILab/tryclawchat.git
cd tryclawchat
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pytest  # Run tests

📄 License

MIT © TryAILab


Built with ❤️ for the OpenClaw community

About

TryclawChat - Browser-based voice chat client for OpenClaw gateway with STT/TTS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors