Query the pi-brain knowledge graph for past decisions, lessons learned, and patterns from previous coding sessions...
When the <skill> tag loads this file, it includes a location attribute with the
absolute path to this SKILL.md. Use that to derive the init script path:
bash "/absolute/path/to/skills/brain/scripts/brain-init.sh"
Replace /absolute/path/to/skills/brain with the skill directory shown in the
<skill> tag's location attribute (strip the /SKILL.md suffix).
memory_commit runs its distiller as a child Pi process. By default, it inherits
the currently selected model and thinking level from the active Pi session. To
choose a dedicated committer, add .memory/config.yaml:
committer:
model: google/gemini-3.6-flash
thinking: low
extensions:
- ./custom-provider.ts
Omit model or thinking to inherit the active session value. By default the
committer child starts with --no-extensions (so it does not reload Brain onto
the log it is distilling), then Brain re-adds session extensions from pi -e,
.pi/settings.json, ~/.pi/agent/extensions/, and <cwd>/.pi/extensions/,
skipping this package. Set committer.extensions to replace that list — a YAML
list of specs, or a comma-separated string. Pi resolves provider authentication
normally; do not put API keys or other credentials in this file.
.memory/main.md — the project roadmap (see below).Note: No
/reloadis needed. The memory tools lazily detect.memory/on every call viatryLoad().
New project (no existing code): Write goals, intended architecture, and open questions as you understand them from conversation with the user.
Existing project: Orient yourself first:
AGENTS.md, README.md, package.json (or equivalent)git log --oneline -20)docs/Then write the roadmap covering: project purpose, current state, key decisions already made, completed milestones, and planned work.
Memory status is automatically injected at session start (via the
before_agent_start hook) and appended to every successful memory_branch and
memory_commit result. Automatic status is compact and may truncate long
roadmaps, so keep the newest critical context near the top of .memory/main.md.
You do not need to call a separate tool to see status.
For deep retrieval, use read directly:
read .memory/branches/<name>/commits.md — full branch historyread .memory/branches/<name>/log.md — OTA trace since last commitread .memory/branches/<name>/metadata.yaml — structured metadataread .memory/main.md — project roadmapread .memory/AGENTS.md — full protocol referenceA subagent handles commit distillation — it reads your log.md and prior commits,
then produces the structured commit entry. You just provide a good summary string.
Re-read .memory/main.md and rewrite stale sections. The roadmap is the first
thing a new session reads — if it's stale, every future session starts with a wrong
picture. This means genuine review, not mechanical edits.
After memory_commit returns:
.memory/main.md in full.The goal is curation, not accumulation. A reader of Current State should understand the project as it exists today without wading through history.
For trivial commits that don't change the project's state, decisions, or milestones
(e.g., minor refactors, typo fixes), you can pass update_roadmap: false to skip
the reminder. Most commits should update the roadmap.
Important: Always review the source branch history BEFORE calling merge.
Use read .memory/branches/<target>/commits.md for full branch history.
You need the full context to write a good synthesis.