feature: add persistent agent memory across session restarts#31
Merged
Conversation
New ~/.pi/agent/memory/ directory with Markdown files that agents read on startup and update as they learn. Survives session restarts. Seed files (deployed only if missing — agent-owned, never overwritten): - operational.md — infrastructure learnings, common errors/fixes - repos.md — per-repo build quirks, CI gotchas, architecture notes - users.md — user preferences, timezone, communication style - incidents.md — past incidents: root cause + fix Integration: - Control agent reads all memory on startup, updates as it learns - Dev agent reads repos.md for per-repo knowledge before starting - Sentry agent reads incidents.md for past incident context - deploy.sh seeds memory files (only if missing) - setup.sh creates memory directory Inspired by OpenClaw's file-based memory (MEMORY.md + memory/ dir), simplified — no embeddings, no vector search, no file watcher. Plain Markdown files small enough to include directly in context.
Tests cover: - Seed files: exist, valid Markdown, no-secrets warnings, no real secrets, template-only content (no real dated entries) - repos.md: has sections for all known repos (modem, website, baudbot) - Deploy seeding: copies to empty dest, does NOT overwrite existing files, handles partial seeding correctly - Skill integration: all 3 skills have Memory section, reference correct files, warn against storing secrets, startup checklists include memory reads - deploy.sh: has memory seeds section, creates dir, uses conditional copy - setup.sh: creates memory directory
4f63ba7 to
e8928d4
Compare
The conflict resolution during rebase ate the closing fi for the heartbeat if/else block, causing a syntax error on deploy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds persistent, cross-session memory so Baudbot agents retain operational learnings, user preferences, and recurring patterns across session restarts. Currently agents lose all context when sessions restart — they re-learn the same lessons every time.
New files
pi/skills/control-agent/memory/operational.md— infrastructure learnings, common errors/fixespi/skills/control-agent/memory/repos.md— per-repo build quirks, CI gotchas, architecture notespi/skills/control-agent/memory/users.md— user preferences, timezone, communication stylepi/skills/control-agent/memory/incidents.md— past incidents: root cause + fixHow it works
deploy.shseeds memory files to~/.pi/agent/memory/— only if they don't already exist (agent-owned, never overwritten)setup.shcreates the memory directory during initial setuprepos.mdfor repo-specific knowledge before starting workincidents.mdfor past incident context when triagingDesign decisions
redact-logs.shcan scan these in the future.MEMORY.md+memory/directory pattern, but without the Tier 2 semantic search infrastructure (SQLite + embeddings + hybrid search). We can add that later if memory grows past ~50KB.Updated files
pi/skills/control-agent/SKILL.md— new Memory section + startup checklistpi/skills/dev-agent/SKILL.md— readsrepos.mdbefore starting workpi/skills/sentry-agent/SKILL.md— readsincidents.mdon startupbin/deploy.sh— seeds memory files (only if missing)setup.sh— creates memory directoryREADME.md,AGENTS.md— architecture docs