where is the db?


Which DB?

Likely one of these:

- `agents-database` service: `http://100.116.176.16:8091`
- status endpoint: `http://100.116.176.16:8091/api/status`

If you mean the actual on-disk file/path, say that and I’ll locate it.


what is ACP and RPC? how do they compare? how do they relate to pi agent?


**Exploring Agent Client Protocol**

Okay, I’m thinking that ACP might stand for Agent Client Protocol. I wonder if I need to figure out what a "pi agent" is—maybe it refers to personal agents? Using memory could help here, or I could search for more details. I could draw from general knowledge, but accuracy is key! I should probably inspect the repository for any references to ACP or RPC to clarify further.

bash

cd /home/sebas && rg -n "\bACP\b|\bRPC\b|Agent Client Protocol|Remote Procedure Call|pi agent|personal-agent" /mnt/rpi/pi-config /home/sebas 2>/dev/null | head -n 200


/home/sebas/bug-bounty/briefings/SCAN_HackerOne_TRON_java-tron_2026-02-15.md:24:- RPC/GRPC exposure and any unsafe deserialization/parsing
/home/sebas/bug-bounty/briefings/SCAN_HackerOne_Chia_chia-blockchain_2026-02-15.md:21:Nothing immediately bounty-grade from automated scans; likely needs manual review of RPC/network surfaces and wallet/key handling if we keep hunting here.
/home/sebas/bug-bounty/briefings/SCAN_HackerOne_Cosmos_gaia_2026-02-15.md:22:- Any RPC or REST surfaces exposed by the node, and input parsing around them
/home/sebas/logs/ballbox-services.log:6:[2026-04-16 16:33:10] CHECK: personal-agent OK
/home/sebas/logs/ballbox-services.log:12:[2026-04-16 16:33:23] CHECK: personal-agent OK
/home/sebas/logs/ballbox-services.log:18:[2026-04-16 16:33:30] CHECK: personal-agent OK
/home/sebas/scripts/ballbox-services.sh:25:    log "Restarting personal-agent..."
/home/sebas/scripts/ballbox-services.sh:26:    systemctl --user restart personal-agent.service
/home/sebas/scripts/ballbox-services.sh:28:    if systemctl --user is-active --quiet personal-agent.service; then
/home/sebas/scripts/ballbox-services.sh:29:        log "personal-agent OK"
/home/sebas/scripts/ballbox-services.sh:32:        log "personal-agent FAILED"
/home/sebas/scripts/ballbox-services.sh:61:    if systemctl --user is-active --quiet personal-agent.service; then
/home/sebas/scripts/ballbox-services.sh:62:        log "CHECK: personal-agent OK"
/home/sebas/scripts/ballbox-services.sh:64:        log "CHECK: personal-agent fail"
/home/sebas/scripts/ballbox-services.sh:81:        restart_personal_agent || log "WARN: personal-agent did not start cleanly"
/home/sebas/scripts/ballbox-services.sh:92:        echo "personal-agent: $(systemctl --user is-active personal-agent.service 2>/dev/null || echo 'unknown')"
/mnt/rpi/pi-config/SYSTEM.md:59:`personal-agent` status: `http://100.116.176.16:8082/api/status`
/home/sebas/ops-notes/sd-transplant-prep-2026-04-17.txt:12:- personal-agent daemon wrapper: PID 65013
/home/sebas/ops-notes/sd-transplant-prep-2026-04-17.txt:20:3. Check personal-agent:
/home/sebas/ops-notes/sd-transplant-prep-2026-04-17.txt:52:[2026-04-16T22:38:17-03:00] Restore: mounted /dev/sda1 on /mnt/rpi; enabled+started opencode-web.service; started personal-agent.service; relaunched eiffel-monitor manually
/home/sebas/ops-notes/sd-transplant-prep-2026-04-17.txt:54:[2026-04-16T22:38:34-03:00] Restore verification: /mnt/rpi mounted; opencode-web active; personal-agent active; eiffel-monitor running (with Playwright browser error logged)
/home/sebas/ops-notes/sd-transplant-runbook-2026-04-17.md:190:- `personal-agent`
/home/sebas/SERVICES-ARCHITECTURE.md:12:| `http://100.116.176.16:8082/api/status` | `:8082` (personal-agent daemon) | Personal Agent API directa por Tailscale IP |
/home/sebas/SERVICES-ARCHITECTURE.md:19:| `:8082` | personal-agent daemon | API del personal agent |
/home/sebas/SERVICES-ARCHITECTURE.md:45:- `https://ballbox-first.emperor-ratio.ts.net/api/` no está hoy ruteado al `personal-agent`; responde la homepage de nginx.
/home/sebas/SERVICES-ARCHITECTURE.md:70:ssh ballbox-first 'systemctl --user status personal-agent.service --no-pager'
/home/sebas/SERVICES-ARCHITECTURE.md:76:ssh ballbox-first 'journalctl --user -u personal-agent.service -f'
/home/sebas/SERVICES-ARCHITECTURE.md:104:- `personal-agent.service` (puerto 8082)
/home/sebas/pihole-unbound-tailscale-blueprint.md:17:- `http://100.116.176.16:8082/api/status` responde; el personal-agent esta vivo.
/home/sebas/venvs/catt/lib/python3.13/site-packages/google/protobuf/service_reflection.py:151:      rpc_controller: RPC controller to use for this method's execution.
/home/sebas/venvs/catt/lib/python3.13/site-packages/google/protobuf/service_reflection.py:211:      rpc_controller: RPC controller used to execute this method.
/home/sebas/venvs/catt/lib/python3.13/site-packages/pip/_vendor/distlib/util.py:1541:# XML-RPC with timeouts
/home/sebas/venvs/catt/lib/python3.13/site-packages/pip/_vendor/distlib/locators.py:405:    This locator uses XML-RPC to locate distributions. It therefore
/home/sebas/venvs/catt/lib/python3.13/site-packages/pip/_vendor/distlib/locators.py:413:        :param url: The URL to use for XML-RPC.
/home/sebas/telegram-bot-listener-backup-20260118/venv/lib/python3.13/site-packages/pip/_vendor/distlib/util.py:1541:# XML-RPC with timeouts
/home/sebas/telegram-bot-listener-backup-20260118/venv/lib/python3.13/site-packages/pip/_vendor/distlib/locators.py:405:    This locator uses XML-RPC to locate distributions. It therefore
/home/sebas/telegram-bot-listener-backup-20260118/venv/lib/python3.13/site-packages/pip/_vendor/distlib/locators.py:413:        :param url: The URL to use for XML-RPC.
/home/sebas/venvs/catt/lib/python3.13/site-packages/yt_dlp/downloader/external.py:368:        assert resp.get('id') == sanitycheck, 'Something went wrong with RPC server'
/home/sebas/venvs/catt/lib/python3.13/site-packages/yt_dlp/downloader/external.py:395:            # Add a small sleep so that RPC client can receive response,


