Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ pi/
skills/ source of truth for agent skill templates
control-agent/ orchestration agent
HEARTBEAT.md health check checklist (deployed to ~/.pi/agent/)
memory/ seed files for persistent memory
dev-agent/ coding agent
sentry-agent/ monitoring/triage agent
settings.json pi agent settings
Expand Down Expand Up @@ -70,6 +71,7 @@ Agent runtime layout:
│ ├── extensions/ deployed extensions
│ ├── skills/ agent-owned (can modify freely)
│ ├── HEARTBEAT.md periodic health check checklist (admin-managed)
│ ├── memory/ persistent agent memory (agent-owned, survives deploys)
│ ├── baudbot-version.json deploy version (git SHA, timestamp)
│ └── baudbot-manifest.json SHA256 hashes of all deployed files
├── workspace/ project repos + git worktrees
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ The control agent runs a periodic heartbeat loop (default: every 10 minutes) tha
- Are there stale worktrees or stuck todos?

The checklist lives in `HEARTBEAT.md` — edit it to add custom checks. The heartbeat extension (`heartbeat.ts`) handles scheduling, error backoff, and the `heartbeat` tool for runtime control. If the checklist is empty, no heartbeat fires (saves tokens).
### Persistent Memory

Agents maintain persistent memory across session restarts via Markdown files in `~/.pi/agent/memory/`:

| File | What it stores |
|------|---------------|
| `operational.md` | Infrastructure learnings, common errors and fixes |
| `repos.md` | Per-repo build quirks, CI gotchas, architecture notes |
| `users.md` | User preferences, timezone, communication style |
| `incidents.md` | Past incidents: what broke, root cause, how it was fixed |

Memory files are agent-owned — agents read them on startup and update them as they learn. Deploy seeds the files on first install but never overwrites existing content.

## Architecture

Expand All @@ -127,6 +139,7 @@ baudbot_agent (unprivileged uid)
│ ├── extensions/ deployed extensions (read-only)
│ ├── skills/ agent-owned (can modify)
│ ├── HEARTBEAT.md periodic health check checklist
│ ├── memory/ persistent agent memory (agent-owned)
│ └── baudbot-manifest.json SHA256 integrity hashes
├── ~/workspace/ project repos + worktrees
└── ~/.config/.env secrets (600 perms)
Expand Down
22 changes: 22 additions & 0 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ else
log "would copy: HEARTBEAT.md"
fi

# ── Memory Seeds ─────────────────────────────────────────────────────────────

echo "Deploying memory seeds..."

MEMORY_SEED_DIR="$STAGE_DIR/skills/control-agent/memory"
MEMORY_DEST="$BAUDBOT_HOME/.pi/agent/memory"

if [ "$DRY_RUN" -eq 0 ]; then
# Memory seeds — only copy if files don't already exist (agent-owned, don't clobber)
as_agent mkdir -p "$MEMORY_DEST"
if [ -d "$MEMORY_SEED_DIR" ]; then
for seed in "$MEMORY_SEED_DIR"/*.md; do
[ -f "$seed" ] || continue
base=$(basename "$seed")
as_agent bash -c "[ -f '$MEMORY_DEST/$base' ] || cp '$seed' '$MEMORY_DEST/$base'"
log "✓ memory/$base (seed, won't overwrite)"
done
fi
Comment thread
sentry[bot] marked this conversation as resolved.
else
log "would seed: memory/*.md (only if missing)"
fi

# ── Slack Bridge ─────────────────────────────────────────────────────────────

echo "Deploying slack-bridge..."
Expand Down
1 change: 1 addition & 0 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ if [ "$FILTER" = "all" ] || [ "$FILTER" = "js" ]; then
echo "JS/TS:"
run "tool-guard" node --test pi/extensions/tool-guard.test.mjs
run "heartbeat" node --test pi/extensions/heartbeat.test.mjs
run "memory" node --test pi/extensions/memory.test.mjs
run "bridge security" node --test slack-bridge/security.test.mjs
run "extension scanner" node --test bin/scan-extensions.test.mjs
echo ""
Expand Down
Loading