-
Notifications
You must be signed in to change notification settings - Fork 0
Memory Model
Flat. Local. Markdown.
memory/
├── hot.md ≤500 words — last 3 sessions. Read FIRST.
├── index.md Domain index. Read if hot insufficient.
├── MEMORY.md Agent-written session notes. First 200 lines auto-load.
├── DECISIONS.md Confirmed decisions + provenance + evidence grade
├── OPEN_QUESTIONS.md Unresolved questions + owner
├── RISKS.md Identified risks + severity
├── CONFLICTS.md Contradiction queue (user arbitrates)
├── archive/ Superseded entries — never deleted (per D9)
├── patterns/
│ └── PATTERNS.jsonl Append-only tool/event log
├── snapshots/<iso>/ Point-in-time wiki state + manifest.json
├── sync/
│ ├── outbound/ Staged parent updates
│ └── parent/ Received parent updates
└── raw/ Untouched source material (transcripts, specs, dumps)
Every session start:
-
memory/hot.md— ≤500 words; "what's currently in flight" -
memory/index.md— domain index (only if hot insufficient) -
PRIVACY.md(root) — before any write or tool use -
REDACT.md(root) — before any external output -
memory/MEMORY.mdfirst 200 lines — agent-written context -
memory/patterns/PATTERNS.jsonllast 3 entries — recent events - Individual wiki pages — ONLY when domain specifics are needed
Never load a full wiki page just to scan it.
sequenceDiagram
participant Skill
participant MK as memory-keeper
participant PG as privacy-guardian
participant CR as contradiction-resolution
participant Wiki as memory/
Skill->>MK: write request
MK->>PG: CHECK(payload, mode)
alt mode=local-only AND target=sync/outbound/
PG-->>MK: REJECT
else mode=abstract
PG->>PG: privacy-abstraction(REDACT.md classes)
PG-->>MK: cleaned payload
else mode=exact
PG-->>MK: pass-through
end
MK->>CR: DETECT(payload vs wiki state)
alt conflict
CR->>Wiki: append CONFLICTS.md
CR-->>MK: HALT
else clean
MK->>Wiki: write DECISIONS / RISKS / OPEN_Q / domain page
MK->>Wiki: append PATTERNS.jsonl (event log)
MK->>Wiki: update index.md
end
Only memory-keeper writes to:
-
memory/hot.md,index.md,DECISIONS.md,OPEN_QUESTIONS.md,RISKS.md,CONFLICTS.md,MEMORY.md
Any other agent attempting these paths is blocked and the violation is logged.
memory/patterns/PATTERNS.jsonl is append-only by any agent.
✗ Wrong: read memory/DECISIONS.md (whole page)
✓ Right: read memory/hot.md
→ if needed: read memory/index.md
→ find domain row
→ read named section of named page
This is enforced by skill discipline and tracked by budget-governor. Loading full pages blows the token budget.
When memory-keeper detects a conflict:
- Halt the write.
-
Append both sides to
memory/CONFLICTS.mdwith provenance. - Surface to user: "Resolve now / snooze-until-done / both-valid?"
- User arbitrates — never silent resolution.
- On resolution: winner moves to
memory/DECISIONS.mdwith both-sides provenance. Loser marked[SUPERSEDED]in source page. Never deleted.
Conflict types detected:
| Type | Example |
|---|---|
| Direct negation | "DB is Postgres" vs "DB is MySQL" |
| Mutually exclusive | "Ship Friday" vs "Ship next Monday" |
| Quantitative drift | "Budget $50k" vs "Budget $80k" (>20% delta) |
| Decision supersession | New decision overrides still-active decision |
| Source disagreement | Two pushed-in claims disagree |
AGENTS.md is human-written, agent-read.
memory/MEMORY.md is agent-written, agent-read.
Auto-hygiene on every /done: relative time anchors become absolute dates (per ZEREF_OS §3.4).
Rule: treat your own memory as a hint, not a fact. Verify against actual code before acting.
Every entry carries a grade:
| Grade | Criteria |
|---|---|
| high | Verified this session OR confirmed by user OR backed by primary source |
| medium | Reasonable inference, named source, < 30 days old |
| low | Unverified assumption OR > 90 days old OR derived from indirect source |
evidence-curator re-grades on staleness. Decisions destined for DECISIONS.md must be high or medium; low rejected for user confirmation.
On every /done: snapshot memory/ (excluding archive/) → memory/snapshots/<iso>/ with manifest.json (ts, event cursor, wiki state hash).
Snapshots are never overwritten. Each gets a unique ISO timestamp.
Path changes preserved in MIGRATION.md:
- v3 → v4:
scripts/migrate-v3-to-v4.py - v4.0–v4.2 (nested
memory/wiki/) → v4.3 (flat):scripts/migrate-v4.2-to-v4.3.py - v4.3 → Zeref OS v1.0.0: no data migration; only plugin name change
Getting Started
Architecture
- Architecture · 14 skills · 4 gates
- Memory-Model · flat + PATTERNS schema
- Privacy-Model · 3 modes + R6
- Team-Packs · 6 on-demand
- Pattern-Detection · Two-Strikes
Reference