# Personal Agent

## Communication
- Caveman full. Active every response.
- Short, direct, low-noise.
- No filler, pleasantries, hedging, verbal tics.
- Keep tech terms exact. Fragments OK.
- Ask only if scope, risk, or success changes.
- No drift unless user says `normal mode` or `stop caveman`.
- Code, commands, commits, PR text: normal technical form.

## Intent
- Optimize business impact.
- Chase real objective, not surface ask.
- Once clear, execute end to end.
- Routine choices: decide and move.
- Pause only for blockers, contradictions, irreversible actions, or real scope shift.
- Use subagents for recon, parallel work, or context isolation.
- Use Agents Database as durable shared memory.
- Save high-signal prefs, decisions, project facts, reusable artifacts, and brief handoff context.
- Prefer few strong memories over many noisy ones.
- This Pi config repo is the place to evolve these rules.

## Rules
- Irreversible actions need explicit confirmation.
- Never merge or push to main without user confirmation.
- Stay direct and low-noise.
- Call out contradictions when they matter.
- Code, commands, commits, PR text: normal technical form.

## Machine Context
- Machine: `ballbox-first`.
- Do not SSH into `ballbox-first` for normal local work.
- This Pi is workstation + server for Sebas.
- "the server" usually means this machine unless user says other.

## Server Details
- Hostname: `ballbox-first.emperor-ratio.ts.net`
- Tailscale IP: `100.116.176.16`
- Runs 24/7
- Nginx on `:80` routes local services
- `agents-database`: `http://100.116.176.16:8091/api/status`

## Web Exposure / Tailscale
- For local web apps, prefer nginx on `localhost:80`, then `tailscale serve`.
- Prefer subpaths like `/cli/` before `/` when portal/home exists.
- If app only lives in Tailscale, disable local auth when it adds no value and tailnet already gates access.
- If you generate a file Sebas may open from another device, return a `/files/...` URL when possible.
- Path mapping: `/home/...` -> `/files/home/...`, `/mnt/...` -> `/files/mnt/...`.

## tmux / TUI
- tmux/persistence architecture: `/mnt/rpi/pi-config/SERVICES-ARCHITECTURE.md`.
- That doc is source of truth for `pitmux`, `piresume`, scroll, bindings, persistence model.
- If you touch tmux or `pi` launcher, update that file first.

## Shared Storage / Tooling
- For durable local machine tools, harnesses, caches, or shared artifacts that may grow, prefer `/mnt/rpi` over `~` because home storage is low.

## /tmp Cleanup
- Use `bin/tmp-cleanup` for top-level `/tmp` files older than 3 days.
- Install via `scripts/install-tmp-cleanup-cron.sh`.

## Laptop Helpers
- CLI helpers exist for Sebas's laptop via Tailscale SSH.
- Default host: `sebastians-macbook-pro-2`.
- Helpers:
  - `laptop-read <remote-path>`: remote cat over SSH.
  - `laptop-run <cmd ...>`: remote command over SSH.
  - `laptop-rsync <src> <dest> [extra args]`: rsync via SSH.
  - `laptop-mount`, `laptop-umount`, `laptop-write`: access/copy flows.
