Go to file
boban f0a1ab0911 Fox: /fox/message returns audio_url
Route now waits synchronously for FoxAgent response and returns reply + audio_url.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 22:58:09 +02:00
app Fox: /fox/message returns audio_url 2026-05-11 22:58:09 +02:00
bootstrap Fox initial commit 2026-05-11 20:36:07 +02:00
config Fox initial commit 2026-05-11 20:36:07 +02:00
database Fox initial commit 2026-05-11 20:36:07 +02:00
docker Fox initial commit 2026-05-11 20:36:07 +02:00
public Fox initial commit 2026-05-11 20:36:07 +02:00
resources Fox: /fox/message returns audio_url 2026-05-11 22:58:09 +02:00
routes Fox: /fox/message returns audio_url 2026-05-11 22:58:09 +02:00
searxng Fox initial commit 2026-05-11 20:36:07 +02:00
storage Fox initial commit 2026-05-11 20:36:07 +02:00
.env.example Fox initial commit 2026-05-11 20:36:07 +02:00
.gitignore Fox initial commit 2026-05-11 20:36:07 +02:00
Makefile Fox initial commit 2026-05-11 20:36:07 +02:00
README.md Fox initial commit 2026-05-11 20:36:07 +02:00
artisan Fox initial commit 2026-05-11 20:36:07 +02:00
composer.json Fox initial commit 2026-05-11 20:36:07 +02:00
composer.lock Fox initial commit 2026-05-11 20:36:07 +02:00
docker-compose.yml Fox initial commit 2026-05-11 20:36:07 +02:00
package-lock.json Fox initial commit 2026-05-11 20:36:07 +02:00
package.json Fox initial commit 2026-05-11 20:36:07 +02:00
vite.config.js Fox initial commit 2026-05-11 20:36:07 +02:00

README.md

Fox

Proaktiver KI-Assistent. Laravel 12 · Livewire 3 (class-based) · Tailwind v4 · Reverb · Postgres + pgvector · Redis · Ollama (llama3.1:8b) · whisper.cpp · piper.

Quickstart (Debian 13, nur Docker installiert)

git clone <repo> fox && cd fox
docker compose up -d
make install

Fox ist dann erreichbar unter http://10.10.90.175.

make install baut die Images, fährt Postgres/Redis/Ollama hoch, installiert Composer- und npm-Pakete, generiert den App-Key, führt die Migrations aus, pullt das Ollama-Modell und das whisper.cpp ggml Modell und baut die Frontend-Assets.

Architektur

docker-compose.yml ─┬─ app (PHP-FPM 8.3)
                    ├─ nginx
                    ├─ postgres (pgvector/pg16)
                    ├─ redis
                    ├─ ollama (llama3.1:8b + nomic-embed-text)
                    ├─ queue worker
                    ├─ scheduler
                    ├─ reverb (WebSockets, Port 8080)
                    ├─ whisper (whisper.cpp Sidecar)
                    └─ searxng (Meta-Suchmaschine)

Code-Struktur

Pfad Was
app/Services/FoxAgent.php Agent-Loop: think → plan → act → reflect
app/Services/SpeechService.php whisper.cpp + piper Bridge
app/Services/MemoryService.php pgvector Embeddings via Ollama
app/Tools/WebSearchTool.php SearXNG (lokale Meta-Suche)
app/Tools/BuildTemplateTool.php HTML-Page erzeugen + Broadcast
app/Tools/FileManagerTool.php Sandbox-Filesystem
app/Jobs/FoxProactiveJob.php Alle 5 Min: LLM entscheidet, ob Fox spricht
app/Events/FoxMessage.php Broadcast → Livewire
app/Livewire/Chat.php Haupt-Chat (PTT, Feed)
app/Livewire/Goals.php Ziele
app/Livewire/Modals/NewGoal.php Modal für neues Ziel

Routen liegen in routes/web.php und zeigen direkt auf Livewire-Klassen — Ausnahme: POST /fox/voice für Audio-Upload (FoxVoiceController).

Tailwind v4

Farben kommen aus resources/css/app.css via @themekeine tailwind.config.js. Nutzbar als bg-primary, bg-surface, bg-glass

Livewire 3

config/livewire.php ist auf class-based Layout gestellt (class_namespace = App\Livewire, view_path = resources/views/livewire). Klassen und Blades sind getrennt.

Make-Targets

make install         First-time Setup
make up | down       Container starten / stoppen
make shell           Shell im app-Container
make logs            Container-Logs folgen
make migrate         DB-Migrations
make fresh           DB komplett zurücksetzen
make tinker          Tinker REPL
make ollama-pull     Ollama-Modell pullen
make whisper-model   whisper.cpp ggml-Modell laden
make npm-build       Frontend-Assets bauen

Proaktive Engine

bootstrap/app.php registriert den Scheduler: alle FOX_PROACTIVE_INTERVAL_MINUTES (Default 5) wird FoxProactiveJob queued. Der Job ruft FoxAgent::shouldISpeak(), das via Prism-Structured-Output ein ProactiveDecision { shouldSpeak, message, priority } zurückbekommt und bei Bedarf eine proaktive Nachricht broadcastet.

Voice

Push-to-Talk via Strg+Leertaste oder gedrückt halten des Mikro-Buttons. Audio wird per multipart/form-data an /fox/voice geschickt → ffmpeg konvertiert nach 16kHz wav → whisper.cpp transkribiert → FoxAgent antwortet → piper synthetisiert die Antwort → Browser spielt den .wav-Stream automatisch ab.

ENV-Variablen

Siehe .env.example. Wichtig:

  • OLLAMA_MODEL=llama3.1:8b
  • OLLAMA_EMBEDDING_MODEL=nomic-embed-text (768-dim Vector — passt zur Migration)
  • SEARXNG_URL=http://searxng:8080 (Default — Service läuft im selben Netz)
  • REVERB_* für WebSockets (Default-Werte funktionieren lokal)