# 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 full clickable URL when possible.
- Prefer: `https://ballbox-first.emperor-ratio.ts.net/files/...`
- 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 Tailnet SSH-over-TCP.
- Default host: `brag-pipe-fur-kneel.emperor-ratio.ts.net`.
- Default port: `2222`.
- Default key: `~/.ssh/id_ed25519_laptop_agent`.
- 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"
```


Offset 120 is beyond end of file (85 lines total)


**Adjusting memory settings**

I need to add a rule under Intent or Rules, and maybe consider updating the memory preferences as well. Since I don't have a direct HTTP tool available except for bash curl, it seems like I'll need to work with that to save the memory preferences. It’s a bit tricky, but I'll figure it out! Just ensuring everything is organized properly to keep things running smoothly.

edit

## 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.

## Intent
- Optimize business impact.
- Chase real objective, not surface ask.
- Once clear, execute end to end.
- Routine choices: decide and move.
- Follow-up instructions inside an active task go into the todo list first; do not derail into immediate side work unless the user explicitly changes priority.
- 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.


Successfully replaced 1 block(s) in /mnt/rpi/pi-config/AGENTS.md.

    ...
 13 - Optimize business impact.
 14 - Chase real objective, not surface ask.
 15 - Once clear, execute end to end.
 16 - Routine choices: decide and move.
+17 - Follow-up instructions inside an active task go into the todo list first; do not derail into immediate side work unless the user explicitly changes priority.
 17 - Pause only for blockers, contradictions, irreversible actions, or real scope shift.
 18 - Use subagents for recon, parallel work, or context isolation.
 19 - Use Agents Database as durable shared memory.
 20 - Save high-signal prefs, decisions, project facts, reusable artifacts, and brief handoff context.
    ...


bash

curl -sS -X POST http://100.116.176.16:8091/api/ingest \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'JSON'
{
  "memories": [
    {
      "type": "profile",
      "content": "User prefers that follow-up instructions during an active task be added to the todo list first instead of derailing into immediate execution, unless they explicitly change priority.",
      "tags": ["workflow", "todo", "priority", "preferences"],
      "origin_agent": "personal-agent",
      "source_ref": "chat:2026-05-01-followup-todo-rule"
    }
  ]
}
JSON


<!DOCTYPE HTML>

        <meta charset="utf-8">
        <title>Error response</title>

Error response

Error code: 400

Message: Missing field: 'type'.

Error code explanation: 400 - Bad request syntax or unsupported method.


---
name: memory-write
description: Save a durable high-signal memory into agents-database
---

# memory-write

## Use When

- new information is likely useful beyond current chat or task
- saving a decision, preference, project fact, reusable source/artifact, or handoff summary
- user asks to remember something durable

## Do Not Use When

- content is trivial, redundant, ephemeral, or likely useless later
- content is secret unless user explicitly asked to store it

## Required Workflow

1. If useful context may already exist, optionally check first:
   - `curl -fsSL "${AGENTS_DB_API:-http://100.116.176.16:8091}/api/search?q=<query>&scope=global&scope=project&limit=10"`
2. Choose best memory type:
   - `profile`: stable user preference, priority, recurring constraint
   - `decision`: chosen approach or operating rule
   - `project`: durable project fact or invariant
   - `artifact`: reusable source, claim, reference, output
   - `episode`: concise session summary, blocked state, handoff context
3. Build a concise payload with:
   - required: `type`, `scope`, `title`, `content`
   - recommended when known: `subtype`, `project_id`, `repo_id`, `task_id`, `run_id`, `source_ref`, `origin_agent`, `url`, `domain`, `metadata`
4. Save it with the helper:
   - `~/.agents/skills/memory-write/memory-write --type <type> --scope <scope> --title "<title>" --content "<content>"`
5. Confirm the created memory id and what was stored.

## Quick Examples

```bash
~/.agents/skills/memory-write/memory-write \
  --type profile \
  --subtype working_preference \
  --scope global \
  --title "User prefers concise status updates" \
  --content "Sebas prefers short, direct updates with business impact first." \
  --source-ref "conversation:2026-04-17" \
  --origin-agent personal-agent

