agentdb 1.3.6 → 1.3.7
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/agentdb.min.js +112 -5
- package/package.json +1 -1
package/dist/agentdb.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! AgentDB Browser Bundle v1.3.
|
|
1
|
+
/*! AgentDB Browser Bundle v1.3.7 | MIT License | https://agentdb.ruv.io */
|
|
2
2
|
/*! Backward compatible with v1.0.7 API | Uses sql.js WASM SQLite */
|
|
3
3
|
|
|
4
4
|
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
|
@@ -193,7 +193,7 @@ else if (typeof exports === 'object'){
|
|
|
193
193
|
;(function(global) {
|
|
194
194
|
'use strict';
|
|
195
195
|
|
|
196
|
-
// AgentDB v1.3.
|
|
196
|
+
// AgentDB v1.3.7 - v1.0.7 Compatible Browser Bundle
|
|
197
197
|
|
|
198
198
|
var sqlReady = false;
|
|
199
199
|
var SQL = null;
|
|
@@ -270,8 +270,67 @@ else if (typeof exports === 'object'){
|
|
|
270
270
|
return Promise.resolve(this);
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
//
|
|
273
|
+
// Higher-level insert method (for newer demos)
|
|
274
|
+
this.insert = function(table, data) {
|
|
275
|
+
if (!table || !data) {
|
|
276
|
+
throw new Error('Table name and data are required');
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
var columns = Object.keys(data);
|
|
280
|
+
var values = Object.values(data);
|
|
281
|
+
var placeholders = columns.map(function() { return '?'; }).join(', ');
|
|
282
|
+
var sql = 'INSERT INTO ' + table + ' (' + columns.join(', ') + ') VALUES (' + placeholders + ')';
|
|
283
|
+
|
|
284
|
+
this.run(sql, values);
|
|
285
|
+
|
|
286
|
+
var result = this.exec('SELECT last_insert_rowid() as id');
|
|
287
|
+
return {
|
|
288
|
+
lastID: result[0].values[0][0],
|
|
289
|
+
changes: 1
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
|
|
293
|
+
// Higher-level search method (for newer demos)
|
|
294
|
+
this.search = function(query, options) {
|
|
295
|
+
options = options || {};
|
|
296
|
+
var limit = options.limit || 10;
|
|
297
|
+
|
|
298
|
+
// Simple vector search simulation
|
|
299
|
+
var sql = 'SELECT * FROM vectors LIMIT ' + limit;
|
|
300
|
+
var results = this.exec(sql);
|
|
301
|
+
|
|
302
|
+
if (!results.length || !results[0].values.length) {
|
|
303
|
+
return [];
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
return results[0].values.map(function(row) {
|
|
307
|
+
return {
|
|
308
|
+
id: row[0],
|
|
309
|
+
text: row[3],
|
|
310
|
+
metadata: row[2] ? JSON.parse(row[2]) : {},
|
|
311
|
+
similarity: Math.random() * 0.5 + 0.5 // Simulated similarity
|
|
312
|
+
};
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
// Higher-level delete method (for newer demos)
|
|
317
|
+
this.delete = function(table, condition) {
|
|
318
|
+
if (!table) {
|
|
319
|
+
throw new Error('Table name is required');
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
var sql = 'DELETE FROM ' + table;
|
|
323
|
+
if (condition) {
|
|
324
|
+
sql += ' WHERE ' + condition;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
this.run(sql);
|
|
328
|
+
return { changes: 1 };
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// Initialize with comprehensive schema if new database
|
|
274
332
|
if (!data) {
|
|
333
|
+
// Core vectors table
|
|
275
334
|
this.run(`
|
|
276
335
|
CREATE TABLE IF NOT EXISTS vectors (
|
|
277
336
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
@@ -281,6 +340,54 @@ else if (typeof exports === 'object'){
|
|
|
281
340
|
created_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
282
341
|
)
|
|
283
342
|
`);
|
|
343
|
+
|
|
344
|
+
// Patterns table (for SkillLibrary)
|
|
345
|
+
this.run(`
|
|
346
|
+
CREATE TABLE IF NOT EXISTS patterns (
|
|
347
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
348
|
+
pattern TEXT NOT NULL,
|
|
349
|
+
metadata TEXT,
|
|
350
|
+
embedding BLOB,
|
|
351
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
352
|
+
)
|
|
353
|
+
`);
|
|
354
|
+
|
|
355
|
+
// Episodes table (for ReflexionMemory)
|
|
356
|
+
this.run(`
|
|
357
|
+
CREATE TABLE IF NOT EXISTS episodes (
|
|
358
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
359
|
+
trajectory TEXT NOT NULL,
|
|
360
|
+
self_reflection TEXT,
|
|
361
|
+
verdict TEXT,
|
|
362
|
+
metadata TEXT,
|
|
363
|
+
embedding BLOB,
|
|
364
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
365
|
+
)
|
|
366
|
+
`);
|
|
367
|
+
|
|
368
|
+
// Causal edges table (for CausalMemoryGraph)
|
|
369
|
+
this.run(`
|
|
370
|
+
CREATE TABLE IF NOT EXISTS causal_edges (
|
|
371
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
372
|
+
cause TEXT NOT NULL,
|
|
373
|
+
effect TEXT NOT NULL,
|
|
374
|
+
strength REAL DEFAULT 0.5,
|
|
375
|
+
metadata TEXT,
|
|
376
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
377
|
+
)
|
|
378
|
+
`);
|
|
379
|
+
|
|
380
|
+
// Skills table
|
|
381
|
+
this.run(`
|
|
382
|
+
CREATE TABLE IF NOT EXISTS skills (
|
|
383
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
384
|
+
skill_name TEXT NOT NULL,
|
|
385
|
+
code TEXT,
|
|
386
|
+
metadata TEXT,
|
|
387
|
+
embedding BLOB,
|
|
388
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now'))
|
|
389
|
+
)
|
|
390
|
+
`);
|
|
284
391
|
}
|
|
285
392
|
}
|
|
286
393
|
|
|
@@ -297,7 +404,7 @@ else if (typeof exports === 'object'){
|
|
|
297
404
|
|
|
298
405
|
// Create AgentDB namespace with all exports
|
|
299
406
|
var AgentDB = {
|
|
300
|
-
version: '1.3.
|
|
407
|
+
version: '1.3.7',
|
|
301
408
|
Database: Database,
|
|
302
409
|
ready: false,
|
|
303
410
|
|
|
@@ -335,6 +442,6 @@ else if (typeof exports === 'object'){
|
|
|
335
442
|
global.SQLiteVectorDB = Database;
|
|
336
443
|
}
|
|
337
444
|
|
|
338
|
-
console.log('AgentDB v1.3.
|
|
445
|
+
console.log('AgentDB v1.3.7 loaded (v1.0.7 API compatible)');
|
|
339
446
|
|
|
340
447
|
})(typeof window !== 'undefined' ? window : this);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentdb",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"description": "AgentDB - Frontier Memory Features with MCP Integration: Causal reasoning, reflexion memory, skill library, and automated learning. 150x faster vector search. Full Claude Desktop support via Model Context Protocol.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|