@memnexus-ai/typescript-sdk 1.43.0 → 1.45.0

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/index.cjs CHANGED
@@ -1818,11 +1818,18 @@ var MonitoringService = class extends BaseService {
1818
1818
  // src/services/memories-service.ts
1819
1819
  var MemoriesService = class extends BaseService {
1820
1820
  /**
1821
- * Get memory by ID
1822
- * Retrieve a specific memory by its ID
1823
- * @param id - The memory ID
1824
- */
1825
- async getMemoryById(id) {
1821
+ * Get memory by ID
1822
+ * Retrieve a specific memory by its ID with configurable detail level.
1823
+
1824
+ **Detail levels:**
1825
+ - `minimal` — raw memory only, no extra queries
1826
+ - `standard` (default) — adds userTopics, extractedTopics, entities, facts, relationships
1827
+ - `full` — adds conversationContext (title, memoryCount, position) and relationship target previews
1828
+
1829
+ * @param id - The memory ID
1830
+ * @param detail - Detail level: minimal (raw memory), standard (default, + topics/entities/facts/relationships), full (+ conversation context and relationship previews)
1831
+ */
1832
+ async getMemoryById(id, options) {
1826
1833
  const request = new Request({
1827
1834
  baseUrl: this.config.baseUrl || "http://localhost:3000",
1828
1835
  method: "GET",
@@ -1846,6 +1853,18 @@ var MemoriesService = class extends BaseService {
1846
1853
  isOffset: false,
1847
1854
  isCursor: false
1848
1855
  });
1856
+ if (options?.detail !== void 0) {
1857
+ request.addQueryParam("detail", {
1858
+ key: "detail",
1859
+ value: options.detail,
1860
+ explode: false,
1861
+ encode: true,
1862
+ style: "form",
1863
+ isLimit: false,
1864
+ isOffset: false,
1865
+ isCursor: false
1866
+ });
1867
+ }
1849
1868
  return this.client.call(request);
1850
1869
  }
1851
1870
  /**
@@ -2101,6 +2120,13 @@ var MemoriesService = class extends BaseService {
2101
2120
  * @param temporalMode - Temporal query mode
2102
2121
  * @param sortBy - Field to sort results by
2103
2122
  * @param order - Sort order
2123
+ * @param expandEntities - Enable entity graph traversal branch in hybrid search
2124
+ * @param expandTopics - Enable topic graph traversal branch in hybrid search
2125
+ * @param expandFacts - Enable fact graph traversal branch in hybrid search
2126
+ * @param includeSuperseded - Include superseded and contradicted memories in results
2127
+ * @param entityWeight - Weight for entity graph branch in hybrid search
2128
+ * @param topicWeight - Weight for topic graph branch in hybrid search
2129
+ * @param factWeight - Weight for fact graph branch in hybrid search
2104
2130
  */
2105
2131
  async searchMemoriesGet(options) {
2106
2132
  const request = new Request({
@@ -2416,6 +2442,90 @@ var MemoriesService = class extends BaseService {
2416
2442
  isCursor: false
2417
2443
  });
2418
2444
  }
2445
+ if (options?.expandEntities !== void 0) {
2446
+ request.addQueryParam("expandEntities", {
2447
+ key: "expandEntities",
2448
+ value: options.expandEntities,
2449
+ explode: false,
2450
+ encode: true,
2451
+ style: "form",
2452
+ isLimit: false,
2453
+ isOffset: false,
2454
+ isCursor: false
2455
+ });
2456
+ }
2457
+ if (options?.expandTopics !== void 0) {
2458
+ request.addQueryParam("expandTopics", {
2459
+ key: "expandTopics",
2460
+ value: options.expandTopics,
2461
+ explode: false,
2462
+ encode: true,
2463
+ style: "form",
2464
+ isLimit: false,
2465
+ isOffset: false,
2466
+ isCursor: false
2467
+ });
2468
+ }
2469
+ if (options?.expandFacts !== void 0) {
2470
+ request.addQueryParam("expandFacts", {
2471
+ key: "expandFacts",
2472
+ value: options.expandFacts,
2473
+ explode: false,
2474
+ encode: true,
2475
+ style: "form",
2476
+ isLimit: false,
2477
+ isOffset: false,
2478
+ isCursor: false
2479
+ });
2480
+ }
2481
+ if (options?.includeSuperseded !== void 0) {
2482
+ request.addQueryParam("includeSuperseded", {
2483
+ key: "includeSuperseded",
2484
+ value: options.includeSuperseded,
2485
+ explode: false,
2486
+ encode: true,
2487
+ style: "form",
2488
+ isLimit: false,
2489
+ isOffset: false,
2490
+ isCursor: false
2491
+ });
2492
+ }
2493
+ if (options?.entityWeight !== void 0) {
2494
+ request.addQueryParam("entityWeight", {
2495
+ key: "entityWeight",
2496
+ value: options.entityWeight,
2497
+ explode: false,
2498
+ encode: true,
2499
+ style: "form",
2500
+ isLimit: false,
2501
+ isOffset: false,
2502
+ isCursor: false
2503
+ });
2504
+ }
2505
+ if (options?.topicWeight !== void 0) {
2506
+ request.addQueryParam("topicWeight", {
2507
+ key: "topicWeight",
2508
+ value: options.topicWeight,
2509
+ explode: false,
2510
+ encode: true,
2511
+ style: "form",
2512
+ isLimit: false,
2513
+ isOffset: false,
2514
+ isCursor: false
2515
+ });
2516
+ }
2517
+ if (options?.factWeight !== void 0) {
2518
+ request.addQueryParam("factWeight", {
2519
+ key: "factWeight",
2520
+ value: options.factWeight,
2521
+ explode: false,
2522
+ encode: true,
2523
+ style: "form",
2524
+ isLimit: false,
2525
+ isOffset: false,
2526
+ isCursor: false
2527
+ });
2528
+ }
2419
2529
  return this.client.call(request);
2420
2530
  }
2421
2531
  /**
@@ -2554,11 +2664,12 @@ var MemoriesService = class extends BaseService {
2554
2664
  /**
2555
2665
  * Get a memory by name
2556
2666
  * Retrieve the current HEAD version of a named memory by its user-assigned name.
2557
- Returns the memory with topic breakdown and entities, same as GET /api/memories/{id}.
2667
+ Supports the same detail levels as GET /api/memories/{id}.
2558
2668
 
2559
2669
  * @param name - Memory name (kebab-case, 2-64 chars)
2670
+ * @param detail - Detail level: minimal (raw memory), standard (default, + topics/entities/facts/relationships), full (+ conversation context and relationship previews)
2560
2671
  */
2561
- async getMemoryByName(name) {
2672
+ async getMemoryByName(name, options) {
2562
2673
  const request = new Request({
2563
2674
  baseUrl: this.config.baseUrl || "http://localhost:3000",
2564
2675
  method: "GET",
@@ -2582,6 +2693,18 @@ var MemoriesService = class extends BaseService {
2582
2693
  isOffset: false,
2583
2694
  isCursor: false
2584
2695
  });
2696
+ if (options?.detail !== void 0) {
2697
+ request.addQueryParam("detail", {
2698
+ key: "detail",
2699
+ value: options.detail,
2700
+ explode: false,
2701
+ encode: true,
2702
+ style: "form",
2703
+ isLimit: false,
2704
+ isOffset: false,
2705
+ isCursor: false
2706
+ });
2707
+ }
2585
2708
  return this.client.call(request);
2586
2709
  }
2587
2710
  /**
@@ -4857,7 +4980,9 @@ var namedMemoryHistoryResponse = import_zod.z.object({
4857
4980
  });
4858
4981
  var batchGetMemoriesRequest = import_zod.z.object({
4859
4982
  /** Array of memory IDs to retrieve */
4860
- ids: import_zod.z.array(import_zod.z.string().uuid()).min(1).max(100)
4983
+ ids: import_zod.z.array(import_zod.z.string().uuid()).min(1).max(100),
4984
+ /** Detail level for each memory. 'minimal' returns raw memory only (default, backward compatible). 'standard' adds topics, entities, facts, and relationships. */
4985
+ detail: import_zod.z.enum(["minimal", "standard"]).optional()
4861
4986
  });
4862
4987
  var batchGetMemoriesMeta = import_zod.z.object({
4863
4988
  /** Number of IDs requested */
@@ -5025,6 +5150,20 @@ var searchRequest = import_zod.z.object({
5025
5150
  includeFacts: import_zod.z.boolean().optional(),
5026
5151
  /** Filter entities by type (e.g., PERSON, TECHNOLOGY, PROJECT) */
5027
5152
  entityTypes: import_zod.z.array(import_zod.z.string().max(50)).max(20).optional(),
5153
+ /** Enable entity graph traversal branch in hybrid search (default false) */
5154
+ expandEntities: import_zod.z.boolean().optional(),
5155
+ /** Enable topic graph traversal branch in hybrid search (default false) */
5156
+ expandTopics: import_zod.z.boolean().optional(),
5157
+ /** Enable fact graph traversal branch in hybrid search (default false) */
5158
+ expandFacts: import_zod.z.boolean().optional(),
5159
+ /** Include superseded and contradicted memories in results (default false) */
5160
+ includeSuperseded: import_zod.z.boolean().optional(),
5161
+ /** Weight for entity graph branch in hybrid search (0-1, default 0.7) */
5162
+ entityWeight: import_zod.z.number().min(0).max(1).optional(),
5163
+ /** Weight for topic graph branch in hybrid search (0-1, default 0.5) */
5164
+ topicWeight: import_zod.z.number().min(0).max(1).optional(),
5165
+ /** Weight for fact graph branch in hybrid search (0-1, default 0.6) */
5166
+ factWeight: import_zod.z.number().min(0).max(1).optional(),
5028
5167
  /** Field to sort results by (defaults to 'relevance' for search, 'createdAt' for list) */
5029
5168
  sortBy: import_zod.z.enum(["relevance", "createdAt", "updatedAt", "eventTime"]).optional(),
5030
5169
  /** Sort order: 'asc' or 'desc' (defaults to 'desc' for timestamps, 'desc' for relevance) */
@@ -5131,6 +5270,10 @@ var searchResult = import_zod.z.lazy(() => import_zod.z.object({
5131
5270
  fulltextScore: import_zod.z.number().optional(),
5132
5271
  /** Rank in fulltext search results */
5133
5272
  fulltextRank: import_zod.z.number().nullable().optional(),
5273
+ /** Search branches that contributed to this result (e.g. ['semantic', 'entity']) */
5274
+ matchedVia: import_zod.z.array(import_zod.z.string()).optional(),
5275
+ /** Per-branch RRF scores for this result */
5276
+ branchScores: import_zod.z.object({}).catchall(import_zod.z.number()).optional(),
5134
5277
  /** Detailed explanation of the match (only when explain=true) */
5135
5278
  explanation: import_zod.z.object({
5136
5279
  /** Human-readable explanation of why this result matched */