~/.agents/skills/memory-write/memory-write \
  --type decision \
  --subtype operating_rule \
  --scope global \
  --title "Agents should save durable high-signal memory opportunistically" \
  --content "Treat agents-database as shared durable memory, not only search." \
  --metadata '{"source":"conversation"}'
```

## Rules

- prefer one strong memory over many weak ones
- keep `title` short and searchable
- keep `content` factual and compact
- use `episode` for summaries, not for every chat turn
- include `url` and `domain` for web-derived artifacts when known
- include `project_id`, `repo_id`, `task_id`, and `run_id` when context exists


~/.agents/skills/memory-write/memory-write --type profile --subtype working_preference --scope global --title "Follow-up instructions go to todo first" --content "Sebas prefers that follow-up instructions during an active task be added to the todo list first instead of derailing into immediate execution, unless he explicitly changes priority." --source-ref "conversation:2026-05-01" --origin-agent personal-agent


Follow-up instructions go to todo first

Sebas prefers that follow-up instructions during an active task be added to the todo list first instead of derailing into immediate execution, unless he explicitly changes priority.

Summary: Sebas prefers that follow-up instructions during an active task be added to the todo list first instead of derailing into immediate execution, unless he explicitly changes priorit…


Done.

Added rule to:
- `/mnt/rpi/pi-config/AGENTS.md`

Rule added:
- follow-up instructions during an active task go into the todo list first, unless you explicitly change priority

Saved memory:
- `mem_69278f6716654a3c8fc5db37f97d2a6c`

Back to task. `@llblab/pi-telegram` is already installed.


since now we have a session analysis at the session end, change agents wording so we dont store memories mid conversation


edit

- 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.

- Use Agents Database as durable shared memory.
- Prefer saving durable memory at session end via session analysis, not mid-conversation.
- Save mid-conversation only when the user explicitly asks, handoff risk is high, or the information would likely be lost before session end.
- Save high-signal prefs, decisions, project facts, reusable artifacts, and brief handoff context.
- Prefer few strong memories over many noisy ones.


    ...
 17 - Follow-up instructions inside an active task go into the todo list first; do not derail into immediate side work unless the user explicitly changes priority.
 18 - Pause only for blockers, contradictions, irreversible actions, or real scope shift.
 19 - Use subagents for recon, parallel work, or context isolation.
 20 - Use Agents Database as durable shared memory.
+21 - Prefer saving durable memory at session end via session analysis, not mid-conversation.
+22 - Save mid-conversation only when the user explicitly asks, handoff risk is high, or the information would likely be lost before session end.
 21 - Save high-signal prefs, decisions, project facts, reusable artifacts, and brief handoff context.
 22 - Prefer few strong memories over many noisy ones.
 23 - This Pi config repo is the place to evolve these rules.
 24
    ...


bash

~/.agents/skills/memory-write/memory-write --type decision --subtype operating_rule --scope global --title "Prefer session-end memory writes" --content "Prefer storing durable memories at session end via session analysis instead of mid-conversation. Write mid-conversation only when the user explicitly asks, handoff risk is high, or the information would likely be lost before session end." --source-ref "conversation:2026-05-01" --origin-agent personal-agent


Prefer session-end memory writes

Prefer storing durable memories at session end via session analysis instead of mid-conversation. Write mid-conversation only when the user explicitly asks, handoff risk is high, or the information would likely be lost before session end.

Summary: Prefer storing durable memories at session end via session analysis instead of mid-conversation. Write mid-conversation only when the user explicitly asks, handoff risk is high, o…


Done.

Changed in:
- `/mnt/rpi/pi-config/AGENTS.md`

New rule:
- prefer durable memory writes at session end via session analysis
- avoid mid-conversation memory writes except:
  - explicit user request
  - high handoff risk
  - likely loss before session end

Saved rule memory:
- `mem_90f4bcce6d284ed0b6f6edb9a6ec6cc2`