You've completed 3 sprints. Memory files need maintenance. Learn to keep the AI's knowledge healthy and efficient.
โฑ ~15 min ยท Hands-on
Three sprints have passed. The team has shipped a profile page, notifications, and an admin dashboard. Along the way, decisions were made, conventions were established, and lessons were learned. But memory files have drifted โ some are stale, some are missing new conventions. Time to do memory maintenance.
Start by seeing what the AI currently "knows." The memory index is the table of contents for all project knowledge.
/agile-memory-recall
Memory Index โ Task Manager App
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Semantic Memory (what the project IS):
๐ .memory/semantic/project.md Project brief, name, tech stack
๐ .memory/semantic/architecture.md System design, module map
๐ .memory/semantic/conventions.md Coding standards, naming, patterns
๐ .memory/semantic/codebase.md File structure, key entry points
๐ .memory/semantic/testing.md Test strategy, coverage targets
๐ .memory/semantic/deployment.md Environments, CI/CD pipeline config
Episodic Memory (what HAPPENED):
๐ .memory/episodic/decisions.md ADRs and key technical decisions
๐ .memory/episodic/learnings.md Sprint retro learnings, insights
๐ .memory/episodic/incidents.md Production incidents and post-mortems
Domain Knowledge:
๐ .memory/semantic/domain/api.md API endpoint reference
๐ .memory/semantic/domain/database.md Schema, migrations, indexes
๐ .memory/semantic/domain/design.md UI component library reference
๐ .memory/semantic/domain/integrations.md Third-party service configs
Not all memory is created equal. Understanding the two types helps you maintain them correctly.
Semantic Memory:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Nature: Stable facts about the project
Changes: Rarely โ only on major refactors
Examples: Architecture, conventions, tech stack
Update: REPLACE outdated content with current truth
Risk: Goes stale silently if not verified
Files:
.memory/semantic/project.md โ "TaskFlow: REST API for task management"
.memory/semantic/architecture.md โ "We use React + Express + PostgreSQL"
.memory/semantic/conventions.md โ "All components use PascalCase"
.memory/semantic/codebase.md โ "Auth module lives in src/api/auth/"
.memory/semantic/testing.md โ "80% coverage minimum, Jest + RTL"
Episodic Memory:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Nature: Events, decisions, learnings over time
Changes: Sprint-scoped โ entries archived to sprint files at sprint end
Examples: ADRs, retro notes, incident reports
Update: ADD new entries within the sprint; at sprint end, /agile-sprint-retro archives all to .memory/episodic/sprints/sprint_NNN.md
Risk: Max ~10 entries per file per sprint; bounded to current sprint
Files:
.memory/episodic/decisions.md โ "ADR-007: Use SSE for notifications"
.memory/episodic/learnings.md โ "Integration tests caught 3 bugs unit tests missed"
.memory/episodic/incidents.md โ "2026-03-15: Payment timeout due to DB lock"
Semantic memory is updated in place โ you replace old facts with current ones. Episodic memory is sprint-scoped โ entries accumulate during the sprint (max ~10 per file), then /agile-sprint-retro archives them to .memory/episodic/sprints/sprint_NNN.md and resets the active files to template state.
Every memory file has a last_verified date in its frontmatter. If it's older than 30 days or a major refactor happened, the file is considered stale.
/agile-setup-health
Memory Health Check
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
.memory/semantic/architecture.md โ ๏ธ last verified: 45 days ago
3 new modules added since then
.memory/semantic/conventions.md โ
last verified: 12 days ago
up to date
.memory/semantic/codebase.md โ
last verified: 8 days ago
up to date
.memory/semantic/testing.md โ last verified: 90 days ago
coverage target changed, new test patterns
.memory/semantic/deployment.md โ
last verified: 15 days ago
up to date
.memory/episodic/decisions.md โ
sprint-scoped, 7 entries (current sprint)
.memory/episodic/learnings.md โ
sprint-scoped, 12 entries (current sprint)
.memory/episodic/incidents.md โ
sprint-scoped, 2 entries (current sprint)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Stale files: 2 (.memory/semantic/architecture.md, .memory/semantic/testing.md)
Action: Verify and update stale files
If .memory/semantic/architecture.md says "monolith" but you refactored to microservices, the AI will generate code for the wrong architecture. Stale memory causes wrong decisions. Always fix stale files before starting new work.
Read the stale file, verify against current code, update the content, and refresh the last_verified date.
Verification โ .memory/semantic/architecture.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Checking against codebase...
โ Missing: ProfileService module (added Sprint 4)
โ Missing: NotificationService module (added Sprint 5)
โ Missing: AdminService module (added Sprint 6)
โ
Correct: UserService, AuthService, OrderService
โ
Correct: Tech stack (React, Express, PostgreSQL)
โ
Correct: API structure and routing
Action: Added 3 missing modules to .memory/semantic/architecture.md
Updated: last_verified โ 2026-04-04
Verification โ .memory/semantic/testing.md
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Checking against current test setup...
โ Wrong: Coverage target says 75% (now 80%)
โ Missing: Integration test patterns for SSE endpoints
โ Missing: Soft-delete test conventions
โ
Correct: Jest + React Testing Library
โ
Correct: Unit test file naming (*. test.ts)
Action: Updated coverage target, added new patterns
Updated: last_verified โ 2026-04-04
During Sprint 3, the team discovered an inconsistency: some API responses used snake_case keys, others used camelCase. They agreed on a convention. Save it.
/agile-memory-remember
Saving to: .memory/semantic/conventions.md
Type: Semantic (project convention)
New entry:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
## API Response Format
All API responses use camelCase keys.
Example: { "userId": 1, "firstName": "Jane" }
NOT: { "user_id": 1, "first_name": "Jane" }
Enforced by: ESLint rule + Zod response schemas
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Saved to .memory/semantic/conventions.md
Sprint 3's retrospective surfaced an important insight. Capture it in episodic memory.
/agile-memory-learn
Saving to: .memory/episodic/learnings.md
Type: Episodic (sprint-scoped, archived at sprint end)
New entry:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
## Sprint 3 Learning โ 2026-04-04
Integration tests caught 3 bugs that unit tests missed:
1. Auth middleware not applied to new profile routes
2. S3 upload failing silently on invalid MIME type
3. Soft-delete not cascading to user sessions
Action: Increase integration test coverage for all
new API endpoints. Add to Definition of Done checklist.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
Appended to .memory/episodic/learnings.md
The AI doesn't load all memory at once. It selectively loads based on what you're doing.
When you say: "Fix the login bug"
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AI loads:
โ
.memory/semantic/codebase.md โ find auth module location
โ
.memory/semantic/testing.md โ know test conventions
โ
.memory/episodic/incidents.md โ check for related past incidents
AI skips:
โญ๏ธ .memory/semantic/deployment.md โ not relevant to bug fix
โญ๏ธ .memory/semantic/domain/design.md โ not a frontend task
โญ๏ธ .memory/semantic/domain/integrations.md โ not an integration issue
When you say: "Plan the notification architecture"
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
AI loads:
โ
.memory/semantic/architecture.md โ current system design
โ
.memory/episodic/decisions.md โ past ADRs (SSE decision)
โ
.memory/semantic/codebase.md โ module structure
AI skips:
โญ๏ธ .memory/episodic/incidents.md โ not an incident
โญ๏ธ .memory/semantic/testing.md โ planning, not implementing
โญ๏ธ .memory/semantic/domain/database.md โ not a data task
Loading all memory wastes context window tokens and can confuse the AI with irrelevant information. Selective loading keeps the AI focused and efficient. The .memory/MEMORY_INDEX.md is the only file loaded at every conversation start โ it tells the AI where to find everything else.
Not everything belongs in memory. Over-saving creates noise and staleness.
โ
SAVE to memory:
- Architecture decisions (ADRs)
- Team conventions and coding standards
- Module locations and entry points
- Recurring bug patterns
- Deployment configurations
โ DO NOT save:
- Exact code snippets (they go stale instantly)
- Information derivable from git log
- Temporary debug state or experiment notes
- Dependency version numbers (check package.json)
- PR review comments (they live in GitHub)
Before saving anything, ask: "Will this be true in 30 days?" If yes, save it. If it's likely to change with the next code change, don't โ it will become stale and mislead the AI.
Memory loads in levels, from lightest to deepest. Most tasks never need Level 3.
Level 0 โ Always loaded (conversation start)
โ .memory/MEMORY_INDEX.md
โ Just the table of contents, no file content
Level 1 โ Loaded by task type (automatic)
โ Bug fix? Load .memory/semantic/codebase.md + .memory/semantic/testing.md
โ Architecture? Load .memory/semantic/architecture.md + .memory/episodic/decisions.md
โ Frontend? Load .memory/semantic/architecture.md + .memory/semantic/domain/design.md
Level 2 โ Loaded on demand (specific need)
โ Need database schema? Load .memory/semantic/domain/database.md
โ Need API docs? Load .memory/semantic/domain/api.md
Level 3 โ Historical (only when explicitly asked)
โ "What happened in Sprint 1?" โ Load full .memory/episodic/learnings.md
โ "Any past incidents with payments?" โ Load .memory/episodic/incidents.md
/agile-memory-recall โ viewing the current memory index and what the AI knows/agile-setup-health โ checking for stale memory files and fixing them/agile-memory-remember โ saving new conventions to semantic memory/agile-memory-learn โ capturing sprint learnings to episodic memoryWhat is the ONLY memory file loaded at conversation start?