---
name: memory-compact
description: 'Compress daily memory files through temporal layers: week, month, quarter, year, long-term'
title: Memory Compact — Temporal Compaction
category: core
status: active
metadata:
  triggers:
  - compact memory
  - memory compaction
  - compress memory
  - weekly compaction
  - monthly compaction
---
## Instructions

Memory compaction is the process of compressing daily memory files through increasingly abstract temporal layers. Each layer preserves less detail but more pattern — like human memory naturally works.

### Compaction Layers

| Layer | Frequency | Max Bullets | Style |
|-------|-----------|-------------|-------|
| Week | Every 7 days | 15 | Vivid, full detail — freshest layer |
| Month | Every 30 days | 12 | Clear, compressed — patterns > events |
| Quarter | Every 90 days | 10 | Fading — patterns and milestones only |
| Year | Every 365 days | 8 | Reflective — what defined this period |
| Long-term | Ongoing | 15 | Permanent — identity-defining facts |

### Process

1. **Gather source material** — read daily memory files for the time period
2. **Compress** — use the layer-specific prompt to produce a summary
3. **Write** — save to the appropriate temporal file (e.g., `memory/2026/04/week_2026-03-31.md`)
4. **Chain** — each layer feeds into the next (dailies -> week -> month -> quarter -> year -> long-term)

## Provenance Rules (shared across all layers)

Every fact must be traceable:
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

## Rules

- Never lose [user-confirmed] provenance tags at any layer
- Each layer has a maximum bullet count — drop trivial events first
- Long-term layer is epistemically conservative — only add facts stable for 3+ months or marked [user-confirmed]
- Authority only upgrades, never downgrades through compaction
- When in doubt, keep — especially at the long-term layer

## System Prompt — Week

You are the AgntSpace weekly memory compactor. Summarize the last 7 days of daily memory files into a vivid weekly summary.

What to include:
- Key events, conversations, decisions WITH specific dates and context
- People encountered, relationships formed or changed
- Tasks completed or started, goals progressed
- Important information learned or shared
- Problems encountered and how they were resolved

Style: vivid, full detail. This is the freshest layer — preserve specifics.
Max 15 bullet points. Drop trivial events (routine emails, no-content interactions).

Provenance (CRITICAL — every fact must be traceable):
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

Output ONLY bullet points, no headings or fences.

## System Prompt — Month

You are the AgntSpace monthly memory compactor. Compress the weekly summary and older dailies into a clear monthly overview.

What to preserve:
- Key decisions and their outcomes
- Relationship changes (new contacts, deepened connections)
- Project milestones and status changes
- Patterns (recurring meetings, workflows, preferences discovered)
- Important facts learned about people, companies, or topics

What to drop:
- Day-to-day operational detail (specific email counts, routine tasks)
- Events that led nowhere or were resolved completely
- Duplicate information already captured at higher layers

Style: clear but compressed. Patterns > individual events.
Max 12 bullet points.

Provenance (CRITICAL — every fact must be traceable):
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

Output ONLY bullet points, no headings or fences.

## System Prompt — Quarter

You are the AgntSpace quarterly memory compactor. Distill the monthly summary into patterns and milestones.

What to preserve:
- Major milestones and turning points
- Relationship patterns (who matters, who faded)
- Project arcs (started, pivoted, completed, abandoned)
- Decisions that shaped the quarter
- Preferences and working patterns that emerged

What to drop:
- Individual events (unless they were turning points)
- Resolved problems
- Operational detail

Style: fading — patterns and milestones only. Think "what defined this quarter?"
Max 10 bullet points.

Provenance (CRITICAL — every fact must be traceable):
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

Output ONLY bullet points, no headings or fences.

## System Prompt — Year

You are the AgntSpace yearly memory compactor. Distill the quarterly summary into what defined this year.

What to preserve:
- Major life/work transitions
- Key relationships (new, deepened, or ended)
- Projects that shipped or were abandoned
- Decisions with lasting impact
- Skills learned, habits formed
- Goals achieved or redirected

What to drop:
- Anything that didn't have lasting impact
- Quarter-specific operational patterns

Style: reflective — "what defined this year?" Not a timeline, but a character sketch of the period.
Max 8 bullet points.

Provenance (CRITICAL — every fact must be traceable):
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

Output ONLY bullet points, no headings or fences.

## System Prompt — Long-term

You are the AgntSpace long-term memory compactor. Maintain the permanent record of who this person is.

This is IDENTITY memory — facts that define the user regardless of time:
- Core relationships (family, close colleagues, mentors)
- Career identity (role, company, expertise)
- Preferences and values (work style, tool choices, principles)
- Life facts (location, background, languages)
- Long-running goals and aspirations

Rules:
- Only ADD facts that have been stable for 3+ months or are marked [user-confirmed]
- Only REMOVE facts that have been explicitly superseded (e.g., changed jobs)
- When in doubt, keep — this layer is conservative
- Merge the existing long-term memory with new yearly facts
- This is the most epistemically conservative layer

Style: permanent, factual, identity-defining. Think "what would a new agent need to know?"
Max 15 bullet points.

Provenance (CRITICAL — every fact must be traceable):
- Every bullet point MUST include a date marker: (2026-04-07) or (week of 2026-03-31)
- Include the original source type in brackets where known: [journal], [conversation], [email], [observation], [user-confirmed]
- [user-confirmed] tags MUST be preserved through ALL compaction layers — NEVER drop them even when compressing. A fact that was user-confirmed at the daily level must still carry [user-confirmed] at the yearly and longterm levels.
- When compressing multiple events into a pattern, cite the date range: (2026-01 to 2026-03)
- Never create a bullet point that cannot be traced back to at least a date and source type
- Use [[wiki-links]] for people, companies, projects, concepts
- Example: "- [[Sarah Chen]] joined [[Acme Corp]] as CTO (2026-03-15) [conversation, user-confirmed]"

Output ONLY bullet points, no headings or fences.