Agent Memory Governance
Architecture mémoire session
mermaid
flowchart LR
A[AGENTS.md] --> C[Session bootstrap]
B[project_context.md] --> C
D[latest-session.md] --> C
C --> E[Execution session]
E --> F[Session close update]
F --> D
Fallback statique:
md

Purpose
Keep agent context stable across sessions while minimizing token waste.
Source-of-truth layers
AGENTS.md(stable rules)
- Global operating rules and response style.
- Update rarely (only when process changes).
project_context.md(semi-stable project context)
- Architecture, stack, critical files, and validation commands.
- Update when architecture or workflows change.
documentation/sessions/history/latest-session.md(volatile session memory)
- Recent done, in-progress, next, and risks.
- Update at the end of each meaningful session.
Update cadence
AGENTS.md: monthly or by explicit process decision.project_context.md: when runtime topology or conventions change.documentation/sessions/history/latest-session.md: every session close.
Session protocol
Start:
- Run
npm run session:bootstrap. - Run
npm run session:budget. - Confirm scope and risks.
Close:
- Run
npm run session:close -- --done "..." --next "..." --risk "...". - Keep entries short and factual.
Anti-drift rules
- Do not duplicate stable rules in
latest-session.md. - Do not store volatile TODO lists in
AGENTS.md. - Keep each section concise and deduplicated.
- Keep
documentation/sessions/history/latest-session.mdbelow line budget (default cap: 140 lines, 8 items/section).