diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 8b2d147..7641c13 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -13,12 +13,12 @@ "state": { "type": "markdown", "state": { - "file": "300 areas/350 AI/Ai memory management.md", + "file": "300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md", "mode": "preview", "source": true }, "icon": "lucide-file", - "title": "Ai memory management" + "title": "Home Network Map Overview" } } ] @@ -181,10 +181,10 @@ "state": { "type": "file-properties", "state": { - "file": "300 areas/350 AI/Ai memory management.md" + "file": "300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md" }, "icon": "lucide-info", - "title": "File properties for Ai memory management" + "title": "File properties for Home Network Map Overview" } } ], @@ -207,16 +207,16 @@ "templater-obsidian:Templater": false } }, - "active": "29ff3dd1c6bfd474", + "active": "7066c9273c6fb936", "lastOpenFiles": [ - "300 areas/350 AI/Ai planning flow control tools.md", + "300 areas/350 AI/Pi Agent Extensions & Skills.md", "300 areas/350 AI/Ai memory management.md", + "300 areas/350 AI/Ai planning flow control tools.md", "300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md", "300 areas/360 Dev-Ops Network Computers/Local Wep Apps.md", "300 areas/350 AI/AI Tools to try.md", "300 areas/360 Dev-Ops Network Computers/Pi Neovim Coding Harness.md", "300 areas/360 Dev-Ops Network Computers/Pi MCP.md", - "300 areas/350 AI/Pi Agent Extensions & Skills.md", "000 daily/basketball training.md", "300 areas/350 AI/Automated Agentic Tools.md", "100 inbox/Pi Dashboard.md", diff --git a/300 areas/350 AI/Pi Agent Extensions & Skills.md b/300 areas/350 AI/Pi Agent Extensions & Skills.md index 15fd2c0..5825bfb 100644 --- a/300 areas/350 AI/Pi Agent Extensions & Skills.md +++ b/300 areas/350 AI/Pi Agent Extensions & Skills.md @@ -1,6 +1,6 @@ --- created: 2026-05-16 -modified: 2026-08-02 +modified: 2026-08-03 type: note tags: - ai @@ -109,6 +109,7 @@ pi → omni provider → POST /v1/chat/completions { model: "default-opencode-go | **@tintinweb/pi-tasks** | npm (global) | Task management with dependency tracking, auto-cascade, background process tracking, TaskExecute spawns subagents via RPC | | **gentle-engram** | `~/.agents` | Memory service connecting to engram via ENGRAM_URL. Replaces memory-vault. Session capture, compaction recovery | | **headroom-bridge** | `~/.agents` | `compress_for_agent` tool — compresses >20K chars via Headroom Docker on .13:8787. 60-95% token reduction | +| **pi-langfuse** | npm (project) | Langfuse LLM observability for pi — one trace per conversation, grouped by pi session, with tokens + cost. See [[#pi-langfuse — LLM Observability for Pi]] | ### pi-subagents (@tintinweb) @@ -391,6 +392,47 @@ ssh 192.168.20.13 "cd /home/sam/Docker/Containers/headroom && docker compose pul | `/home/sam/Docker/Containers/headroom/.env` | Environment file (on .13) | +## pi-langfuse — LLM Observability for Pi + +Sends pi's LLM traffic to Langfuse (self-hosted on .13:3001) for tracing, token usage, and cost-per-session. One trace per user prompt, grouped by pi session. + +| Aspect | Detail | +|--------|--------| +| **What it is** | pi extension (npm package `pi-langfuse` v1.5.8, by gooyoung) that captures pi runs — agent steps, LLM generations, tool calls, final output, usage, cost — into Langfuse | +| **Where it runs** | Per-project — enabled by adding `npm:pi-langfuse` to `/.pi/settings.json` `packages`. Keys read globally from `~/.pi/agent/pi-langfuse/config.json` | +| **Config file** | `~/.pi/agent/pi-langfuse/config.json` (mode 600): `{ "publicKey": "pk-lf-…", "secretKey": "sk-lf-…", "host": "http://192.168.20.13:3001" }` | +| **Env var fallback** | `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, `LANGFUSE_BASE_URL` (used only when config.json is missing/incomplete) | +| **Commands** | `/langfuse-setup` (interactive key entry), `/langfuse-status` (show config state, masked keys, capture policy) | +| **Requirements** | Node ≥ 22 (machines run 24); peer dep `@earendil-works/pi-coding-agent: *` | +| **What you get** | Root `agent`, per-request `generation`, and per-tool `tool` observations; token usage + cost; privacy controls (input/output/tool redaction, path hashing, secret redaction) | +| **Dashboard** | `http://192.168.20.13:3001` | + +### Install (per project) + +Add to the project's `.pi/settings.json`: + +```json +{ + "packages": ["npm:pi-langfuse"] +} +``` + +Restart pi — it installs the extension into `.pi/npm/` and picks up the config automatically. + +### Global install (all projects / machines) + +The global `~/.pi/agent/settings.json` is a Nix-store symlink (read-only). To enable everywhere, add `npm:pi-langfuse` to the `packages` list in `/etc/nixos/home/sam/home.nix` and rebuild Home Manager. + +### Why not the OmniRoute langfuse plugin? + +OmniRoute's example langfuse plugin is **broken against the 3.8.48 runtime** (verified in source, 2026-08-03): +- Plugin config is stored in SQLite but **never delivered to hook payloads** — `PluginContext` has no `config` field +- `onRequest` metadata is **not threaded** to `onResponse` (each hook gets a fresh `metadata: {}`) +- **Streaming requests** (what pi uses) receive `response: { status: 200, streamed: true }` — no response body to trace + +pi-langfuse traces at the pi layer instead, which works for streaming and gives per-session grouping. The plugin files were removed from .13 (compose restored, container recreated clean). + + ## codebase-memory-mcp Code intelligence MCP server by DeusData. Single static C binary (~13MB), zero dependencies, 158 languages. Indexes a codebase into a persistent knowledge graph — average repo in milliseconds. 15 MCP tools for structural queries. Runs locally, code never leaves your machine. @@ -686,6 +728,8 @@ Path: `~/.pi/agent/subagents.json`. Configuration for pi-subagents agent types, | `get_subagent_result()` | Retrieve results from background agent | | `steer_subagent()` | Send mid-run steering message | | `compress_for_agent()` | Compress large content via Headroom | +| `/langfuse-setup` | Set Langfuse keys interactively (pi-langfuse) | +| `/langfuse-status` | Show pi-langfuse config state (masked keys, host, capture policy) | ## Agent Roster (18) @@ -749,5 +793,6 @@ compress_for_agent({ content }) - [x] Update Pi Subagent.md and Pi Agent Extensions & Skills.md documentation ✅ 2026-06-14 - [x] Update pi-subagents to v0.10.3 ✅ 2026-06-14 - [x] Update pi-tasks to v0.7.0 ✅ 2026-06-13 +- [x] Install pi-langfuse tracing extension (pi → Langfuse on .13:3001) ✅ 2026-08-03 - [ ] Verify video-extract works with Gemini - [ ] Clean up workspace-map.json entries for any stale memory packs diff --git a/300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md b/300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md index 1879437..7b90fcb 100644 --- a/300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md +++ b/300 areas/360 Dev-Ops Network Computers/Home Network Map Overview.md @@ -1,6 +1,6 @@ --- created: 2026-07-30 -modified: 2026-08-02 +modified: 2026-08-03 type: note tags: - network @@ -32,7 +32,7 @@ aliases: [] | **SSH** | ✅ `sam@192.168.20.27` | | **Tailscale** | ✅ `100.65.228.31` (sam-4screen-desktop-1) | | **Role** | Daily driver. 4 monitors, 62GB RAM, Nvidia GPU. Zellij, Neovim, pi coding agent. | -| **Key services** | pi, pi-dashboard, Neovim, Zellij (with falcode + attention plugins), Home Manager managed +| **Key services** | pi (with pi-langfuse → traces to Langfuse .13:3001), pi-dashboard, Neovim, Zellij (with falcode + attention plugins), Home Manager managed | **MCP tools** | `codebase-memory-mcp` v0.9.0, `code-review-graph` v2.3.7 (per-project, installed via `uv tool install`) | **Tunnels** | `ssh -fNL 7437:127.0.0.1:7437 192.168.20.13` (engram — must re-establish after reboot) | @@ -60,7 +60,7 @@ aliases: [] | Docker containers | | |---|---| | **OmniRoute** | LLM proxy with combo routing (port 20128/20129). All pi LLM traffic routes through it. Combo `default-opencode-go-ds-flash` prioritises OpenCode-Go before falling through OpenRouter → DeepSeek direct → Google Gemini. See [[Pi Agent Extensions & Skills#OmniRoute — LLM Provider Router]] | -| **Langfuse** | LLM observability — traces, evals, cost tracking (port `:3001`, bumped from 3000 by Open WebUI) | +| **Langfuse** | LLM observability — receives pi traces via the **pi-langfuse** extension (port `:3001`, bumped from 3000 by Open WebUI) | | **worldmonitor** | Geopolitical news dashboard (port 3002) | | **mosquitto** | MQTT broker | | **pihole** | DNS ad-blocking (primary) | @@ -72,6 +72,8 @@ aliases: [] | **piper_tts** | Text-to-speech | | **Plus:** pocketbase, doorbell_media, litellm, langfuse, airflow, trigger_dev, garage, t3_stack_react, sams-home-network | | +**AI observability flow:** pi (on .27/.13/.51) → **pi-langfuse** pi extension (npm:pi-langfuse, enabled per project) → Langfuse (`.13:3001`). One trace per pi conversation, grouped by session, with tokens + cost. Keys: `~/.pi/agent/pi-langfuse/config.json`. See [[Pi Agent Extensions & Skills#pi-langfuse — LLM Observability for Pi]] + See [[Docker Containers]] for full container list. ### .51 — sam-thinkpad (Laptop)