memories-lite 0.9.3 → 0.9.4

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.
@@ -33,6 +33,7 @@ class LiteVectorStore {
33
33
  const filename = this.isSecure ? `memories-lite-${currentUserId}.db` : `memories-lite-global.db`;
34
34
  this.dbPath = (config.rootPath == ':memory:') ? ':memory:' : path_1.default.join(config.rootPath, filename);
35
35
  // Add error handling callback for the database connection
36
+ console.log('--- DBG create LiteVectorStore::dbPath', this.dbPath);
36
37
  this.db = new sqlite3_1.default.Database(this.dbPath);
37
38
  }
38
39
  async init() {
@@ -142,11 +143,17 @@ class LiteVectorStore {
142
143
  }
143
144
  return cachedStore;
144
145
  }
145
- // Pass the full config (including scoring) to the constructor
146
- const newStore = new LiteVectorStore(config, hashedUserId);
147
- await newStore.init();
148
- LiteVectorStore.cache.set(hashedUserId, newStore);
149
- return newStore;
146
+ try {
147
+ // Pass the full config (including scoring) to the constructor
148
+ const newStore = new LiteVectorStore(config, hashedUserId);
149
+ await newStore.init();
150
+ LiteVectorStore.cache.set(hashedUserId, newStore);
151
+ return newStore;
152
+ }
153
+ catch (err) {
154
+ console.error('--- DBG LiteVectorStore::from error', err);
155
+ throw err;
156
+ }
150
157
  }
151
158
  async insert(vectors, ids, payloads) {
152
159
  for (let i = 0; i < vectors.length; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "memories-lite",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "A lightweight memory system for LLM agents",
5
5
  "author": "olivier@evaletolab.ch",
6
6
  "main": "dist/index.js",
@@ -47,6 +47,7 @@ export class LiteVectorStore implements VectorStore {
47
47
  this.dbPath = (config.rootPath == ':memory:') ? ':memory:' : path.join(config.rootPath, filename);
48
48
 
49
49
  // Add error handling callback for the database connection
50
+ console.log('--- DBG create LiteVectorStore::dbPath',this.dbPath);
50
51
  this.db = new sqlite3.Database(this.dbPath);
51
52
  }
52
53
 
@@ -166,12 +167,17 @@ export class LiteVectorStore implements VectorStore {
166
167
  return cachedStore;
167
168
  }
168
169
 
169
- // Pass the full config (including scoring) to the constructor
170
- const newStore = new LiteVectorStore(config, hashedUserId);
170
+ try{
171
+ // Pass the full config (including scoring) to the constructor
172
+ const newStore = new LiteVectorStore(config, hashedUserId);
171
173
 
172
- await newStore.init();
173
- LiteVectorStore.cache.set(hashedUserId, newStore);
174
- return newStore;
174
+ await newStore.init();
175
+ LiteVectorStore.cache.set(hashedUserId, newStore);
176
+ return newStore;
177
+ }catch(err){
178
+ console.error('--- DBG LiteVectorStore::from error',err);
179
+ throw err;
180
+ }
175
181
  }
176
182
 
177
183
  async insert(