# MEMORY.md

> Define what the system remembers across turns or runs, why each memory type exists, how identity and provenance are preserved, and how information is corrected, expired, deleted, and evaluated.

**Decision rule:** Persist information only when it has a defined future use, owner, retention rule, and correction path. Do not treat a conversation transcript as an undifferentiated memory system.

## How to use this template

- Replace every angle-bracket placeholder with project-specific evidence.
- Remove sections that do not apply instead of leaving ambiguous boilerplate.
- Link decisions to their specifications, tasks, tests, traces, and owners.
- Re-review this file when the workflow, authority boundary, or primary source changes.

## Memory taxonomy

> Separate state with different authority, lifetime, and privacy properties.

- **Session state:** <Define transient conversation and workflow state>
- **Durable facts:** <Define user, project, organizational, and domain knowledge worth persisting>
- **Derived memory:** <Define summaries, preferences, patterns, and their confidence or source>

## Identity and storage

> Prevent memory from crossing the wrong user, workspace, tenant, or authority boundary.

- **Identity keys:** <Define user, session, project, tenant, and agent identifiers>
- **Storage:** <List systems of record, indexes, encryption, access policy, and backups>
- **Retrieval:** <Define queries, ranking, scope, confidence, and empty-result behavior>

## Lifecycle and control

> Give users and operators meaningful control over remembered information.

- **Write policy:** <State what can be written automatically and what requires confirmation>
- **Correction:** <Describe inspection, edit, contradiction, source update, and invalidation>
- **Retention:** <Define expiration, deletion, legal hold, export, and downstream cleanup>

## Quality and privacy

> Evaluate benefits and harms using realistic longitudinal cases.

- **Quality tests:** <Measure retrieval precision, stale-memory behavior, correction, and compaction loss>
- **Privacy tests:** <Test tenant isolation, consent, sensitive inference, deletion, and data minimization>
- **Operational signals:** <Monitor write volume, retrieval use, conflicts, corrections, and deletion failures>

## Related AgentAtlas field guides

- [Memory and context](https://agentatlas.dev/topics/memory-context)
- [Governance](https://agentatlas.dev/topics/governance)
- [Safety and permissions](https://agentatlas.dev/topics/safety-permissions)

## Primary references

- [Sessions](https://openai.github.io/openai-agents-python/sessions/) — Session memory, storage choices, history limits, compaction, resumption, and operational persistence patterns.
- [Effective context engineering for AI agents](https://www.anthropic.com/engineering/effective-context-engineering-for-ai-agents) — Treating context as a finite resource and curating instructions, tools, external data, history, and summaries across long-running agents.
- [AGENTS.md specification](https://agents.md/) — Versioned repository instructions that make build, test, style, and contribution requirements available to agents.
- [GitHub Spec Kit](https://github.github.com/spec-kit/index.html) — Governed specification-driven workflows, quality checks, organizational principles, and traceability across delivery artifacts.
- [Codex security](https://developers.openai.com/codex/security) — Sandboxing, approvals, network access, filesystem controls, and security boundaries for agentic coding work.
- [Configure permissions](https://code.claude.com/docs/en/permissions) — Permission rules, allow and deny controls, managed policy, tool authorization, and least-privilege configuration.

---

- Template version: 1.0.0
- Reviewed: 2026-07-26

Generated deterministically from reviewed AgentAtlas records.
