Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/robot-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,18 @@ jobs:
echo "✓ Test config.yml created from tests/configs/deepgram-openai.yml"
ls -lh config/config.yml
- name: Create plugins.yml from template
run: |
echo "Creating plugins.yml from template..."
if [ -f "config/plugins.yml.template" ]; then
cp config/plugins.yml.template config/plugins.yml
echo "✓ plugins.yml created from template"
ls -lh config/plugins.yml
else
echo "❌ ERROR: config/plugins.yml.template not found"
exit 1
fi
- name: Run Robot Framework tests
working-directory: tests
env:
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ tests/setup/.env.test
config/config.yml
!config/config.yml.template

# Plugins config (contains secrets)
config/plugins.yml
!config/plugins.yml.template

# Config backups
config/*.backup.*
config/*.backup*
Expand Down
10 changes: 1 addition & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,8 @@ cp .env.template .env # Configure API keys
# Run full integration test suite
./run-test.sh

# Manual test execution (for debugging)
source .env && export DEEPGRAM_API_KEY && export OPENAI_API_KEY
uv run robot --outputdir test-results --loglevel INFO ../../tests/integration/integration_test.robot

# Leave test containers running for debugging (don't auto-cleanup)
CLEANUP_CONTAINERS=false source .env && export DEEPGRAM_API_KEY && export OPENAI_API_KEY
uv run robot --outputdir test-results --loglevel INFO ../../tests/integration/integration_test.robot

# Manual cleanup when needed
docker compose -f docker-compose-test.yml down -v
CLEANUP_CONTAINERS=false ./run-test.sh
```

#### Test Configuration Flags
Expand Down
11 changes: 8 additions & 3 deletions Docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,16 @@ PARAKEET_ASR_URL=http://host.docker.internal:8080

After configuration, verify everything works with the integration test suite:
```bash
# From backends/advanced directory
./run-test.sh

# Alternative: Manual test with detailed logging
source .env && export DEEPGRAM_API_KEY OPENAI_API_KEY && \
uv run robot --outputdir ../../test-results --loglevel INFO ../../tests/integration/integration_test.robot
# Or run all tests from project root
cd ../..
./run-test.sh advanced-backend

# Or run complete Robot Framework test suite
cd tests
./run-robot-tests.sh
```
This end-to-end test validates the complete audio processing pipeline using Robot Framework.

Expand Down
39 changes: 38 additions & 1 deletion backends/advanced/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,41 @@ CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://127.0.0.1:5173,h
LANGFUSE_PUBLIC_KEY=""
LANGFUSE_SECRET_KEY=""
LANGFUSE_HOST="http://x.x.x.x:3002"
LANGFUSE_ENABLE_TELEMETRY=False
LANGFUSE_ENABLE_TELEMETRY=False

# ========================================
# TAILSCALE CONFIGURATION (Optional)
# ========================================
# Required for accessing remote services on Tailscale network (e.g., Home Assistant plugin)
#
# To enable Tailscale Docker integration:
# 1. Get auth key from: https://login.tailscale.com/admin/settings/keys
# 2. Set TS_AUTHKEY below
# 3. Start Tailscale: docker compose --profile tailscale up -d
#
# The Tailscale container provides proxy access to remote services at:
# http://host.docker.internal:18123 (proxies to Home Assistant on Tailscale)
#
TS_AUTHKEY=your-tailscale-auth-key-here

# ========================================
# HOME ASSISTANT PLUGIN (Optional)
# ========================================
# Required for Home Assistant voice control via wake word (e.g., "Hey Vivi, turn off the lights")
#
# To get a long-lived access token:
# 1. Go to Home Assistant → Profile → Security tab
# 2. Scroll to "Long-lived access tokens"
# 3. Click "Create Token"
# 4. Copy the token and paste it below
#
# Configuration in config/plugins.yml:
# - Enable the homeassistant plugin
# - Set ha_url to your Home Assistant URL
# - Set ha_token to ${HA_TOKEN} (reads from this variable)
#
# SECURITY: This token grants full access to your Home Assistant.
# - Never commit .env or config/plugins.yml to version control
# - Rotate the token if it's ever exposed
#
HA_TOKEN=
11 changes: 8 additions & 3 deletions backends/advanced/Docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,16 @@ PARAKEET_ASR_URL=http://host.docker.internal:8080

After configuration, verify everything works with the integration test suite:
```bash
# From backends/advanced directory
./run-test.sh

# Alternative: Manual test with detailed logging
source .env && export DEEPGRAM_API_KEY OPENAI_API_KEY && \
uv run robot --outputdir ../../test-results --loglevel INFO ../../tests/integration/integration_test.robot
# Or run all tests from project root
cd ../..
./run-test.sh advanced-backend

# Or run complete Robot Framework test suite
cd tests
./run-robot-tests.sh
```
This end-to-end test validates the complete audio processing pipeline using Robot Framework.

Expand Down
37 changes: 35 additions & 2 deletions backends/advanced/docker-compose-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- ./data/test_audio_chunks:/app/audio_chunks
- ./data/test_debug_dir:/app/debug_dir
- ./data/test_data:/app/data
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml:ro # Mount config.yml for model registry and memory settings
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml # Mount config.yml for model registry and memory settings (writable for admin config updates)
environment:
# Override with test-specific settings
- MONGODB_URI=mongodb://mongo-test:27017/test_db
Expand Down Expand Up @@ -160,7 +160,7 @@ services:
- ./data/test_audio_chunks:/app/audio_chunks
- ./data/test_debug_dir:/app/debug_dir
- ./data/test_data:/app/data
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml:ro # Mount config.yml for model registry and memory settings
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml # Mount config.yml for model registry and memory settings (writable for admin config updates)
environment:
# Same environment as backend
- MONGODB_URI=mongodb://mongo-test:27017/test_db
Expand Down Expand Up @@ -200,6 +200,39 @@ services:
condition: service_healthy
restart: unless-stopped

deepgram-streaming-worker-test:
build:
context: .
dockerfile: Dockerfile
command: >
uv run python -m advanced_omi_backend.workers.audio_stream_deepgram_streaming_worker
volumes:
- ./src:/app/src
- ./data/test_data:/app/data
- ${CONFIG_FILE:-../../config/config.yml}:/app/config.yml
- ${PLUGINS_CONFIG:-../../config/plugins.yml}:/app/plugins.yml
environment:
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
- REDIS_URL=redis://redis-test:6379/0
- HA_TOKEN=${HA_TOKEN}
- MONGODB_URI=mongodb://mongo-test:27017/test_db
- QDRANT_BASE_URL=qdrant-test
- QDRANT_PORT=6333
- DEBUG_DIR=/app/debug_dir
- OPENAI_API_KEY=${OPENAI_API_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
- AUTH_SECRET_KEY=test-jwt-signing-key-for-integration-tests
- ADMIN_PASSWORD=test-admin-password-123
- ADMIN_EMAIL=test-admin@example.com
- TRANSCRIPTION_PROVIDER=${TRANSCRIPTION_PROVIDER:-deepgram}
- MEMORY_PROVIDER=${MEMORY_PROVIDER:-chronicle}
depends_on:
redis-test:
condition: service_started
mongo-test:
condition: service_healthy
restart: unless-stopped

# Mycelia - AI memory and timeline service (test environment)
# mycelia-backend-test:
# build:
Expand Down
65 changes: 64 additions & 1 deletion backends/advanced/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
services:
tailscale:
image: tailscale/tailscale:latest
container_name: advanced-tailscale
hostname: chronicle-tailscale
environment:
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false
- TS_ACCEPT_DNS=true
volumes:
- tailscale-state:/var/lib/tailscale
devices:
- /dev/net/tun:/dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
profiles:
- tailscale # Optional profile
ports:
- "18123:18123" # HA proxy port
command: >
sh -c "tailscaled &
tailscale up --authkey=$${TS_AUTHKEY} --accept-dns=true &&
apk add --no-cache socat 2>/dev/null || true &&
socat TCP-LISTEN:18123,fork,reuseaddr TCP:100.99.62.5:8123"
Comment on lines +2 to +26
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Hardcoded Tailscale IP address will not work for other users.

Line 26 contains a hardcoded IP address 100.99.62.5:8123 which appears to be a specific Tailscale node. This will break for any other deployment. Consider making this configurable via an environment variable:

🔎 Suggested fix
     command: >
       sh -c "tailscaled &
              tailscale up --authkey=$${TS_AUTHKEY} --accept-dns=true &&
              apk add --no-cache socat 2>/dev/null || true &&
-             socat TCP-LISTEN:18123,fork,reuseaddr TCP:100.99.62.5:8123"
+             socat TCP-LISTEN:18123,fork,reuseaddr TCP:${HA_TAILSCALE_HOST:-100.99.62.5}:${HA_PORT:-8123}"

Also, using tailscale/tailscale:latest may cause unexpected behavior after image updates. Consider pinning to a specific version. Per coding guidelines for docker-compose files, this is a maintainability concern.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tailscale:
image: tailscale/tailscale:latest
container_name: advanced-tailscale
hostname: chronicle-tailscale
environment:
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false
- TS_ACCEPT_DNS=true
volumes:
- tailscale-state:/var/lib/tailscale
devices:
- /dev/net/tun:/dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
profiles:
- tailscale # Optional profile
ports:
- "18123:18123" # HA proxy port
command: >
sh -c "tailscaled &
tailscale up --authkey=$${TS_AUTHKEY} --accept-dns=true &&
apk add --no-cache socat 2>/dev/null || true &&
socat TCP-LISTEN:18123,fork,reuseaddr TCP:100.99.62.5:8123"
tailscale:
image: tailscale/tailscale:latest
container_name: advanced-tailscale
hostname: chronicle-tailscale
environment:
- TS_AUTHKEY=${TS_AUTHKEY}
- TS_STATE_DIR=/var/lib/tailscale
- TS_USERSPACE=false
- TS_ACCEPT_DNS=true
volumes:
- tailscale-state:/var/lib/tailscale
devices:
- /dev/net/tun:/dev/net/tun
cap_add:
- NET_ADMIN
restart: unless-stopped
profiles:
- tailscale # Optional profile
ports:
- "18123:18123" # HA proxy port
command: >
sh -c "tailscaled &
tailscale up --authkey=$${TS_AUTHKEY} --accept-dns=true &&
apk add --no-cache socat 2>/dev/null || true &&
socat TCP-LISTEN:18123,fork,reuseaddr TCP:${HA_TAILSCALE_HOST:-100.99.62.5}:${HA_PORT:-8123}"
🤖 Prompt for AI Agents
In backends/advanced/docker-compose.yml around lines 2 to 26 the tailscale
service hardcodes a Tailscale node address (100.99.62.5:8123) and uses the image
tag :latest; change the command to read the target host:port from an environment
variable (e.g., TAILSCALE_TARGET_HOST and TAILSCALE_TARGET_PORT or a single
TAILSCALE_TARGET) instead of the hardcoded IP, update the environment section to
include that variable with a sensible default or document it in .env, and pin
the image to a specific version (replace tailscale/tailscale:latest with a
concrete semver tag) to avoid unexpected upgrades.


chronicle-backend:
build:
context: .
Expand All @@ -12,7 +38,8 @@ services:
- ./data/audio_chunks:/app/audio_chunks
- ./data/debug_dir:/app/debug_dir
- ./data:/app/data
- ../../config/config.yml:/app/config.yml # Removed :ro to allow UI config saving
- ../../config/config.yml:/app/config.yml # Main config file
- ../../config/plugins.yml:/app/plugins.yml # Plugin configuration
environment:
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
- PARAKEET_ASR_URL=${PARAKEET_ASR_URL}
Expand All @@ -26,6 +53,7 @@ services:
- NEO4J_HOST=${NEO4J_HOST}
- NEO4J_USER=${NEO4J_USER}
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
- HA_TOKEN=${HA_TOKEN}
- CORS_ORIGINS=http://localhost:3010,http://localhost:8000,http://192.168.1.153:3010,http://192.168.1.153:8000,https://localhost:3010,https://localhost:8000,https://100.105.225.45,https://localhost
- REDIS_URL=redis://redis:6379/0
depends_on:
Expand All @@ -35,6 +63,8 @@ services:
condition: service_healthy
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway" # Access host's Tailscale network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/readiness"]
interval: 30s
Expand All @@ -61,11 +91,13 @@ services:
- ./data/audio_chunks:/app/audio_chunks
- ./data:/app/data
- ../../config/config.yml:/app/config.yml # Removed :ro for consistency
- ../../config/plugins.yml:/app/plugins.yml # Plugin configuration
environment:
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
- PARAKEET_ASR_URL=${PARAKEET_ASR_URL}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- GROQ_API_KEY=${GROQ_API_KEY}
- HA_TOKEN=${HA_TOKEN}
- REDIS_URL=redis://redis:6379/0
depends_on:
redis:
Expand All @@ -76,6 +108,35 @@ services:
condition: service_started
restart: unless-stopped

# Deepgram WebSocket streaming worker
# Real-time transcription worker that processes audio via Deepgram's WebSocket API
# Publishes interim results to Redis Pub/Sub for client display
# Publishes final results to Redis Streams for storage
# Triggers plugins on final results only
deepgram-streaming-worker:
build:
context: .
dockerfile: Dockerfile
command: >
uv run python -m advanced_omi_backend.workers.audio_stream_deepgram_streaming_worker
env_file:
- .env
volumes:
- ./src:/app/src
- ./data:/app/data
- ../../config/config.yml:/app/config.yml
- ../../config/plugins.yml:/app/plugins.yml
environment:
- DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
- REDIS_URL=redis://redis:6379/0
- HA_TOKEN=${HA_TOKEN}
depends_on:
redis:
condition: service_healthy
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped

webui:
build:
context: ./webui
Expand Down Expand Up @@ -226,3 +287,5 @@ volumes:
driver: local
neo4j_logs:
driver: local
tailscale-state:
driver: local
Loading
Loading