Files
jr-sql-ai/README.md

52 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# jr-sql-ai (Terminal-first SQL Server 2022 Expert KI, lokal)
Lokale Expert-KI für **SQL Server 2022** (T-SQL, Views, Stored Procedures, Execution Plans, UTF-8 Migration),
aufrufbar **vom Terminal**, ohne direkte DB-Verbindung (nur Copy & Paste / Dateien).
Die KI läuft lokal via **Ollama** in Docker und wird über ein kleines CLI (`sqlai`) genutzt.
---
## Features
- **Schmaler Tech-Stack:** Docker + Ollama + Bash + curl + python
- **Terminal-first:** `sqlai ask ...` / `sqlai analyze-tsql ...` etc.
- **Ohne DB-Verbindung:** nur Analyse/Planung/Empfehlung anhand von Input
- **Auto-Updates:** Runtime + Models via `scripts/update.sh` und optional `systemd --user` Timer
- **Warmup:** nach Updates (und optional nach Bootstrap) wird ein kurzer Request gesendet (schneller “First Real Query”)
- **Selftest:** `scripts/selftest.sh` prüft End-to-End (Docker, API, Models, echte Anfrage)
- **Resilient:** Model-Fallback (wenn Expert-Model fehlt → Base-Model)
- **Viele Logs:** jedes Script schreibt nachvollziehbare Logs nach `./logs/`
---
## Voraussetzungen (Arch Linux)
- `docker` + `docker compose`
- `curl`
- `python`
- optional (für GPU): NVIDIA Container Toolkit + Compose GPU-Konfiguration
---
## Repository Struktur (Kurzüberblick)
- `bin/sqlai` CLI (ask + Analyse-Modi) inkl. Logging & Model-Fallback
- `scripts/bootstrap.sh` startet Container, pullt Modelle, baut Expert-Model, Warmup
- `scripts/update.sh` pullt Runtime+Modelle, rebuild Expert-Model, Warmup
- `scripts/selftest.sh` End-to-End Check inkl. echter Anfrage
- `docker-compose.yml` Ollama Service (Host networking, optional GPU)
- `Modelfile` Expert-Systemprompt (SQL Server 2022 Fokus)
- `prompts/` Prompt-Library (Copy & Paste Templates)
- `systemd/user/` optionaler Daily Update Timer (User Service)
---
# 1) Installation / Build (Bootstrap)
## 1.1 Repo auspacken / klonen
Wenn du ein tar.gz erhalten hast:
```bash
tar -xzf jr-sql-ai.tar.gz
cd jr-sql-ai