memory-lucia 2.5.1 → 2.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -104,7 +104,7 @@ SQLite backend with tables:
104
104
 
105
105
  ## 📋 Version
106
106
 
107
- Current: 2.5.1
107
+ Current: 2.5.2
108
108
 
109
109
  ## 📄 License
110
110
 
package/SKILL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: memory-lucia
3
- version: 2.5.1
3
+ version: 2.5.2
4
4
  description: |
5
5
  Memory Lucia V2.5 - Advanced memory system with hybrid query, enhanced learning tracking,
6
6
  autonomous decision recording, and skill evolution monitoring.
@@ -1,29 +1,37 @@
1
- -- Memory V2.0 Database Schema
2
- -- SQLite database schema for OpenClaw Memory System
1
+ -- Memory V2.5 Database Schema
2
+ -- SQLite database schema for Memory Lucia V2.5
3
3
 
4
4
  -- Priority Analysis Table
5
5
  CREATE TABLE IF NOT EXISTS memory_priorities (
6
6
  id INTEGER PRIMARY KEY AUTOINCREMENT,
7
- msg_id TEXT NOT NULL,
8
- conv_id TEXT,
9
- priority_level TEXT CHECK(priority_level IN ('critical', 'high', 'medium', 'low')),
10
- reasoning TEXT,
11
- category TEXT,
12
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
7
+ message_id TEXT NOT NULL,
8
+ conversation_id INTEGER,
9
+ priority_level INTEGER CHECK(priority_level BETWEEN 1 AND 4),
10
+ importance_score REAL DEFAULT 0,
11
+ keywords TEXT,
12
+ context_summary TEXT,
13
+ auto_detected BOOLEAN DEFAULT 0,
14
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
15
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
13
16
  );
14
17
 
15
18
  -- Learning Tracking Table
16
19
  CREATE TABLE IF NOT EXISTS memory_learning (
17
20
  id INTEGER PRIMARY KEY AUTOINCREMENT,
18
- msg_id TEXT NOT NULL,
19
- conv_id TEXT,
20
- topic TEXT,
21
- description TEXT,
22
- status TEXT CHECK(status IN ('active', 'paused', 'completed', 'abandoned')) DEFAULT 'active',
23
- progress INTEGER DEFAULT 0 CHECK(progress >= 0 AND progress <= 100),
24
- started_at DATETIME DEFAULT CURRENT_TIMESTAMP,
25
- updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
26
- completed_at DATETIME
21
+ message_id TEXT NOT NULL,
22
+ conversation_id INTEGER,
23
+ learning_topic TEXT NOT NULL,
24
+ topic_category TEXT,
25
+ progress_status TEXT CHECK(progress_status IN ('not_started', 'started', 'in_progress', 'completed', 'on_hold')),
26
+ progress_percentage INTEGER DEFAULT 0 CHECK(progress_percentage BETWEEN 0 AND 100),
27
+ estimated_completion_date DATETIME,
28
+ actual_completion_date DATETIME,
29
+ milestone_count INTEGER DEFAULT 0,
30
+ completed_milestones INTEGER DEFAULT 0,
31
+ resources TEXT,
32
+ notes TEXT,
33
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
34
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
27
35
  );
28
36
 
29
37
  -- Learning Milestones Table
@@ -32,54 +40,101 @@ CREATE TABLE IF NOT EXISTS memory_learning_milestones (
32
40
  learning_id INTEGER NOT NULL,
33
41
  title TEXT NOT NULL,
34
42
  description TEXT,
35
- achieved_at DATETIME DEFAULT CURRENT_TIMESTAMP,
43
+ status TEXT DEFAULT 'pending',
44
+ target_date DATETIME,
45
+ completed_at DATETIME,
46
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
36
47
  FOREIGN KEY (learning_id) REFERENCES memory_learning(id) ON DELETE CASCADE
37
48
  );
38
49
 
39
50
  -- Decision Records Table
40
51
  CREATE TABLE IF NOT EXISTS memory_decisions (
41
52
  id INTEGER PRIMARY KEY AUTOINCREMENT,
42
- msg_id TEXT NOT NULL,
43
- conv_id TEXT,
44
- summary TEXT NOT NULL,
45
- context TEXT,
53
+ message_id TEXT NOT NULL,
54
+ conversation_id INTEGER,
55
+ decision_type TEXT,
56
+ decision_question TEXT NOT NULL,
57
+ decision_context TEXT,
58
+ options_considered TEXT,
59
+ chosen_option TEXT,
60
+ rationale TEXT,
61
+ confidence_level INTEGER CHECK(confidence_level BETWEEN 1 AND 5),
46
62
  expected_outcome TEXT,
47
63
  actual_outcome TEXT,
48
- status TEXT CHECK(status IN ('pending', 'implemented', 'validated', 'rejected')) DEFAULT 'pending',
49
- review_scheduled_at DATETIME,
64
+ outcome_status TEXT CHECK(outcome_status IN ('pending', 'implemented', 'validated', 'rejected')),
65
+ review_date DATETIME,
50
66
  reviewed_at DATETIME,
51
- created_at DATETIME DEFAULT CURRENT_TIMESTAMP
67
+ review_notes TEXT,
68
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
69
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
52
70
  );
