#!/usr/bin/env bash # homeai-agent/setup.sh — P4: OpenClaw agent + skills + mem0 # # Components: # - OpenClaw — AI agent runtime (port 8080) # - skills/ — home_assistant, memory, weather, timer, music stubs # - mem0 — long-term memory (Chroma backend) # - n8n workflows — morning briefing, notification router, memory backup # # Prerequisites: # - P1 (homeai-infra) — Home Assistant running, HA_TOKEN set # - P2 (homeai-llm) — Ollama running with llama3.3:70b + nomic-embed-text # - P3 (homeai-voice) — Wyoming TTS running (for voice output) # - P5 (homeai-character) — aria.json character config exists set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" source "${REPO_DIR}/scripts/common.sh" log_section "P4: Agent (OpenClaw + skills + mem0)" detect_platform # ─── Prerequisite check ──────────────────────────────────────────────────────── log_info "Checking prerequisites..." for service in "http://localhost:11434:Ollama(P2)" "http://localhost:8123:HomeAssistant(P1)"; do url="${service%%:*}"; name="${service##*:}" if ! curl -sf "$url" -o /dev/null 2>/dev/null; then log_warn "$name not reachable at $url" fi done load_env_services if [[ -z "${HA_TOKEN:-}" ]]; then log_warn "HA_TOKEN not set in ~/.env.services — needed for home_assistant skill" fi # ─── TODO: Implementation ────────────────────────────────────────────────────── cat <<'EOF' ┌─────────────────────────────────────────────────────────────────┐ │ P4: homeai-agent — NOT YET IMPLEMENTED │ │ │ │ OPEN QUESTION: Which OpenClaw version/fork to use? │ │ Decide before implementing. See homeai-agent/PLAN.md. │ │ │ │ Implementation steps: │ │ 1. Install OpenClaw (pip install or git clone) │ │ 2. Create ~/.openclaw/config.yaml from config/config.yaml.example │ │ 3. Create skills: home_assistant, memory, weather, timer, music│ │ 4. Install mem0 + Chroma backend │ │ 5. Create systemd/launchd service for OpenClaw (port 8080) │ │ 6. Import n8n workflows from workflows/ │ │ 7. Smoke test: POST /chat "turn on living room lights" │ │ │ │ Interface contracts: │ │ OPENCLAW_URL=http://localhost:8080 │ └─────────────────────────────────────────────────────────────────┘ EOF log_info "P4 is not yet implemented. See homeai-agent/PLAN.md for details." exit 0