ari-memory-management
ARI's provenance-tracked memory system for knowledge persistence
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
ARI's provenance-tracked memory system for knowledge persistence
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Discord slash commands, approval routing, channel policy, button interaction patterns for OpenClaw/ARI Discord integration
Obsidian vault integration patterns โ vault-analyzer.ts, /ari-vault-* commands, morning briefing snippet, PARA structure, read-only enforcement
OpenClaw plugin development patterns โ hooks, manifest structure, plugin SDK, APEX/CODEX enforcement
NOVA's P1 PayThePryce pipeline โ market signal ingest, card detection, price monitoring, script generation, thumbnail generation, video assembly, approval gate
CHASE's P2 Pryceless Solutions pipeline โ lead discovery, 5-criteria audit, LLM qualification, Prompt Forge 4-pass lock, demo generation, outreach approval gate
NOVA's thumbnail generation pipeline โ Ideogram V3 via Fal.ai (primary) + DALL-E 3 fallback, 4-variant strategy, Pokemon TCG copyright rules,
| name | ari-memory-management |
| description | ARI's provenance-tracked memory system for knowledge persistence |
| triggers | ["memory storage","store knowledge","memory manager","provenance tracking"] |
Manage ARI's provenance-tracked memory system for persistent knowledge storage with full audit trails.
~/.ari/
โโโ memory/
โ โโโ facts/ # Verified facts
โ โโโ contexts/ # Domain contexts
โ โโโ preferences/ # User preferences
โ โโโ learned/ # Learned patterns
โโโ audit.json # Hash-chained audit
โโโ config.json # Configuration
Every piece of stored knowledge includes provenance:
interface MemoryEntry {
id: string;
content: unknown;
provenance: {
source: string; // Where it came from
trustLevel: TrustLevel; // Trust at storage time
timestamp: string; // When stored
agent: string; // Which agent stored it
validation: {
method: string; // How it was validated
confidence: number; // Confidence score 0-1
};
};
metadata: {
domain: string; // Life domain (health, career, etc.)
tags: string[]; // Searchable tags
expiresAt?: string; // Optional expiration
};
}
async function store(
key: string,
content: unknown,
options: StoreOptions
): Promise<MemoryEntry> {
const entry: MemoryEntry = {
id: uuid(),
content,
provenance: {
source: options.source,
trustLevel: options.trustLevel || 'STANDARD',
timestamp: new Date().toISOString(),
agent: options.agent,
validation: options.validation || { method: 'none', confidence: 0.5 }
},
metadata: options.metadata || {}
};
// Audit the storage operation
await eventBus.emit('audit:log', {
action: 'memory_store',
key,
entryId: entry.id,
provenance: entry.provenance
});
await persist(key, entry);
return entry;
}
async function retrieve(
key: string,
options: RetrieveOptions = {}
): Promise<MemoryEntry | null> {
const entry = await load(key);
if (!entry) return null;
// Check trust requirements
if (options.minTrust && !meetsMinTrust(entry.provenance.trustLevel, options.minTrust)) {
logger.warn({ key, entryTrust: entry.provenance.trustLevel },
'Entry below minimum trust');
return null;
}
// Check expiration
if (entry.metadata.expiresAt && new Date(entry.metadata.expiresAt) < new Date()) {
await remove(key);
return null;
}
// Audit the retrieval
await eventBus.emit('audit:log', {
action: 'memory_retrieve',
key,
entryId: entry.id
});
return entry;
}
async function search(query: SearchQuery): Promise<MemoryEntry[]> {
const results = await searchIndex({
domain: query.domain,
tags: query.tags,
minConfidence: query.minConfidence,
minTrust: query.minTrust
});
// Filter and sort by relevance
return results
.filter(e => passesFilters(e, query))
.sort((a, b) => b.provenance.validation.confidence - a.provenance.validation.confidence);
}
ARI organizes memory by life domains:
| Domain | Purpose |
|---|---|
health | Health and wellness data |
career | Professional information |
finance | Financial data |
family | Family and relationships |
learning | Educational content |
systems | Technical systems |
ventures | Business ventures |
// Store in specific domain
await memoryManager.store('workout_routine', routineData, {
metadata: { domain: 'health', tags: ['exercise', 'daily'] }
});
// Search within domain
const healthMemories = await memoryManager.search({
domain: 'health',
tags: ['exercise']
});
Each venture has isolated memory partition:
const ventureMemory = await memoryManager.getPartition('my-venture');
// Operations within partition
await ventureMemory.store('client_list', clients);
await ventureMemory.retrieve('client_list');
// Cannot access other partitions
await ventureMemory.retrieve('personal_health'); // Returns null
CREATE โ VALIDATE โ STORE โ INDEX โ (RETRIEVE)* โ EXPIRE/DELETE
โ
AUDIT (every step)
// Periodic cleanup
async function gc() {
const expired = await findExpired();
const lowConfidence = await findLowConfidence(0.3);
for (const entry of [...expired, ...lowConfidence]) {
await archive(entry); // Move to archive before deletion
await remove(entry.id);
}
await eventBus.emit('audit:log', {
action: 'memory_gc',
removed: expired.length + lowConfidence.length
});
}
# Backup memory
npx ari memory export --output backup.json
# Restore memory
npx ari memory import --input backup.json
# Verify integrity
npx ari memory verify