Install
openclaw skills install @chen6896qqwee/dawn-memory-arch-v7Three-layer storage + four mechanisms + P0-P3 truth hierarchy for long-term agent memory. MEMORY.md central index, memory/core/ structured facts, local vector DB semantic search. Engramory curation, WAL protocol, context management. Zero external API, pure local filesystem + SQLite + LanceDB.
openclaw skills install @chen6896qqwee/dawn-memory-arch-v7Three-layer storage + four mechanisms + P0-P3 truth hierarchy — central index as entry, layered files for details, vector DB for semantic search, four rules for quality, P0-P3 hierarchy for data accuracy.
workspace/
├── MEMORY.md # Central index (hard limit: 200 lines / 25KB)
├── memory/
│ ├── core/ # Structured facts (JSON files)
│ │ ├── identity.json
│ │ ├── lessons.json
│ │ ├── preferences.json
│ │ ├── profile.json
│ │ └── strategies.json
│ ├── sessions/ # Session logs (history, not used in decisions)
│ ├── daily/ # Daily logs
│ ├── learnings/ # Learning notes + error logs
│ └── archive/ # Packaged archives
├── scripts/
│ ├── memory/ # Maintenance scripts
│ └── analysis/ # Analysis scripts
└── state.db # SQLite single source of truth (6 tables)
Trigger on detecting corrections, decisions, preference changes, or value changes. Write to session-state.json before replying. Ensures no data loss on crash.
When context usage > 60%, auto-trigger: write summary to working-buffer.md, record key decisions and context snapshots.
High-value memories (score > 0.8, appears 3+ times, affects trading decisions, user explicitly asked to remember) auto-promote from daily logs to MEMORY.md.
| Level | Location | Purpose | Update Frequency |
|---|---|---|---|
| P0 Single Source of Truth | state.db (holdings + portfolios tables) | Positions, account data | Auto after each trade |
| P1 Structured Cache | core/*.json | Identity, preferences, strategy, lessons | Manual + auto validation |
| P2 Session Logs | sessions/*.md | History records, not used in decisions | Every session |
| P3 Learning Notes | learnings/*.md | Lessons learned, for post-mortem | After the fact |
Core rule: Real-time decisions only use P0 (API real positions + hardcoded rules). Historical memory only for post-mortem.
| Script | Purpose | Trigger |
|---|---|---|
| dawn_boot_sync.py | Index learning notes + skill index + pre-market scan | Every startup |
| dawn_schema_validate.py | JSON schema validation | Every core/*.json change |
| dawn_state_db_upgrade.py | Update position snapshots | After every trade |
| dawn_money_flow.py | Money flow scan | Trading day 09:15 |
| dawn_factor_scoring.py | Factor scoring stock selection engine | Daily stock picking |
| Version | Date | Changes |
|---|---|---|
| v7.1 | 2026-07 | Added profile.json profile system; P0-P3 hierarchy formalized |
| v7.0 | 2026-06 | state.db v4.0 (holdings + portfolios tables); sessions standalone storage |
| v6.0 | 2026-05 | Local vector DB integration; LanceDB + all-MiniLM-L6-v2 |
| v5.0 | 2026-04 | Three-layer storage + four mechanisms finalized; removed redundant files |
| v4.0 | 2026-03 | Initial architecture; MEMORY.md + core JSON |
Author: Dawn (chen6896qqwee) License: MIT