From 355f10964c4dbec24a244a00caba5c17ed23fc65 Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Thu, 12 Feb 2026 02:29:45 +0000
Subject: makima: Add an optional memory system for directives (#59)

* feat: makima: Add an optional memory system for directives: Add directive_memories database table and migration

* feat: makima: Add an optional memory system for directives: Update directive skill documentation with memory commands

* feat: makima: Add an optional memory system for directives: Add repository functions for directive memory CRUD

* feat: makima: Add an optional memory system for directives: Add frontend API functions and types for directive memory

* feat: makima: Add an optional memory system for directives: Add Rust models for directive memory

* WIP: heartbeat checkpoint

* WIP: heartbeat checkpoint

* WIP: heartbeat checkpoint

* WIP: heartbeat checkpoint

* feat: makima: Add an optional memory system for directives: Add memory panel to frontend DirectiveDetail component

* Merge remote-tracking branch 'origin/makima/makima--add-an-optional-memory-system-for-directiv-5de1e06d' into combined branch

* Merge remote-tracking branch 'origin/makima/makima--add-an-optional-memory-system-for-directiv-c8298c6c' into combined branch

* feat: makima: Add an optional memory system for directives: Create useMultiTaskSubscription hook for multi-output WebSocket streaming

* feat: makima: Add an optional memory system for directives: Create DirectiveLogStream component for stern-like multi-task output viewing

* feat: makima: Add an optional memory system for directives: Integrate log stream panel into directive detail page
---
 .../20260211000000_add_directive_memories.sql        | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 makima/migrations/20260211000000_add_directive_memories.sql

(limited to 'makima/migrations/20260211000000_add_directive_memories.sql')

diff --git a/makima/migrations/20260211000000_add_directive_memories.sql b/makima/migrations/20260211000000_add_directive_memories.sql
new file mode 100644
index 0000000..69d00bf
--- /dev/null
+++ b/makima/migrations/20260211000000_add_directive_memories.sql
@@ -0,0 +1,20 @@
+-- Directive memory system: optional key-value storage scoped to a directive.
+-- Allows directives to persist learnings, decisions, and context across steps.
+
+-- Add memory_enabled flag to directives
+ALTER TABLE directives ADD COLUMN memory_enabled BOOLEAN NOT NULL DEFAULT false;
+
+-- Key-value memory entries scoped to a directive
+CREATE TABLE directive_memories (
+    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
+    directive_id UUID NOT NULL REFERENCES directives(id) ON DELETE CASCADE,
+    key VARCHAR(255) NOT NULL,
+    value TEXT NOT NULL,
+    category VARCHAR(100),
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    UNIQUE(directive_id, key)
+);
+
+CREATE INDEX idx_directive_memories_directive_id ON directive_memories(directive_id);
+CREATE INDEX idx_directive_memories_category ON directive_memories(directive_id, category);
-- 
cgit v1.2.3

