@memnexus-ai/typescript-sdk 1.42.17 → 1.44.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.js CHANGED
@@ -641,6 +641,8 @@ var TopicsService = class extends BaseService {
641
641
  * List all topics with pagination
642
642
  * @param limit - Maximum number of topics to return
643
643
  * @param offset - Number of topics to skip
644
+ * @param sortBy - Field to sort topics by
645
+ * @param order - Sort order
644
646
  */
645
647
  async listTopics(options) {
646
648
  const request = new Request({
@@ -680,6 +682,30 @@ var TopicsService = class extends BaseService {
680
682
  isCursor: false
681
683
  });
682
684
  }
685
+ if (options?.sortBy !== void 0) {
686
+ request.addQueryParam("sortBy", {
687
+ key: "sortBy",
688
+ value: options.sortBy,
689
+ explode: false,
690
+ encode: true,
691
+ style: "form",
692
+ isLimit: false,
693
+ isOffset: false,
694
+ isCursor: false
695
+ });
696
+ }
697
+ if (options?.order !== void 0) {
698
+ request.addQueryParam("order", {
699
+ key: "order",
700
+ value: options.order,
701
+ explode: false,
702
+ encode: true,
703
+ style: "form",
704
+ isLimit: false,
705
+ isOffset: false,
706
+ isCursor: false
707
+ });
708
+ }
683
709
  return this.client.call(request);
684
710
  }
685
711
  /**
@@ -1789,6 +1815,8 @@ var MemoriesService = class extends BaseService {
1789
1815
  * @param limit - Maximum number of memories to return
1790
1816
  * @param offset - Number of memories to skip
1791
1817
  * @param page - Page number (alternative to offset)
1818
+ * @param sortBy - Field to sort results by
1819
+ * @param order - Sort order
1792
1820
  */
1793
1821
  async listMemories(options) {
1794
1822
  const request = new Request({
@@ -1852,6 +1880,30 @@ var MemoriesService = class extends BaseService {
1852
1880
  isCursor: false
1853
1881
  });
1854
1882
  }
1883
+ if (options?.sortBy !== void 0) {
1884
+ request.addQueryParam("sortBy", {
1885
+ key: "sortBy",
1886
+ value: options.sortBy,
1887
+ explode: false,
1888
+ encode: true,
1889
+ style: "form",
1890
+ isLimit: false,
1891
+ isOffset: false,
1892
+ isCursor: false
1893
+ });
1894
+ }
1895
+ if (options?.order !== void 0) {
1896
+ request.addQueryParam("order", {
1897
+ key: "order",
1898
+ value: options.order,
1899
+ explode: false,
1900
+ encode: true,
1901
+ style: "form",
1902
+ isLimit: false,
1903
+ isOffset: false,
1904
+ isCursor: false
1905
+ });
1906
+ }
1855
1907
  return this.client.call(request);
1856
1908
  }
1857
1909
  /**
@@ -1933,6 +1985,15 @@ var MemoriesService = class extends BaseService {
1933
1985
  * @param ingestionTimeTo - Ingestion time range end (ISO 8601 datetime)
1934
1986
  * @param includeExpired - Include expired memories in results
1935
1987
  * @param temporalMode - Temporal query mode
1988
+ * @param sortBy - Field to sort results by
1989
+ * @param order - Sort order
1990
+ * @param expandEntities - Enable entity graph traversal branch in hybrid search
1991
+ * @param expandTopics - Enable topic graph traversal branch in hybrid search
1992
+ * @param expandFacts - Enable fact graph traversal branch in hybrid search
1993
+ * @param includeSuperseded - Include superseded and contradicted memories in results
1994
+ * @param entityWeight - Weight for entity graph branch in hybrid search
1995
+ * @param topicWeight - Weight for topic graph branch in hybrid search
1996
+ * @param factWeight - Weight for fact graph branch in hybrid search
1936
1997
  */
1937
1998
  async searchMemoriesGet(options) {
1938
1999
  const request = new Request({
@@ -2224,6 +2285,114 @@ var MemoriesService = class extends BaseService {
2224
2285
  isCursor: false
2225
2286
  });
2226
2287
  }
2288
+ if (options?.sortBy !== void 0) {
2289
+ request.addQueryParam("sortBy", {
2290
+ key: "sortBy",
2291
+ value: options.sortBy,
2292
+ explode: false,
2293
+ encode: true,
2294
+ style: "form",
2295
+ isLimit: false,
2296
+ isOffset: false,
2297
+ isCursor: false
2298
+ });
2299
+ }
2300
+ if (options?.order !== void 0) {
2301
+ request.addQueryParam("order", {
2302
+ key: "order",
2303
+ value: options.order,
2304
+ explode: false,
2305
+ encode: true,
2306
+ style: "form",
2307
+ isLimit: false,
2308
+ isOffset: false,
2309
+ isCursor: false
2310
+ });
2311
+ }
2312
+ if (options?.expandEntities !== void 0) {
2313
+ request.addQueryParam("expandEntities", {
2314
+ key: "expandEntities",
2315
+ value: options.expandEntities,
2316
+ explode: false,
2317
+ encode: true,
2318
+ style: "form",
2319
+ isLimit: false,
2320
+ isOffset: false,
2321
+ isCursor: false
2322
+ });
2323
+ }
2324
+ if (options?.expandTopics !== void 0) {
2325
+ request.addQueryParam("expandTopics", {
2326
+ key: "expandTopics",
2327
+ value: options.expandTopics,
2328
+ explode: false,
2329
+ encode: true,
2330
+ style: "form",
2331
+ isLimit: false,
2332
+ isOffset: false,
2333
+ isCursor: false
2334
+ });
2335
+ }
2336
+ if (options?.expandFacts !== void 0) {
2337
+ request.addQueryParam("expandFacts", {
2338
+ key: "expandFacts",
2339
+ value: options.expandFacts,
2340
+ explode: false,
2341
+ encode: true,
2342
+ style: "form",
2343
+ isLimit: false,
2344
+ isOffset: false,
2345
+ isCursor: false
2346
+ });
2347
+ }
2348
+ if (options?.includeSuperseded !== void 0) {
2349
+ request.addQueryParam("includeSuperseded", {
2350
+ key: "includeSuperseded",
2351
+ value: options.includeSuperseded,
2352
+ explode: false,
2353
+ encode: true,
2354
+ style: "form",
2355
+ isLimit: false,
2356
+ isOffset: false,
2357
+ isCursor: false
2358
+ });
2359
+ }
2360
+ if (options?.entityWeight !== void 0) {
2361
+ request.addQueryParam("entityWeight", {
2362
+ key: "entityWeight",
2363
+ value: options.entityWeight,
2364
+ explode: false,
2365
+ encode: true,
2366
+ style: "form",
2367
+ isLimit: false,
2368
+ isOffset: false,
2369
+ isCursor: false
2370
+ });
2371
+ }
2372
+ if (options?.topicWeight !== void 0) {
2373
+ request.addQueryParam("topicWeight", {
2374
+ key: "topicWeight",
2375
+ value: options.topicWeight,
2376
+ explode: false,
2377
+ encode: true,
2378
+ style: "form",
2379
+ isLimit: false,
2380
+ isOffset: false,
2381
+ isCursor: false
2382
+ });
2383
+ }
2384
+ if (options?.factWeight !== void 0) {
2385
+ request.addQueryParam("factWeight", {
2386
+ key: "factWeight",
2387
+ value: options.factWeight,
2388
+ explode: false,
2389
+ encode: true,
2390
+ style: "form",
2391
+ isLimit: false,
2392
+ isOffset: false,
2393
+ isCursor: false
2394
+ });
2395
+ }
2227
2396
  return this.client.call(request);
2228
2397
  }
2229
2398
  /**
@@ -2993,6 +3162,8 @@ var FactsService = class extends BaseService {
2993
3162
  * List all facts for the authenticated user
2994
3163
  * @param limit - Maximum number of facts to return
2995
3164
  * @param offset - Number of facts to skip
3165
+ * @param sortBy - Field to sort facts by
3166
+ * @param order - Sort order
2996
3167
  */
2997
3168
  async listFacts(options) {
2998
3169
  const request = new Request({
@@ -3032,6 +3203,30 @@ var FactsService = class extends BaseService {
3032
3203
  isCursor: false
3033
3204
  });
3034
3205
  }
3206
+ if (options?.sortBy !== void 0) {
3207
+ request.addQueryParam("sortBy", {
3208
+ key: "sortBy",
3209
+ value: options.sortBy,
3210
+ explode: false,
3211
+ encode: true,
3212
+ style: "form",
3213
+ isLimit: false,
3214
+ isOffset: false,
3215
+ isCursor: false
3216
+ });
3217
+ }
3218
+ if (options?.order !== void 0) {
3219
+ request.addQueryParam("order", {
3220
+ key: "order",
3221
+ value: options.order,
3222
+ explode: false,
3223
+ encode: true,
3224
+ style: "form",
3225
+ isLimit: false,
3226
+ isOffset: false,
3227
+ isCursor: false
3228
+ });
3229
+ }
3035
3230
  return this.client.call(request);
3036
3231
  }
3037
3232
  /**
@@ -3340,6 +3535,8 @@ var ConversationsService = class extends BaseService {
3340
3535
  * @param limit - Maximum number of conversations to return
3341
3536
  * @param offset - Number of conversations to skip
3342
3537
  * @param since - Return only conversations created after this timestamp (ISO 8601 format)
3538
+ * @param sortBy - Field to sort conversations by
3539
+ * @param order - Sort order
3343
3540
  */
3344
3541
  async listConversations(options) {
3345
3542
  const request = new Request({
@@ -3391,6 +3588,30 @@ var ConversationsService = class extends BaseService {
3391
3588
  isCursor: false
3392
3589
  });
3393
3590
  }
3591
+ if (options?.sortBy !== void 0) {
3592
+ request.addQueryParam("sortBy", {
3593
+ key: "sortBy",
3594
+ value: options.sortBy,
3595
+ explode: false,
3596
+ encode: true,
3597
+ style: "form",
3598
+ isLimit: false,
3599
+ isOffset: false,
3600
+ isCursor: false
3601
+ });
3602
+ }
3603
+ if (options?.order !== void 0) {
3604
+ request.addQueryParam("order", {
3605
+ key: "order",
3606
+ value: options.order,
3607
+ explode: false,
3608
+ encode: true,
3609
+ style: "form",
3610
+ isLimit: false,
3611
+ isOffset: false,
3612
+ isCursor: false
3613
+ });
3614
+ }
3394
3615
  return this.client.call(request);
3395
3616
  }
3396
3617
  /**
@@ -4780,7 +5001,25 @@ var searchRequest = z.object({
4780
5001
  /** Include facts extracted from matched memories (defaults to false for performance) */
4781
5002
  includeFacts: z.boolean().optional(),
4782
5003
  /** Filter entities by type (e.g., PERSON, TECHNOLOGY, PROJECT) */
4783
- entityTypes: z.array(z.string().max(50)).max(20).optional()
5004
+ entityTypes: z.array(z.string().max(50)).max(20).optional(),
5005
+ /** Enable entity graph traversal branch in hybrid search (default false) */
5006
+ expandEntities: z.boolean().optional(),
5007
+ /** Enable topic graph traversal branch in hybrid search (default false) */
5008
+ expandTopics: z.boolean().optional(),
5009
+ /** Enable fact graph traversal branch in hybrid search (default false) */
5010
+ expandFacts: z.boolean().optional(),
5011
+ /** Include superseded and contradicted memories in results (default false) */
5012
+ includeSuperseded: z.boolean().optional(),
5013
+ /** Weight for entity graph branch in hybrid search (0-1, default 0.7) */
5014
+ entityWeight: z.number().min(0).max(1).optional(),
5015
+ /** Weight for topic graph branch in hybrid search (0-1, default 0.5) */
5016
+ topicWeight: z.number().min(0).max(1).optional(),
5017
+ /** Weight for fact graph branch in hybrid search (0-1, default 0.6) */
5018
+ factWeight: z.number().min(0).max(1).optional(),
5019
+ /** Field to sort results by (defaults to 'relevance' for search, 'createdAt' for list) */
5020
+ sortBy: z.enum(["relevance", "createdAt", "updatedAt", "eventTime"]).optional(),
5021
+ /** Sort order: 'asc' or 'desc' (defaults to 'desc' for timestamps, 'desc' for relevance) */
5022
+ order: z.enum(["asc", "desc"]).optional()
4784
5023
  });
4785
5024
  var entity = z.object({
4786
5025
  /** Entity name */
@@ -4883,6 +5122,10 @@ var searchResult = z.lazy(() => z.object({
4883
5122
  fulltextScore: z.number().optional(),
4884
5123
  /** Rank in fulltext search results */
4885
5124
  fulltextRank: z.number().nullable().optional(),
5125
+ /** Search branches that contributed to this result (e.g. ['semantic', 'entity']) */
5126
+ matchedVia: z.array(z.string()).optional(),
5127
+ /** Per-branch RRF scores for this result */
5128
+ branchScores: z.object({}).catchall(z.number()).optional(),
4886
5129
  /** Detailed explanation of the match (only when explain=true) */
4887
5130
  explanation: z.object({
4888
5131
  /** Human-readable explanation of why this result matched */