๐๏ธ Sovereign Markdown Palace Protocol (v1.0)
"Sovereignty through Spatial Awareness. Recall through Structured Reflection."
1. ๐๏ธ Concept: The Memory Archive Evolved
The Sovereign Markdown Palace is a spatial governance layer for the Deep State of Mind (DSOM) framework. This architecture originated from and was inspired by the MemPalace project (milla-jovovich/mempalace). It replaces flat, linear session logs with a multidimensional directory hierarchy.
Instead of an AI agent reading 300+ lines of a single walkthrough.md (which leads to Context Decay and Attention Drift), the Palace allows the agent to "walk" through specific domains of knowledge, loading only the high-fidelity summaries needed for the task at hand.
2. ๐๏ธ The Architectural Hierarchy
The Palace is structured into five distinct semantic layers:
i) Wings (The Domains)
Top-level directories representing a major project, person, or entity.
- Example:
wing_dsom_core,wing_laboratory_cms.
ii) Halls (The Memory Corridors)
Standardised memory types shared across every wing to ensure consistency.
hall_facts: Immutable laws, architectural decisions, and "Truths."hall_events: Chronological milestones and session anchors.hall_preferences: User persona, linguistic mandates, and stylistic choices.hall_discoveries: Breakthroughs and new insights.hall_advice: Past recommendations and solutions.
iii) Rooms (The Topics)
Specific subjects within a wing.
- Example:
room_clean_architecture,room_persistence_fabric.
iv) Closets (The Summaries)
Each room contains a closet.md file. This is the distilled truthโa highly optimized Markdown summary that provides the AI with immediate context without reading verbatim logs.
v) Drawers (The Verbatim Logs)
The original, unedited session logs (e.g., walkthrough.md). Closets always link back to specific line numbers in the drawers for deep-dive verification.
๐ 3. Dual-Mode Persistence (The SSoT)
The Palace operates in tandem with the Chronological Drawer (walkthrough.md) to provide "the best of both worlds":
| Dimension | Chronological Drawer (walkthrough.md) |
Spatial Palace (wings/) |
|---|---|---|
| Logic | Temporal (Time-based) | Semantic (Meaning-based) |
| Pillar | Persistence (The Record) | Recall (The Retrieval) |
| Storage | Single flat file | Structured directory tree |
| Usage | Archival audit trail | Active session reanimation |
๐ถ 4. Operational Workflow: "Walking the Palace"
i) Reanimation (SOD)
When the AI wakes up, it no longer reads the entire walkthrough.md. Instead:
- Read
palace_registry.mdto identify the relevant Wings and Rooms. - Load the
closet.mdfor those specific rooms. - Establish a high-resolution Mental Anchor in seconds.
ii) Hibernation (EOD)
During the EOD ritual, the AI must perform a Dual-Update:
- Record the verbatim session anchor in
walkthrough.md. - Refine or update the relevant Palace Closets with the session's distilled outputs.
- Ensure the Registry reflects any new rooms created.
๐ฅ 5. The Ingestion Loop (Adding Knowledge)
To ensure the Palace remains a living entity, new knowledge must follow the Spatial Ingestion Loop:
- Categorisation: Determine the Wing (Domain) and Hall (Type).
- Closet Update: Modify the relevant
closet.md. Use high-density, substance-rich Markdown. - Cross-Linking: Link the new closet entry to the specific line in the Chronological Drawer (
walkthrough.md) where the discovery happened. - Registry Sync: If a new Room was created, update
palace_registry.md.
๐ 6. Git Reflection Mandate
"No code change is complete without its shadow in the Palace."
To keep the Brain in sync with the repository state:
- Post-Commit Reflection: After every
git commit, the AI should ask: "Which Palace Room does this change affect?" - Semantic Mapping: The AI must update the corresponding
closet.mdto reflect the new technical state (e.g., version upgrades, new dependencies, logic refactors). - Ledger Alignment: Ensure
HISTORY.mdand the Palacehall_eventsare reconciled during the EOD ritual.
โ๏ธ 7. The Sovereign Laws of the Palace
- Plain Markdown Mandate: The Palace MUST remain in plain, human-legible Markdown. No proprietary encoding or lossy compression (AAAK) is permitted unless explicitly authorized.
- Universal Search: Every closet must link to the original drawer (verbatim log) to prevent AI hallucination.
- Git Sovereignty: Every Palace move (directory creation/closet update) must be versioned and committed.
---
Created by Harisfazillah Jamel | Lead Architect of DSOM | Protocol v6.1 | Inspired by and originated from milla-jovovich/mempalace
๐ 8. Evolution to Sovereign Workspace v2 (OKF & Agent Skills)
In DSOM Protocol v6.2+, the Palace evolved from a static markdown tree (.agent) to the dynamic Sovereign Workspace v2 (.agents). This upgrade introduced two critical capabilities:
- Open Knowledge Format (OKF) v0.1: All
closet.mdfiles now require strict YAML frontmatter. This transforms the Palace from human-readable text into a machine-indexable database, allowing AI to instantly parsetype,title, anddescriptionwithout reading the body text. - Self-Healing Agent Skills: Automation scripts (
.sh,.ps1) are fragile. Workspace v2 introduced.agents/skills/. Each skill is an OKF-compliantSKILL.mdfile that embeds its own operational logic. If a script is deleted, the AI reads theSKILL.mdto rebuild it from scratch, achieving true self-recovery.
Deep State of Mind (DSOM) For My AI Protocol | Harisfazillah Jamel (LinuxMalaysia) | 2026-07-04 Standard: UK English | DBP-standard Bahasa Melayu Malaysia (Piawai) | GNU General Public License v3.0