agentdb 1.1.4 → 1.1.6
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/dist/cli/agentdb-cli.js
CHANGED
|
@@ -56,11 +56,18 @@ class AgentDBCLI {
|
|
|
56
56
|
this.db.pragma('journal_mode = WAL');
|
|
57
57
|
this.db.pragma('synchronous = NORMAL');
|
|
58
58
|
this.db.pragma('cache_size = -64000');
|
|
59
|
-
// Load
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// Load schemas (base + frontier)
|
|
60
|
+
const baseSchemaPath = path.join(__dirname, '../schemas/schema.sql');
|
|
61
|
+
const frontierSchemaPath = path.join(__dirname, '../schemas/frontier-schema.sql');
|
|
62
|
+
|
|
63
|
+
if (fs.existsSync(baseSchemaPath)) {
|
|
64
|
+
const baseSchema = fs.readFileSync(baseSchemaPath, 'utf-8');
|
|
65
|
+
this.db.exec(baseSchema);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (fs.existsSync(frontierSchemaPath)) {
|
|
69
|
+
const frontierSchema = fs.readFileSync(frontierSchemaPath, 'utf-8');
|
|
70
|
+
this.db.exec(frontierSchema);
|
|
64
71
|
}
|
|
65
72
|
// Initialize embedding service
|
|
66
73
|
this.embedder = new EmbeddingService({
|
|
@@ -87,9 +94,12 @@ class AgentDBCLI {
|
|
|
87
94
|
log.info(`Cause: ${params.cause}`);
|
|
88
95
|
log.info(`Effect: ${params.effect}`);
|
|
89
96
|
log.info(`Uplift: ${params.uplift}`);
|
|
90
|
-
const edgeId = this.causalGraph.
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
const edgeId = this.causalGraph.addCausalEdge({
|
|
98
|
+
fromMemoryId: 0,
|
|
99
|
+
fromMemoryType: params.cause,
|
|
100
|
+
toMemoryId: 0,
|
|
101
|
+
toMemoryType: params.effect,
|
|
102
|
+
similarity: 0,
|
|
93
103
|
uplift: params.uplift,
|
|
94
104
|
confidence: params.confidence || 0.95,
|
|
95
105
|
sampleSize: params.sampleSize || 0,
|
|
@@ -37,10 +37,10 @@ CREATE TABLE IF NOT EXISTS causal_edges (
|
|
|
37
37
|
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
38
38
|
last_validated_at INTEGER,
|
|
39
39
|
|
|
40
|
-
metadata JSON
|
|
40
|
+
metadata JSON
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
-- Note: Foreign keys removed to allow flexible causal edges between any concepts
|
|
43
|
+
-- from_memory_id and to_memory_id can be 0 for abstract causal relationships
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
CREATE INDEX IF NOT EXISTS idx_causal_edges_from ON causal_edges(from_memory_id, from_memory_type);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentdb",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "AgentDB - Frontier Memory Features: Causal reasoning, reflexion memory, skill library, explainable recall, and automated learning for AI agents. 150x faster vector search with HNSW indexing.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -37,10 +37,10 @@ CREATE TABLE IF NOT EXISTS causal_edges (
|
|
|
37
37
|
updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')),
|
|
38
38
|
last_validated_at INTEGER,
|
|
39
39
|
|
|
40
|
-
metadata JSON
|
|
40
|
+
metadata JSON
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
-- Note: Foreign keys removed to allow flexible causal edges between any concepts
|
|
43
|
+
-- from_memory_id and to_memory_id can be 0 for abstract causal relationships
|
|
44
44
|
);
|
|
45
45
|
|
|
46
46
|
CREATE INDEX IF NOT EXISTS idx_causal_edges_from ON causal_edges(from_memory_id, from_memory_type);
|