53
71
 
54
72
  -- Skill Evolution Table
55
73
  CREATE TABLE IF NOT EXISTS memory_evolution (
56
74
  id INTEGER PRIMARY KEY AUTOINCREMENT,
57
75
  skill_name TEXT NOT NULL,
58
- category TEXT,
76
+ skill_category TEXT,
77
+ proficiency_level INTEGER DEFAULT 1 CHECK(proficiency_level BETWEEN 1 AND 10),
78
+ experience_points INTEGER DEFAULT 0,
59
79
  usage_count INTEGER DEFAULT 0,
60
80
  success_count INTEGER DEFAULT 0,
81
+ failure_count INTEGER DEFAULT 0,
61
82
  last_used_at DATETIME,
62
- first_used_at DATETIME DEFAULT CURRENT_TIMESTAMP
83
+ first_used_at DATETIME DEFAULT CURRENT_TIMESTAMP,
84
+ performance_metrics TEXT,
85
+ improvement_areas TEXT,
86
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
87
+ updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
63
88
  );
64
89
 
65
- -- Database Version Tracking
66
- CREATE TABLE IF NOT EXISTS memory_schema_version (
67
- version TEXT PRIMARY KEY,
68
- applied_at DATETIME DEFAULT CURRENT_TIMESTAMP
90
+ -- Skill Evolution History Table
91
+ CREATE TABLE IF NOT EXISTS memory_evolution_history (
92
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
93
+ skill_id INTEGER NOT NULL,
94
+ event_type TEXT NOT NULL,
95
+ event_data TEXT,
96
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
97
+ FOREIGN KEY (skill_id) REFERENCES memory_evolution(id) ON DELETE CASCADE
69
98
  );
70
99
 
71
- -- Insert initial version
72
- INSERT OR IGNORE INTO memory_schema_version (version) VALUES ('2.0.0');
100
+ -- Version Management Table
101
+ CREATE TABLE IF NOT EXISTS memory_versions (
102
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
103
+ version_name TEXT NOT NULL,
104
+ version_type TEXT,
105
+ description TEXT,
106
+ backup_path TEXT,
107
+ backup_size INTEGER,
108
+ checksum TEXT,
109
+ is_active BOOLEAN DEFAULT 0,
110
+ migration_script TEXT,
111
+ rollback_script TEXT,
112
+ created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
113
+ activated_at DATETIME
114
+ );
115
+
116
+ -- Version Statistics Table
117
+ CREATE TABLE IF NOT EXISTS memory_version_stats (
118
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
119
+ version_id INTEGER,
120
+ stat_name TEXT,
121
+ stat_value INTEGER,
122
+ recorded_at DATETIME DEFAULT CURRENT_TIMESTAMP
123
+ );
73
124
 
74
125
  -- Create indexes for performance
75
126
  CREATE INDEX IF NOT EXISTS idx_priorities_level ON memory_priorities(priority_level);
76
127
  CREATE INDEX IF NOT EXISTS idx_priorities_created ON memory_priorities(created_at);
77
- CREATE INDEX IF NOT EXISTS idx_learning_status ON memory_learning(status);
78
- CREATE INDEX IF NOT EXISTS idx_learning_topic ON memory_learning(topic);
79
- CREATE INDEX IF NOT EXISTS idx_decisions_status ON memory_decisions(status);
80
- CREATE INDEX IF NOT EXISTS idx_decisions_review ON memory_decisions(review_scheduled_at);
128
+ CREATE INDEX IF NOT EXISTS idx_learning_status ON memory_learning(progress_status);
129
+ CREATE INDEX IF NOT EXISTS idx_learning_topic ON memory_learning(learning_topic);
130
+ CREATE INDEX IF NOT EXISTS idx_decisions_status ON memory_decisions(outcome_status);
131
+ CREATE INDEX IF NOT EXISTS idx_decisions_review ON memory_decisions(review_date);
81
132
  CREATE INDEX IF NOT EXISTS idx_evolution_skill ON memory_evolution(skill_name);
82
- CREATE INDEX IF NOT EXISTS idx_evolution_category ON memory_evolution(category);
133
+ CREATE INDEX IF NOT EXISTS idx_evolution_category ON memory_evolution(skill_category);
134
+
135
+ -- Insert initial version
136
+ INSERT OR IGNORE INTO memory_versions (version_name, version_type, description, is_active)
137
+ VALUES ('2.5.0', 'initial', 'Memory V2.5 Initial Version', 1);
83
138
 
84
139
  -- Views for common queries
85
140
 
@@ -88,65 +143,72 @@ CREATE VIEW IF NOT EXISTS v_pending_decisions AS
88
143
  SELECT
89
144
  d.*,
90
145
  CASE
91
- WHEN review_scheduled_at < CURRENT_TIMESTAMP THEN 'overdue'
92
- WHEN review_scheduled_at <= datetime('now', '+7 days') THEN 'due_soon'
146
+ WHEN review_date < datetime('now') THEN 'overdue'
147
+ WHEN review_date <= datetime('now', '+7 days') THEN 'due_soon'
93
148
  ELSE 'scheduled'
94
149
  END as review_status
95
150
  FROM memory_decisions d
96
- WHERE status IN ('pending', 'implemented')
97
- AND (review_scheduled_at IS NULL OR review_scheduled_at <= datetime('now', '+7 days'))
98
- ORDER BY review_scheduled_at ASC;
151
+ WHERE outcome_status IN ('pending', 'implemented')
152
+ AND (review_date IS NULL OR review_date <= datetime('now', '+7 days'))
153
+ ORDER BY review_date ASC;
99
154
 
100
155
  -- View: Skill Summary
101
156
  CREATE VIEW IF NOT EXISTS v_skill_summary AS
102
157
  SELECT
103
158
  skill_name,
104
- category,
159
+ skill_category,
105
160
  usage_count,
106
161
  success_count,
107
162
  CASE
108
163
  WHEN usage_count > 0 THEN ROUND(100.0 * success_count / usage_count, 2)
109
164
  ELSE 0
110
165
  END as success_rate,
166
+ proficiency_level,
167
+ experience_points,
111
168
  last_used_at,
112
169
  first_used_at
113
170
  FROM memory_evolution
114
171
  ORDER BY usage_count DESC;
115
172
 
116
- -- View: Weekly Learning Report
117
- CREATE VIEW IF NOT EXISTS v_weekly_learning_report AS
173
+ -- View: Active Learning
174
+ CREATE VIEW IF NOT EXISTS v_active_learning AS
118
175
  SELECT
119
- topic,
120
- COUNT(*) as session_count,
121
- AVG(progress) as avg_progress,
122
- MAX(updated_at) as last_activity,
123
- SUM(CASE WHEN status = 'completed' THEN 1 ELSE 0 END) as completed_count
124
- FROM memory_learning
125
- WHERE updated_at >= datetime('now', '-7 days')
126
- GROUP BY topic
127
- ORDER BY last_activity DESC;
176
+ l.*,
177
+ CASE
178
+ WHEN progress_percentage = 0 THEN 'not_started'
179
+ WHEN progress_percentage < 50 THEN 'early_stage'
180
+ WHEN progress_percentage < 100 THEN 'in_progress'
181
+ ELSE 'completed'
182
+ END as stage
183
+ FROM memory_learning l
184
+ WHERE progress_status IN ('started', 'in_progress')
185
+ ORDER BY updated_at DESC;
128
186
 
129
187
  -- View: High Priority Items
130
188
  CREATE VIEW IF NOT EXISTS v_high_priority AS
131
189
  SELECT
132
190
  'priority' as type,
133
191
  id,
134
- msg_id,
192
+ message_id,
135
193
  priority_level as level,
136
- category,
137
- reasoning as details,
194
+ importance_score,
195
+ context_summary as details,
138
196
  created_at
139
197
  FROM memory_priorities
140
- WHERE priority_level IN ('critical', 'high')
198
+ WHERE priority_level <= 2
141
199
  UNION ALL
142
200
  SELECT
143
201
  'decision' as type,
144
202
  id,
145
- msg_id,
146
- status as level,
147
- 'decision' as category,
148
- summary as details,
203
+ message_id,
204
+ CASE outcome_status
205
+ WHEN 'pending' THEN 1
206
+ WHEN 'implemented' THEN 2
207
+ ELSE 3
208
+ END as level,
209
+ confidence_level as importance_score,
210
+ decision_question as details,
149
211
  created_at
150
212
  FROM memory_decisions
151
- WHERE status = 'pending' AND review_scheduled_at <= CURRENT_TIMESTAMP
213
+ WHERE outcome_status = 'pending' AND review_date <= datetime('now', '+7 days')
152
214
  ORDER BY created_at DESC;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memory-lucia",
3
- "version": "2.5.1",
3
+ "version": "2.5.2",
4
4
  "description": "Advanced memory system for OpenClaw agents with priority analysis, learning tracking, decision recording, and skill evolution",
5
5
  "main": "api/index.js",
6
6
  "scripts": {
package/check-db.js DELETED
@@ -1,13 +0,0 @@
1
- const sqlite3 = require('sqlite3').verbose();
2
- const db = new sqlite3.Database('../memory-v2/memory-v2.5.db');
3
-
4
- // Check memory_decisions table structure
5
- db.all("PRAGMA table_info(memory_decisions)", (err, rows) => {
6
- if (err) {
7
- console.error('Error:', err);
8
- } else {
9
- console.log('memory_decisions columns:');
10
- rows.forEach(r => console.log('- ' + r.name + ' (' + r.type + ')'));
11
- }
12
- db.close();
13
- });