- If you need laptop IP/host, use `tailscale status --json` and look for MacBook peers.
- If task says "files on the laptop", use these helpers instead of manual SSH.

## Telegram
- Vars:
  - `TELEGRAM_BOT_TOKEN`
  - `TELEGRAM_CHAT_ID`
- Notify:
```bash
~/.agents/skills/telegram-notify/telegram-notify "Message"
```


**Investigating ACP definition**

I need to define what ACP stands for, maybe looking at "Agent Communication Protocol." It seems there's a "ACP SDK" that could be part of the pi agent ecosystem, perhaps from OpenCode? I should check my local knowledge and take a look at the pi agent repository. My next step is to search for ACP to gather more details! This should help in clarifying things.

cd /home/sebas && rg -n "Agent Client Protocol|ACP" ~/.agents /mnt/rpi /home/sebas 2>/dev/null | head -n 200


# Ballbox-First Services Architecture

Fecha: 2026-03-30

## Servicios Expuestos via Tailscale

Estado real verificado el 2026-03-30 con `tailscale serve status` y `curl`.

| Endpoint | Puerto Local | Descripción |
|----------|--------------|-------------|
| `https://ballbox-first.emperor-ratio.ts.net/` | `:80` (nginx) | Homepage Svelte - Portal principal |
| `http://100.116.176.16:8082/api/status` | `:8082` (personal-agent daemon) | Personal Agent API directa por Tailscale IP |
| `http://100.116.176.16:8091/api/status` | `:8091` (agents-database HTTP API) | Shared memory + tasks/artifacts API directa por Tailscale IP |

## Servicios Internos (sin exponer)

| Puerto | Proceso | Descripción |
|--------|---------|-------------|
| `:8082` | personal-agent daemon | API del personal agent |
| `:8091` | agents-database HTTP API | API de memoria compartida, tasks, runs y artifacts |
| `:18789` | clawdbot-gateway | Backend de OpenClaw/Control UI |
| `:80` | nginx | Servidor web principal |

## Resiliencia

- **Tailscale Serve Guardian**: Servicio systemd que verifica cada 5 minutos que los puertos expuestos estén activos
- Si detecta que falta alguno, restaura automáticamente la config

## URLs de Acceso

```bash
# Homepage
curl https://ballbox-first.emperor-ratio.ts.net/

# Personal Agent API directa
curl http://100.116.176.16:8082/api/status

# Agents Database API directa
curl http://100.116.176.16:8091/api/status
curl "http://100.116.176.16:8091/api/search?q=memory&scope=global"
```

Notas:

- `https://ballbox-first.emperor-ratio.ts.net/api/` no está hoy ruteado al `personal-agent`; responde la homepage de nginx.
- `https://ballbox-first.emperor-ratio.ts.net/portal/` tampoco aparece hoy en `tailscale serve status`; verificar antes de asumir que sigue publicado.

## Configuración de Red

- **Hostname Tailscale**: `ballbox-first.emperor-ratio.ts.net`
- **IP Tailscale**: `100.116.176.16`
- **Servidor**: Ubuntu en estructura/home
- **Proxy inverso**: nginx en `:80`

## Mantenimiento

### Reiniciar homepage
```bash
ssh ballbox-first
sudo systemctl restart nginx
```

### Ver estado Tailscale Serve
```bash
ssh ballbox-first 'tailscale serve status'
```

### Ver estado servicios remotos
```bash
ssh ballbox-first 'systemctl --user status personal-agent.service --no-pager'
ssh ballbox-first 'systemctl --user status agents-database-http.service --no-pager'
```

### Ver logs de servicios remotos
```bash
ssh ballbox-first 'journalctl --user -u personal-agent.service -f'
ssh ballbox-first 'journalctl --user -u agents-database-http.service -f'
```

### Ver estado Tailscale directo
```bash
curl http://100.116.176.16:8082/api/status
curl http://100.116.176.16:8091/api/status
```

## Ballbox Services Orchestrator

Script unificado para gestionar todos los servicios críticos con logs centralizados.

### Uso
```bash
# Ver estado de todos los servicios
/home/sebas/scripts/ballbox-services.sh status

# Verificar estado (sin logs)
/home/sebas/scripts/ballbox-services.sh check

# Reiniciar todos los servicios en orden
/home/sebas/scripts/ballbox-services.sh start
```

### Servicios gestionados
- `agents-database-http.service` (puerto 8091)
- `personal-agent.service` (puerto 8082)
- `nginx` (puerto 80)

### Logs
- Ubicación: `/home/sebas/logs/ballbox-services.log`
- Rotación: manual (verificar periódicamente)

### Servicio systemd
Para iniciar automáticamente al boot:
```bash
systemctl --user enable ballbox-services.target
systemctl --user start ballbox-services.target
```


(no output)

Command exited with code 7