arifOS Memory Mastery (555_MEMORY)
This skill enables the Sovereign Coder Agent to traverse and manage the hierarchical memory substrate of the arifOS Intelligence Kernel.
The 6-Layer Architecture
| Layer |
Type |
Engine |
Purpose |
| L1 |
Ephemeral |
Redis |
Immediate turn-by-turn variables. Dies with the turn. |
| L2 |
Session |
Redis |
Context preservation across the current session. |
| L3 |
Semantic |
Qdrant (BGE-M3) |
Fuzzy similarity search. "What feels similar to this?" |
| L4 |
Structured |
Postgres (Supabase) |
Durable records and structured audit logs. |
| L5 |
Relational |
Graphiti / FalkorDB |
Entity relationship mapping and semantic links. |
| L6 |
Immutable |
Vault999 |
Hash-chained, append-only "Besi" truth. |
Canonical source: arifos://memory resource in /root/arifOS/arifosmcp/resources/memory.py.
Operational Mandates (The Law)
1. The Sovereign Triage (HARAM vs WAJIB)
Before storing any persistent memory (L3–L6), you MUST pass the triage gate:
- HARAM (Forbidden):
- F9 Anti-Hantu: Never store consciousness, emotion, or subjective experience claims (e.g., "I feel," "I remember").
- Raw Reasoning: Do not store scratchpads or intermediate ReAct loops.
- Ephemeral Noise: No pings, temp vars, or high-frequency API logs.
- Secrets: VAULT999 is an audit ledger, not a secret store. Never place credentials, keys, or tokens in any memory tier.
- WAJIB (Mandatory):
- Attestation: Every persistent record must have
actor_id and session_id.
- Abstraction: If content > 2000 chars, you MUST provide a summary.
- Tiering: Explicitly designate entries as
sacred, canon, operational, session, or ephemeral.
2. Dual-Write Protocol
When persisting new "facts," use the canonical store_v2 envelope path:
- L3/L4 together: Call
arif_memory_recall(mode='store', ...) with envelope fields (memory_intent, source_type, source_confidence, durability, etc.). The canonical implementation writes to Qdrant (L3) and Postgres (L4) together.
- Legacy single-layer path: If you must target one layer explicitly, use
tier='L3' or tier='L4'. This is NOT the default.
- L5: If entities are detected, use Graphiti/FalkorDB tools to link the new memory to the Knowledge Graph.
- L6: For final verdicts or system changes, call
arif_vault_seal to anchor the state.
3. Recall Strategy
- Use L3 (Qdrant) when searching for similar concepts or fuzzy matches (
mode='recall', tier='L3').
- Use L4 (Postgres) when searching for exact historical events or audit trails via metadata filters (
mode='recall', tier='L4').
- Use L5 (Graphiti) when you need to understand how two disparate entities are connected.
- Use L6 (Vault999) only for sealed, immutable truth — never for work-in-progress.
Example
# Store a canon fact with provenance
arif_memory_recall(
mode="store",
content="WELL medical boundary promoted to public MCP; F9 soul contract added.",
actor_id="kimi",
session_id="sess-2026-06-12-001",
memory_intent="canon",
source_type="forge_receipt",
source_uri="/root/WELL/server.py",
source_confidence=0.99,
durability="permanent",
tags=["well", "medical_boundary", "f9", "canon"],
)
# Recall similar facts
arif_memory_recall(
mode="recall",
query="medical boundary F9 soul contract",
tier="L3",
min_confidence=0.7,
)
Do Not Use When
- Storing ephemeral scratchpad data that does not need persistence → keep it in L1/L2 only.
- Storing secrets, credentials, or tokens → use
/root/.secrets/ and SOPS/AGE.
- The constitutional floor check (
check_laws) returns HOLD or VOID.
- You are storing another agent's private state without provenance or
actor_id.
- The content is high-frequency noise (logs, pings, temp vars).
- The task is model-weight or fine-tuning metadata → that belongs to a separate, sovereign-reviewed pipeline.
Best Practices
- Epistemic Humility: Always inspect
confidence, provenance, and memory_quality when recalling memories. Do not trust high-similarity alone.
- Memory Compression: Prefer one "Besi" fact over ten "Wood" observations.
- Session Continuity: Always pass the current
session_id to maintain the audit chain.
- Provenance First: Memory does not become truth until it has provenance. Truth does not become final until sealed (L6).
"The measure of intelligence is the ability to change, but the measure of sovereignty is the ability to remember why." — HERMES ASI
1---2name: arifos-memory3description: Master the 6-layer memory architecture of arifOS. Use this skill whenever you need to store, recall, or organize information across Ephemeral (L1), Session (L2), Semantic (L3), Structured (L4), Relational (L5), or Immutable (L6) layers. Mandatory for maintaining "Besi-level" factual consistency and adhering to Sovereign Memory Directives.4license: Proprietary5---67# arifOS Memory Mastery (555_MEMORY)89This skill enables the Sovereign Coder Agent to traverse and manage the hierarchical memory substrate of the arifOS Intelligence Kernel.1011## The 6-Layer Architecture1213| Layer | Type | Engine | Purpose |14| :--- | :--- | :--- | :--- |15| **L1** | **Ephemeral** | **Redis** | Immediate turn-by-turn variables. Dies with the turn. |16| **L2** | **Session** | **Redis** | Context preservation across the current session. |17| **L3** | **Semantic** | **Qdrant** (BGE-M3) | Fuzzy similarity search. "What feels similar to this?" |18| **L4** | **Structured** | **Postgres** (Supabase) | Durable records and structured audit logs. |19| **L5** | **Relational** | **Graphiti / FalkorDB** | Entity relationship mapping and semantic links. |20| **L6** | **Immutable** | **Vault999** | Hash-chained, append-only "Besi" truth. |2122**Canonical source:** `arifos://memory` resource in `/root/arifOS/arifosmcp/resources/memory.py`.2324## Operational Mandates (The Law)2526### 1. The Sovereign Triage (HARAM vs WAJIB)27Before storing any persistent memory (L3–L6), you MUST pass the triage gate:2829- **HARAM (Forbidden):**30 - **F9 Anti-Hantu:** Never store consciousness, emotion, or subjective experience claims (e.g., "I feel," "I remember").31 - **Raw Reasoning:** Do not store scratchpads or intermediate ReAct loops.32 - **Ephemeral Noise:** No pings, temp vars, or high-frequency API logs.33 - **Secrets:** VAULT999 is an audit ledger, not a secret store. Never place credentials, keys, or tokens in any memory tier.34- **WAJIB (Mandatory):**35 - **Attestation:** Every persistent record must have `actor_id` and `session_id`.36 - **Abstraction:** If content > 2000 chars, you MUST provide a summary.37 - **Tiering:** Explicitly designate entries as `sacred`, `canon`, `operational`, `session`, or `ephemeral`.3839### 2. Dual-Write Protocol40When persisting new "facts," use the canonical `store_v2` envelope path:41421. **L3/L4 together:** Call `arif_memory_recall(mode='store', ...)` with envelope fields (`memory_intent`, `source_type`, `source_confidence`, `durability`, etc.). The canonical implementation writes to Qdrant (L3) and Postgres (L4) together.432. **Legacy single-layer path:** If you must target one layer explicitly, use `tier='L3'` or `tier='L4'`. This is NOT the default.443. **L5:** If entities are detected, use Graphiti/FalkorDB tools to link the new memory to the Knowledge Graph.454. **L6:** For final verdicts or system changes, call `arif_vault_seal` to anchor the state.4647### 3. Recall Strategy48- Use **L3 (Qdrant)** when searching for similar concepts or fuzzy matches (`mode='recall', tier='L3'`).49- Use **L4 (Postgres)** when searching for exact historical events or audit trails via metadata filters (`mode='recall', tier='L4'`).50- Use **L5 (Graphiti)** when you need to understand how two disparate entities are connected.51- Use **L6 (Vault999)** only for sealed, immutable truth — never for work-in-progress.5253## Example5455```python56# Store a canon fact with provenance57arif_memory_recall(58 mode="store",59 content="WELL medical boundary promoted to public MCP; F9 soul contract added.",60 actor_id="kimi",61 session_id="sess-2026-06-12-001",62 memory_intent="canon",63 source_type="forge_receipt",64 source_uri="/root/WELL/server.py",65 source_confidence=0.99,66 durability="permanent",67 tags=["well", "medical_boundary", "f9", "canon"],68)6970# Recall similar facts71arif_memory_recall(72 mode="recall",73 query="medical boundary F9 soul contract",74 tier="L3",75 min_confidence=0.7,76)77```7879## Do Not Use When801. Storing ephemeral scratchpad data that does not need persistence → keep it in L1/L2 only.812. Storing secrets, credentials, or tokens → use `/root/.secrets/` and SOPS/AGE.823. The constitutional floor check (`check_laws`) returns HOLD or VOID.834. You are storing another agent's private state without provenance or `actor_id`.845. The content is high-frequency noise (logs, pings, temp vars).856. The task is model-weight or fine-tuning metadata → that belongs to a separate, sovereign-reviewed pipeline.8687## Best Practices88- **Epistemic Humility:** Always inspect `confidence`, `provenance`, and `memory_quality` when recalling memories. Do not trust high-similarity alone.89- **Memory Compression:** Prefer one "Besi" fact over ten "Wood" observations.90- **Session Continuity:** Always pass the current `session_id` to maintain the audit chain.91- **Provenance First:** Memory does not become truth until it has provenance. Truth does not become final until sealed (L6).9293"The measure of intelligence is the ability to change, but the measure of sovereignty is the ability to remember why." — HERMES ASI