The Ultimate Voice Bridge & AI Companion
KnightBot is a cutting-edge, local-first AI assistant that bridges the gap between text, voice, and visual interaction. Leveraging state-of-the-art (SOTA) open-source models, it provides a seamless, low-latency conversational experience with personality, memory, and now—customizable voice and avatar identities.
- Neural Link Widget: A sleek, draggable, collapsible voice interface that sits overlayed on your screen.
- Voice Cloning Lab: Upload any clean WAV file (10-20s) to instantly clone and switch Knight's voice.
- Avatar System: Assign visual avatars (images) to voice profiles. (Future: Real-time animation support).
- LiveKit Integration: Robust, ultra-low latency audio streaming pipeline (Pipecat) for "interruptible" conversations.
- Persistent Memory: Remembers context across sessions using Vector DB.
docs/PROGRESS-2026-02-21-KNIGHTBOT.mddocuments the latest voice-pipeline stabilization work, latency wins, and file-level implementation summary before this push.
- OS: Windows 10/11 (Preferred) or Linux.
- Python: 3.10+
- Node.js: 18+
- Docker: Required for Qdrant, LiveKit, and Mem0/OpenMemory.
- LM Studio: Must be running locally (Port 1234) with a loaded LLM (e.g., Llama 3, Mistral).
- GPU: NVIDIA RTX 3060 or better recommended for local TTS/STT.
-
Clone the Repository
git clone https://github.com/TacImpulse/KnightBot-Live.git cd KnightBot-Live
-
Run Installer
.\install.ps1
This script sets up the Python venv, verifies prerequisites (including
ffmpeg), and installs backend/frontend dependencies. -
Start KnightBot
.\start.ps1
This is the canonical launcher. It performs preflight checks (ports, Docker, venv, ffmpeg, LM Studio reachability) and launches services in sequence:
frontend(Next.js): http://localhost:3000knight_core(Orchestrator): Port 8100chatterbox(TTS): Port 8060parakeet(STT): Port 8070pipecat(Real-time Audio): Background process
-
Stop KnightBot
.\stop.ps1
This is the canonical shutdown script. It stops KnightBot-bound ports and then brings Docker services down.
After start.ps1 is up, you can run a single diagnostic that verifies the basic back-and-forth path end-to-end.
python .\scripts\system_check.pyWhat this now checks:
- Service health (
Core,TTS,STT,Frontend) - Core chat response (
/chat) - TTS synthesis (
/synthesize) - End-to-end voice round-trip:
- sends sample audio to STT (
/transcribe) - sends transcript to Knight Core (
/chat) - sends reply text to TTS (
/synthesize) - validates returned audio bytes are non-empty
- sends sample audio to STT (
Sample audio auto-discovery order:
data/stt_test.webmdata/voices/knight_voice.wav
If neither sample is present, only the round-trip step is skipped and all other diagnostics still run.
If you want to confirm robust memory wiring after startup:
- Run the deterministic verifier:
F:\KnightBot\venv\Scripts\python.exe F:\KnightBot\scripts\verify_mem0.py - Inspect report output:
F:\KnightBot\data\logs\mem0_verify.jsonF:\KnightBot\data\logs\mem0_verify_stdout.txt
Expected healthy signals in mem0_verify.json:
openapi_status: 200store_status: 200or201filter_status: 200filter_token_found: trueok: true
If store_body_preview.error shows "Memory client is not available", OpenMemory is reachable but vector-backed persistence is degraded. In that case:
- ensure Docker mem0 service was recreated from this repo compose file,
- ensure startup bootstrap ran (
start.ps1now auto-initializesUSER_ID+knightbotapp), - ensure your model backend and vector dependencies are reachable from the mem0 container.
- Access UI: Open http://localhost:3000
- Voice Mode: Click the Microphone icon or press
Ctrl+V. - Settings: Click the Gear icon on the Neural Link widget to:
- Upload/Delete Voice Clones.
- Set/Upload Avatar Images.
- Rename Profiles.
- Stop: Press
Escto stop TTS playback instantly.
You can tune interruption behavior and telemetry via environment variables before launching:
| Variable | Default | Description |
|---|---|---|
KB_INTERRUPTION_MODE |
polite |
Interruption policy: polite, balanced, aggressive, or legacy |
KB_INTERRUPT_RMS |
700 |
Base RMS threshold for speech-energy interruption detection |
KB_INTERRUPT_MIN_MS |
300 |
Minimum sustained speech energy before interruption probe |
KB_INTERRUPT_MIN_WORDS |
3 |
Minimum STT-confirmed words to commit interruption (non-legacy modes) |
KB_INTERRUPT_PROBE_COOLDOWN_S |
0.35 |
Cooldown between interruption STT probes |
KB_STT_CHUNK_BYTES |
16000 |
STT chunk size; lower can reduce latency but increase overhead |
KB_TTS_CHUNK_MS |
40 |
TTS stream chunk duration in ms |
KB_TTS_COOLDOWN_S |
0.15 |
Post-TTS cooldown to reduce self-transcription feedback |
KB_VOICE_METRICS_ENABLED |
1 |
Enables structured per-turn telemetry output |
When telemetry is enabled, turn metrics are written to:
data/logs/voice_metrics/*.json
Each turn file includes STT/LLM/TTS timings plus interruption events to support iterative optimization.
KnightBot follows a microservices architecture for modularity and scalability:
| Service | Port | Description | Tech Stack |
|---|---|---|---|
| Frontend | 3000 | User Interface & Neural Link | Next.js, React, Tailwind, LiveKit Client |
| Knight Core | 8100 | Brain/Orchestrator | FastAPI, LangChain, Mem0 |
| Chatterbox | 8060 | Text-to-Speech Engine | FastAPI, XTTS/VITS (Custom), PyTorch |
| Parakeet | 8070 | Speech-to-Text Engine | FastAPI, Faster-Whisper |
| Pipecat | N/A | Real-time Voice Pipeline | Python, Pipecat, LiveKit Server |
| Qdrant | 6333 | Vector Database | Docker |
| Mem0 / OpenMemory | 8050 | Persistent memory API used by Knight Core | Docker |
We follow Standard Operating Procedures (SOP) for high-quality code contributions.
KnightBot/
├── frontend/ # Next.js Application
├── scripts/ # Knight Core (Backend)
├── chatterbox/ # TTS Service
├── parakeet/ # STT Service
├── pipecat/ # LiveKit Pipeline Agent
├── data/ # Persistent data (voices, avatars, memory)
└── docs/ # Documentation
- Branching: Use feature branches (
feature/new-avatar-system). - Commit Messages: Clear and descriptive (e.g.,
feat: add avatar upload endpoint). - Testing: Verify all services start and intercommunicate before pushing.
- Upgrade roadmap:
docs/SOTA-Upgrade-Plan.md - Implementation intake checklist:
docs/Implementation-Intake-Checklist.md
Use these docs to track the phased rollout for realtime barge-in upgrades, UX improvements, launcher unification, and LM Studio optimization.
- Real-time Animated Avatars: Integration of
TalkingHead(ThreeJS) orMuseTalkfor lip-synced visual personas. - Video Input: "Vision" capabilities for Knight to "see" via webcam.
- Mobile App: React Native bridge.
MIT License. See LICENSE for details.
Built with ❤️ by TacImpulse & KnightBot Dev Team