mengram-ai 2.14.2 → 2.14.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.
Files changed (3) hide show
  1. package/index.d.ts +2 -1
  2. package/index.js +11 -4
  3. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -18,6 +18,7 @@ export interface MemoryOptions {
18
18
 
19
19
  export interface SearchOptions extends MemoryOptions {
20
20
  limit?: number;
21
+ graphDepth?: number;
21
22
  }
22
23
 
23
24
  export interface AddResult {
@@ -186,7 +187,7 @@ export declare class MengramClient {
186
187
  procedureEvolution(procedureId: string, options?: { userId?: string }): Promise<{ evolution: ProcedureEvolutionEntry[] }>;
187
188
 
188
189
  // Unified Search
189
- searchAll(query: string, options?: { limit?: number }): Promise<UnifiedSearchResult>;
190
+ searchAll(query: string, options?: { limit?: number; graphDepth?: number }): Promise<UnifiedSearchResult>;
190
191
 
191
192
  // Agents
192
193
  runAgents(options?: { agent?: string; autoFix?: boolean }): Promise<any>;
package/index.js CHANGED
@@ -104,16 +104,19 @@ class MengramClient {
104
104
  * @param {string} [options.agentId]
105
105
  * @param {string} [options.runId]
106
106
  * @param {string} [options.appId]
107
+ * @param {string} [options.expirationDate] - ISO datetime when memories expire
107
108
  * @returns {Promise<{status: string}>}
108
109
  */
109
110
  async addText(text, options = {}) {
110
- return this._request('POST', '/v1/add_text', {
111
+ const body = {
111
112
  text,
112
113
  user_id: options.userId || 'default',
113
114
  agent_id: options.agentId || null,
114
115
  run_id: options.runId || null,
115
116
  app_id: options.appId || null,
116
- });
117
+ };
118
+ if (options.expirationDate) body.expiration_date = options.expirationDate;
119
+ return this._request('POST', '/v1/add_text', body);
117
120
  }
118
121
 
119
122
  /**
@@ -125,6 +128,7 @@ class MengramClient {
125
128
  * @param {string} [options.runId]
126
129
  * @param {string} [options.appId]
127
130
  * @param {number} [options.limit] - Max results (default: 5)
131
+ * @param {number} [options.graphDepth] - Knowledge graph traversal depth (default: 2)
128
132
  * @returns {Promise<Array>}
129
133
  */
130
134
  async search(query, options = {}) {
@@ -135,6 +139,7 @@ class MengramClient {
135
139
  run_id: options.runId || null,
136
140
  app_id: options.appId || null,
137
141
  limit: options.limit || 5,
142
+ graph_depth: options.graphDepth != null ? options.graphDepth : 2,
138
143
  });
139
144
  return data.results || [];
140
145
  }
@@ -191,7 +196,7 @@ class MengramClient {
191
196
  try {
192
197
  const params = {};
193
198
  if (options.userId && options.userId !== 'default') params.sub_user_id = options.userId;
194
- await this._request('DELETE', `/v1/entity/${encodeURIComponent(name)}`, null, params);
199
+ await this._request('DELETE', `/v1/memory/${encodeURIComponent(name)}`, null, params);
195
200
  return true;
196
201
  } catch {
197
202
  return false;
@@ -350,6 +355,7 @@ class MengramClient {
350
355
  * @param {string} query - Search query
351
356
  * @param {object} [options]
352
357
  * @param {number} [options.limit] - Max results per type (default 5)
358
+ * @param {number} [options.graphDepth] - Knowledge graph traversal depth (default: 2)
353
359
  * @returns {Promise<{semantic: Array, episodic: Array, procedural: Array}>}
354
360
  */
355
361
  async searchAll(query, options = {}) {
@@ -357,6 +363,7 @@ class MengramClient {
357
363
  query,
358
364
  limit: options.limit || 5,
359
365
  user_id: options.userId || 'default',
366
+ graph_depth: options.graphDepth != null ? options.graphDepth : 2,
360
367
  });
361
368
  }
362
369
 
@@ -744,7 +751,7 @@ class MengramClient {
744
751
  * @returns {Promise<Array>}
745
752
  */
746
753
  async feed(options = {}) {
747
- const params = { limit: options.limit || 20 };
754
+ const params = { limit: options.limit || 50 };
748
755
  if (options.userId && options.userId !== 'default') params.sub_user_id = options.userId;
749
756
  const data = await this._request('GET', '/v1/feed', null, params);
750
757
  return data.feed || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mengram-ai",
3
- "version": "2.14.2",
3
+ "version": "2.14.4",
4
4
  "description": "Human-like memory for AI — semantic, episodic & procedural memory. Experience-driven procedures, Cognitive Profile, unified search, memory agents. Free Mem0 alternative.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",