From 530d77ff1bde8d986ebe16b18cdf75bbdf0bd324 Mon Sep 17 00:00:00 2001 From: Hitonabi Date: Sat, 27 Jun 2026 00:21:55 +0200 Subject: [PATCH] Docs: Session-Memory nach docs/memory/ hinzugefuegt (Stand 2026-06-27) Aktueller Projektstand fuer naechste Sessions: - project-stack-state.md: IPs, Ports, Dienste, Modell-Lineup - project-hermes-setup.md: MCP-Server, PC-Executor, Telegram, Brain - project-mc2-architecture.md: Schichten, Key-Files, Gotchas, API-Felder - project-pending-tasks.md: offene Tasks (WebUI, Update-Checks, etc.) Co-Authored-By: Claude Sonnet 4.6 --- docs/memory/project-hermes-setup.md | 71 ++++++++++++++++++++++++ docs/memory/project-mc2-architecture.md | 74 +++++++++++++++++++++++++ docs/memory/project-pending-tasks.md | 48 ++++++++++++++++ docs/memory/project-stack-state.md | 55 ++++++++++++++++++ 4 files changed, 248 insertions(+) create mode 100644 docs/memory/project-hermes-setup.md create mode 100644 docs/memory/project-mc2-architecture.md create mode 100644 docs/memory/project-pending-tasks.md create mode 100644 docs/memory/project-stack-state.md diff --git a/docs/memory/project-hermes-setup.md b/docs/memory/project-hermes-setup.md new file mode 100644 index 0000000..42dff4e --- /dev/null +++ b/docs/memory/project-hermes-setup.md @@ -0,0 +1,71 @@ +--- +name: project-hermes-setup +description: "Hermes Agent — vollständige Verdrahtung, MCP-Server, Telegram, PC-Executor (Stand 2026-06-27)" +metadata: + node_type: memory + type: project + originSessionId: e6bf38ac-b5dc-4aaa-80c3-ad8dd078a1fe +--- + +## Hermes-Version & Ort +- **Version:** v0.17.0 (2026-06-19), NousResearch/hermes-agent +- **Repo:** `https://github.com/NousResearch/hermes-agent.git` +- **Install-Pfad Box:** `~/.hermes/hermes-agent/` +- **Venv:** `~/.hermes/hermes-agent/venv/bin/python` +- **Config:** `~/.hermes/config.yaml` + +--- + +## Hermes-Hirn +- **Brain:** `model.model: hermes` → Hermes-4-14B (immer warm, TTL=0) +- **Delegation:** `heavy` für harte Teilaufgaben (Qwen3.5-122B) +- **NICHT model:auto** — das ist nur für IDE/Vibe-Coding + +--- + +## MCP-Server (in ~/.hermes/config.yaml) +| Name | Script | Zweck | +|---|---|---| +| `mission-control-memory` | `mcp/mcp_memory.py` | Geteiltes Gedächtnis (SQLite) | +| `mission-control-stack` | `mcp/mcp_mc.py` | MC2 Stack-Management | +| `hermes-pc-control` | `mcp/mcp_pc.py` | PC-Steuerung via executor.py | +| `hermes-web-fetch` | `mcp/mcp_web.py` | Web-Fetch via trafilatura | + +Alle MCP-Skripte liegen in `~/mission-control-v2/mcp/` auf der Box. +`mcp_pc.py` und `mcp_web.py` laufen mit Hermes-Venv (nicht MC2-Venv → Python 3.11 Kompatibilität). + +**PC_EXECUTOR_URL:** `http://192.168.178.98:7777` (als Env-Var in hermes config) + +--- + +## PC Executor (Windows PC) +- **Datei:** `client/hermes-pc/executor.py` (FastAPI, Port 7777) +- **Starten:** `client\hermes-pc\start.bat` auf dem Windows-PC (manuell, kein Autostart) +- **Health:** `GET http://192.168.178.98:7777/health` +- **Endpoints:** `/shell`, `/screenshot`, `/type`, `/key`, `/open`, `/search` +- **Autostart noch nicht eingerichtet** → per start.bat starten wenn Hermes PC-Zugriff braucht + +--- + +## Telegram-Integration +- **Bot-Token:** in `~/.hermes/.env` (`TELEGRAM_BOT_TOKEN`) +- **Erlaubte User-ID:** 6150562984 +- **Platform-Toolsets:** telegram hat alle Tools (terminal, file, web, code_execution, delegation, todo, skills, session_search, hermes-telegram) +- Slash-Befehle der CLI funktionieren auch im Telegram-Bot + +--- + +## Abgeschaltete Tools (Thrash-Prevention) +`agent.disabled_toolsets: [browser, vision, computer_use, image_gen, tts, video, video_gen, memory]` +`tool_loop_guardrails.hard_stop_enabled: true` + +**Why:** Browser-Tool ohne Chrome → Endlos-Loop; Cloud-Tools nicht vorhanden → Loop. +Native memory deaktiviert (`memory.memory_enabled: false`); geteiltes Gedächtnis läuft via MCP. + +--- + +## Web-Suche +- `web.search_backend: ddgs` (DuckDuckGo, kein API-Key) +- `web.extract_backend: ddgs` — aber ddgs kann NICHT extrahieren! +- **Echte Extraktion:** über `hermes-web-fetch` MCP-Server (trafilatura, kein API-Key) +- trafilatura installiert in Hermes-Venv: `pip install trafilatura` diff --git a/docs/memory/project-mc2-architecture.md b/docs/memory/project-mc2-architecture.md new file mode 100644 index 0000000..a67f072 --- /dev/null +++ b/docs/memory/project-mc2-architecture.md @@ -0,0 +1,74 @@ +--- +name: project-mc2-architecture +description: "MC2 Architektur — Schichten, Key-Files, API-Endpunkte, wichtige Eigenheiten" +metadata: + node_type: memory + type: project + originSessionId: e6bf38ac-b5dc-4aaa-80c3-ad8dd078a1fe +--- + +## Stack-Schichten +``` +Windows PC (192.168.178.98) + └─ executor.py :7777 ← PC-Steuerung (FastAPI, manuell via start.bat) + +AI Box (192.168.178.151) — Ryzen AI MAX+ 395, 122GB unified RAM + ├─ llama-swap :8080 ← Engine (ROCm/HIP, lemonade-sdk/llamacpp-rocm) + ├─ mission-control-2 :9001 ← MC2 (FastAPI + React, user-service) + │ └─ /v1 ← Builtin Gateway (model:auto, OpenAI-kompatibel) + ├─ hermes-gateway :8642 ← Hermes Agent (NousResearch, user-service) + │ ├─ mcp_pc.py ← MCP → executor.py auf Windows PC + │ ├─ mcp_web.py ← MCP → trafilatura Web-Fetch + │ ├─ mcp_memory.py ← MCP → SQLite Gedächtnis + │ └─ mcp_mc.py ← MCP → MC2 Stack-Management + └─ hermes-webui :8787 ← nesquena hermes-webui (user-service) + +Proxmox (192.168.178.108) ← LXCs: adguard(100) npmplus(101) netbird(102) gitea(104) +``` + +--- + +## MC2 Key-Files +| Datei | Zweck | +|---|---| +| `backend/app.py` | FastAPI Einstieg, Router-Mounting | +| `backend/config.py` | Alle Env-Vars (LLAMA_SWAP_URL, HERMES_*, PC_EXECUTOR_URL, etc.) | +| `backend/services/agent.py` | `/api/agent/status` (gateway/webui/telegram/mcp/pc) | +| `backend/services/llamaswap.py` | llama-swap API, ROLE_IDS, Modell-CRUD | +| `backend/services/maintenance.py` | Updates, Logs, Restart, ROLE_MAP | +| `backend/services/sources.py` | CATEGORIES für Discover (roles: vision/coder/agent/scout) | +| `backend/gateway/gateway_proxy.py` | Builtin OpenAI-Gateway, model:auto Routing | +| `frontend/src/lib/api.ts` | TypeScript-Interfaces für alle API-Responses | +| `frontend/src/lib/queries.ts` | React-Query Hooks (useModels, useAgentStatus, etc.) | +| `mcp/mcp_pc.py` | PC-Control MCP-Server | +| `mcp/mcp_web.py` | Web-Fetch MCP-Server (trafilatura) | +| `mcp/mcp_memory.py` | Shared Memory MCP-Server | + +--- + +## Wichtige Eigenheiten / Gotchas +- **Python 3.14 auf Box** → LiteLLM unmöglich (uvloop scheitert). MC2 hat eigenen Gateway. +- **mcp_pc.py / mcp_web.py müssen Hermes-Venv nutzen** (nicht MC2-Venv). Python 3.11 vs 3.14 TaskGroup-Kompatibilität. +- **Builtin-Gateway Port:** MC2 läuft auf `:9001`, der `/v1`-Endpunkt ist Teil von MC2 (nicht separater Dienst). +- **MC_PORT vs tatsächlicher Port:** In Env ist `MC_PORT=9000`, aber der User-Service hört auf `:9001` (Port in Unit-Definition). Beim SSH-Deploy immer `:9001` verwenden. +- **llama-swap Config braucht sudo** zum Schreiben (`/etc/llama-swap/config.yaml`), aber `hitonabi` ist in `adm`-Gruppe → journalctl ohne sudo lesbar. +- **ROLE_IDS** in llamaswap.py = `{"vision", "coder", "agent", "scout"}` (reasoning entfernt 2026-06-27). +- **Discover-CATEGORIES** in sources.py: vision / coder / agent / scout (kein reasoning mehr). +- **API_SERVER_KEY:** in `~/.hermes/.env` auf der Box + +--- + +## /api/agent/status Felder (Stand 2026-06-27) +```python +{ + "gateway_reachable": bool, # Hermes :8642 + "webui_reachable": bool, # hermes-webui :8787 + "brain_model": str, # aus ~/.hermes/config.yaml + "has_config": bool, + "has_skills": bool, + "has_memories": bool, + "telegram_enabled": bool, # TELEGRAM_BOT_TOKEN gesetzt? + "mcp_server_count": int, # enabled MCP-Server in config.yaml + "pc_executor_reachable": bool # 192.168.178.98:7777/health +} +``` diff --git a/docs/memory/project-pending-tasks.md b/docs/memory/project-pending-tasks.md new file mode 100644 index 0000000..a76cd5c --- /dev/null +++ b/docs/memory/project-pending-tasks.md @@ -0,0 +1,48 @@ +--- +name: project-pending-tasks +description: Offene Tasks und bekannte Baustellen im MC2-Projekt (Stand 2026-06-27) +metadata: + node_type: memory + type: project + originSessionId: e6bf38ac-b5dc-4aaa-80c3-ad8dd078a1fe +--- + +## Offen / Pending + +### WebUI-Ersatz (LobeChat oder Alternative) +- hermes-webui (nesquena) läuft aktuell auf `:8787` +- Plan war: LobeChat als Docker-Container auf Proxmox LXC 105 +- Deploy-Artefakte liegen in `deploy/lobechat/` (docker-compose.yml, .env.example) +- **Noch nicht deployed** — LXC existiert noch nicht +- User erwähnte "AnywhereLLM" — unklar ob er AnythingLLM meint oder LobeChat; klären + +### Update-Checks in "Updates & Pflege" +- **Hermes Agent Updates:** Hermes v0.17.0 aus NousResearch/hermes-agent (GitHub) + - GitHub API: `https://api.github.com/repos/NousResearch/hermes-agent/releases/latest` + - Installierte Version via `hermes --version` ermitteln + - Noch nicht implementiert in `backend/services/maintenance.py` +- **WebUI Updates:** abhängig von welchem WebUI (LobeChat/hermes-webui/AnythingLLM) + - Noch nicht implementiert + +### PC Executor Windows Autostart +- `executor.py` läuft aktuell nur wenn `start.bat` manuell gestartet wird +- Kein Windows Startup-Task eingerichtet + +### Docs/README veraltet +- `README.md`, `docs/STATUS.md`, `docs/CUTOVER.md`, `docs/HERMES_SETUP.md` beschreiben + noch den Zustand vor Hermes-Unchaining, PC-Executor, MCP-Servern, Reasoning-Entfernung +- Sollten in einer Session aktualisiert werden + +--- + +## Erledigte größere Meilensteine (diese + letzte Session) +- ✅ Hermes unchained: Telegram + alle Tools + MCP-Server + PC-Steuerung +- ✅ mcp_pc.py + executor.py (PC-Zugriff via MCP) +- ✅ mcp_web.py (trafilatura Web-Extraktion) +- ✅ Reasoning-Modell entfernt (Nemotron, 25 GB freigegeben) +- ✅ UI-Audit: AgentStatusCard 2x2 + Telegram/MCP/PC-Status +- ✅ UI-Audit: PC-Executor-Karte (ersetzt SSH-Bypass-Karte) +- ✅ UI-Audit: incomplete-Badge + Load-Button disabled +- ✅ UI-Audit: TokenStatsCard "Juni 2026" entfernt +- ✅ LobeChat Deploy-Artefakte committed (deploy/lobechat/) +- ✅ Alter hermes-agent Daemon-Code entfernt (war obsolet) diff --git a/docs/memory/project-stack-state.md b/docs/memory/project-stack-state.md new file mode 100644 index 0000000..ece04e0 --- /dev/null +++ b/docs/memory/project-stack-state.md @@ -0,0 +1,55 @@ +--- +name: project-stack-state +description: "Aktueller Stand des MC2-Projekts — Infrastruktur, Modelle, Dienste, Git-State (Stand 2026-06-27)" +metadata: + node_type: memory + type: project + originSessionId: e6bf38ac-b5dc-4aaa-80c3-ad8dd078a1fe +--- + +## Wo alles liegt +- **Code lokal:** `F:\Coding Stuff\mission-control-2` (Windows-Dev-PC) +- **Git-Remote:** `https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2` (Branch `main`) +- **AI Box:** `hitonabi@192.168.178.151` — MC2 live auf `:9001` als User-Dienst +- **Deploy:** `ssh hitonabi@192.168.178.151 "bash ~/mission-control-v2/deploy/deploy.sh"` +- **Windows PC:** `192.168.178.98` (Tobis PC) +- **Proxmox:** `root@192.168.178.108:8006` (Passwort in Keepass) + +**Why:** Ist die einzige Quelle der Wahrheit für Verbindungsdaten. +**How to apply:** Vor SSH/Deploy immer diese IPs nutzen, nicht raten. + +--- + +## Dienste auf der AI Box (Stand 2026-06-27) +| Dienst | Port | Beschreibung | +|---|---|---| +| `llama-swap` (system) | `:8080` | Engine, ROCm/HIP | +| `mission-control-2` (user) | `:9001` | MC2 Backend + Frontend | +| `hermes-gateway` (user) | `:8642` | Hermes Agent API | +| `hermes-webui` (user) | `:8787` | nesquena hermes-webui | + +MC2-Gateway auf `:9001/v1` ist der OpenAI-kompatible Endpunkt für IDEs (model:auto). + +--- + +## Modell-Stack (llama-swap, Stand 2026-06-27) +| Alias | Modell | TTL | Besonderheit | +|---|---|---|---| +| `hermes` | Hermes-4-14B (Q6_K) | 0 (immer warm) | Agent-Hirn, in brains-Gruppe | +| `fast` | Qwen3.6-35B-A3B (Q4_K_M) | 0 (immer warm) | MoE, Vision, SPEC-Draft, 2 Slots; in brains-Gruppe | +| `vision` | Qwen3-VL-2B-Instruct (Q4_K_M) | 0 (immer warm) | Tiny Vision; in brains-Gruppe | +| `heavy` | Qwen3.5-122B-A10B (Q4_K_M) | 600s | MoE, 32k ctx | +| `coder` | Qwen3-Coder-Next (Q4_K_M) | 600s | SPEC-Draft, 2 Slots | +| `scout` | gemma-4-26B-A4B-it (Q4_K_M) | 180s | Multimodal | + +`reasoning`-Rolle wurde entfernt (Nemotron gelöscht, 25 GB freigegeben, 2026-06-27). +brains-Gruppe hat `swap:false, persist:true` → hermes/fast/vision bleiben immer resident. + +**Config-Pfad auf Box:** `/etc/llama-swap/config.yaml` + +--- + +## Git-Stand +- Lokal, Gitea und AI Box alle synchron auf `main` +- Working tree clean (Stand nach letztem Push) +- Push nur via **PowerShell-Tool** mit `dangerouslyDisableSandbox:true` (kein Bash-Push → GCM-Auth-Problem)