@redis-iris/agent-memory 0.3.0 → 0.3.1
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/README.md +86 -67
- package/jsr.json +1 -1
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -11,12 +11,31 @@ Developer-friendly & type-safe Typescript SDK specifically catered to leverage *
|
|
|
11
11
|
Redis Agent Memory API: API for storing, retrieving, and searching Redis Agent Memory session memory and long-term memory.
|
|
12
12
|
|
|
13
13
|
Authentication depends on your deployment. Use the credential issued for your Agent Memory service or store. For self-managed deployments, see the self-managed Agent Memory guide for authentication options.
|
|
14
|
+
|
|
15
|
+
For more information about the API: [Redis Agent Memory documentation](https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/)
|
|
14
16
|
<!-- End Summary [summary] -->
|
|
15
17
|
|
|
18
|
+
## Documentation
|
|
19
|
+
|
|
20
|
+
- [Developer guide](https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/developer-guide/)
|
|
21
|
+
- [TypeScript SDK quickstart](https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/typescript-sdk-quickstart/)
|
|
22
|
+
- [REST API reference](https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/api-reference/) (HTTP endpoints and schemas, not TypeScript method pages)
|
|
23
|
+
- [REST API quickstart](https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/rest-api-quickstart/)
|
|
24
|
+
|
|
25
|
+
## Recent changes
|
|
26
|
+
|
|
27
|
+
**Namespace resources (since 0.3.0).** Create and manage namespaces with `listNamespaces`, `createNamespace`, `getNamespace`, `updateNamespace`, and `deleteNamespace`. Bind a session or long-term memory to a namespace resource with `namespaceRef`.
|
|
28
|
+
|
|
29
|
+
**Legacy namespace labels.** The flat `namespace` string is deprecated. It does not create or resolve a namespace resource. Do not send it together with `namespaceRef`. New integrations should use namespace resources.
|
|
30
|
+
|
|
31
|
+
**HTTP 424.** When a memory or model-provider dependency cannot complete the request, the SDK raises `MemoryFailedDependencyErrorResponseContent`. `FailedDependencyErrorResponseContent` still represents other 424 failed-dependency errors.
|
|
32
|
+
|
|
16
33
|
<!-- Start Table of Contents [toc] -->
|
|
17
34
|
## Table of Contents
|
|
18
35
|
<!-- $toc-max-depth=2 -->
|
|
19
36
|
* [@redis-iris/agent-memory](#redis-irisagent-memory)
|
|
37
|
+
* [Documentation](#documentation)
|
|
38
|
+
* [Recent changes](#recent-changes)
|
|
20
39
|
* [SDK Installation](#sdk-installation)
|
|
21
40
|
* [Requirements](#requirements)
|
|
22
41
|
* [SDK Example Usage](#sdk-example-usage)
|
|
@@ -70,7 +89,7 @@ yarn add @redis-iris/agent-memory
|
|
|
70
89
|
<!-- Start Requirements [requirements] -->
|
|
71
90
|
## Requirements
|
|
72
91
|
|
|
73
|
-
For supported JavaScript runtimes, please consult
|
|
92
|
+
For supported JavaScript runtimes, please consult RUNTIMES.md.
|
|
74
93
|
<!-- End Requirements [requirements] -->
|
|
75
94
|
|
|
76
95
|
<!-- Start SDK Example Usage [usage] -->
|
|
@@ -293,28 +312,28 @@ run();
|
|
|
293
312
|
<details open>
|
|
294
313
|
<summary>Available methods</summary>
|
|
295
314
|
|
|
296
|
-
###
|
|
297
|
-
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
*
|
|
303
|
-
*
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
*
|
|
316
|
-
*
|
|
317
|
-
*
|
|
315
|
+
### AgentMemory SDK
|
|
316
|
+
|
|
317
|
+
* health - Return information about the operational status of the service.
|
|
318
|
+
* storeHealth - Returns read-only health for applicable store-scoped RAM features.
|
|
319
|
+
* bulkDeleteLongTermMemories - Deletes long-term memories in bulk by their IDs.
|
|
320
|
+
* bulkCreateLongTermMemories - Creates long-term memories in bulk.
|
|
321
|
+
* moveLongTermMemories - Moves long-term memories to one existing namespace resource. Returns 409 when the destination namespace is archived.
|
|
322
|
+
* searchLongTermMemory - Runs a semantic search on long-term memory with filtering options.
|
|
323
|
+
* getLongTermMemory - Returns a long-term memory by its ID.
|
|
324
|
+
* updateLongTermMemory - Partially updates a long-term memory by its ID.
|
|
325
|
+
* updateLongTermMemoryFields - Atomically updates a custom-typed long-term memory's text and/or attributes, scoped to the caller's bound memory type. Used by the custom-extraction worker.
|
|
326
|
+
* listNamespaces - Lists namespace roots or direct children.
|
|
327
|
+
* createNamespace - Creates a namespace resource as a root, direct child, or explicit hierarchy path. Returns 409 when an active or archived namespace already occupies the requested location.
|
|
328
|
+
* deleteNamespace - Deletes an empty leaf namespace. Returns 409 when the namespace has children or memory placements, or when it changed concurrently.
|
|
329
|
+
* getNamespace - Gets one namespace by its canonical ID.
|
|
330
|
+
* updateNamespace - Renames or archives a namespace. Returns 409 when the namespace changed concurrently, an active or archived sibling already uses the requested name, or the namespace is archived.
|
|
331
|
+
* listSessions - Returns a paginated list of session IDs for a store.
|
|
332
|
+
* addSessionEvent - Appends a single event to a session. Creates the session if it does not exist. If sessionId is omitted, the server generates one.
|
|
333
|
+
* deleteSessionMemory - Deletes the session memory for a session.
|
|
334
|
+
* getSessionMemory - Returns the session memory for a session.
|
|
335
|
+
* deleteSessionEvent - Deletes a single event from a session by event ID.
|
|
336
|
+
* getSessionEvent - Returns a single event from a session by event ID.
|
|
318
337
|
|
|
319
338
|
</details>
|
|
320
339
|
<!-- End Available Resources and Operations [operations] -->
|
|
@@ -328,32 +347,32 @@ runtimes or other environments where application bundle size is a primary
|
|
|
328
347
|
concern. When using a bundler to build your application, all unused
|
|
329
348
|
functionality will be either excluded from the final bundle or tree-shaken away.
|
|
330
349
|
|
|
331
|
-
To read more about standalone functions, check
|
|
350
|
+
To read more about standalone functions, check FUNCTIONS.md.
|
|
332
351
|
|
|
333
352
|
<details>
|
|
334
353
|
|
|
335
354
|
<summary>Available standalone functions</summary>
|
|
336
355
|
|
|
337
|
-
-
|
|
338
|
-
-
|
|
339
|
-
-
|
|
340
|
-
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
-
|
|
356
|
+
- `addSessionEvent` - Appends a single event to a session. Creates the session if it does not exist. If sessionId is omitted, the server generates one.
|
|
357
|
+
- `bulkCreateLongTermMemories` - Creates long-term memories in bulk.
|
|
358
|
+
- `bulkDeleteLongTermMemories` - Deletes long-term memories in bulk by their IDs.
|
|
359
|
+
- `createNamespace` - Creates a namespace resource as a root, direct child, or explicit hierarchy path. Returns 409 when an active or archived namespace already occupies the requested location.
|
|
360
|
+
- `deleteNamespace` - Deletes an empty leaf namespace. Returns 409 when the namespace has children or memory placements, or when it changed concurrently.
|
|
361
|
+
- `deleteSessionEvent` - Deletes a single event from a session by event ID.
|
|
362
|
+
- `deleteSessionMemory` - Deletes the session memory for a session.
|
|
363
|
+
- `getLongTermMemory` - Returns a long-term memory by its ID.
|
|
364
|
+
- `getNamespace` - Gets one namespace by its canonical ID.
|
|
365
|
+
- `getSessionEvent` - Returns a single event from a session by event ID.
|
|
366
|
+
- `getSessionMemory` - Returns the session memory for a session.
|
|
367
|
+
- `health` - Return information about the operational status of the service.
|
|
368
|
+
- `listNamespaces` - Lists namespace roots or direct children.
|
|
369
|
+
- `listSessions` - Returns a paginated list of session IDs for a store.
|
|
370
|
+
- `moveLongTermMemories` - Moves long-term memories to one existing namespace resource. Returns 409 when the destination namespace is archived.
|
|
371
|
+
- `searchLongTermMemory` - Runs a semantic search on long-term memory with filtering options.
|
|
372
|
+
- `storeHealth` - Returns read-only health for applicable store-scoped RAM features.
|
|
373
|
+
- `updateLongTermMemory` - Partially updates a long-term memory by its ID.
|
|
374
|
+
- `updateLongTermMemoryFields` - Atomically updates a custom-typed long-term memory's text and/or attributes, scoped to the caller's bound memory type. Used by the custom-extraction worker.
|
|
375
|
+
- `updateNamespace` - Renames or archives a namespace. Returns 409 when the namespace changed concurrently, an active or archived sibling already uses the requested name, or the namespace is archived.
|
|
357
376
|
|
|
358
377
|
</details>
|
|
359
378
|
<!-- End Standalone functions [standalone-funcs] -->
|
|
@@ -465,7 +484,7 @@ run();
|
|
|
465
484
|
<!-- Start Error Handling [errors] -->
|
|
466
485
|
## Error Handling
|
|
467
486
|
|
|
468
|
-
|
|
487
|
+
`AgentMemoryError` is the base class for all HTTP error responses. It has the following properties:
|
|
469
488
|
|
|
470
489
|
| Property | Type | Description |
|
|
471
490
|
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
@@ -518,34 +537,34 @@ run();
|
|
|
518
537
|
|
|
519
538
|
### Error Classes
|
|
520
539
|
**Primary errors:**
|
|
521
|
-
*
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
*
|
|
530
|
-
*
|
|
540
|
+
* `AgentMemoryError`: The base class for HTTP error responses.
|
|
541
|
+
* `BadRequestErrorResponseContent`: Request validation or input decoding failed. Status code `400`. *
|
|
542
|
+
* `AuthenticationErrorResponseContent`: Authentication credentials are missing, malformed, or invalid. Status code `401`. *
|
|
543
|
+
* `ForbiddenErrorResponseContent`: The caller is authenticated but not allowed to access the requested resource. Status code `403`. *
|
|
544
|
+
* `NotFoundErrorResponseContent`: The requested resource does not exist. Status code `404`. *
|
|
545
|
+
* `TimeoutErrorResponseContent`: The request timed out before the service could complete it. Status code `408`. *
|
|
546
|
+
* `ResourceSuspendedErrorResponseContent`: The requested resource exists but is suspended by an administrator. Status code `423`. *
|
|
547
|
+
* `TooManyRequestsErrorResponseContent`: The service rejected the request because rate limits were exceeded. Status code `429`. *
|
|
548
|
+
* `UnexpectedErrorResponseContent`: The service failed with an unexpected internal error. Status code `500`. *
|
|
549
|
+
* `PayloadTooLargeErrorResponseContent`: The request payload exceeds the maximum supported size. Status code `413`. *
|
|
531
550
|
|
|
532
551
|
<details><summary>Less common errors (9)</summary>
|
|
533
552
|
|
|
534
553
|
<br />
|
|
535
554
|
|
|
536
555
|
**Network errors:**
|
|
537
|
-
*
|
|
538
|
-
*
|
|
539
|
-
*
|
|
540
|
-
*
|
|
541
|
-
*
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
**Inherit from
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
*
|
|
548
|
-
*
|
|
556
|
+
* `ConnectionError`: HTTP client was unable to make a request to a server.
|
|
557
|
+
* `RequestTimeoutError`: HTTP request timed out due to an AbortSignal signal.
|
|
558
|
+
* `RequestAbortedError`: HTTP request was aborted by the client.
|
|
559
|
+
* `InvalidRequestError`: Any input used to create a request is invalid.
|
|
560
|
+
* `UnexpectedClientError`: Unrecognised or unexpected error.
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
**Inherit from `AgentMemoryError`**:
|
|
564
|
+
* `FailedDependencyErrorResponseContent`: A dependent resource required to process the request is unavailable or unhealthy. Status code `424`. Applicable to 15 of 20 methods.*
|
|
565
|
+
* `ConflictErrorResponseContent`: The request conflicts with the current state of the resource. Status code `409`. Applicable to 4 of 20 methods.*
|
|
566
|
+
* `MemoryFailedDependencyErrorResponseContent`: A resource or model-provider dependency required by Agent Memory could not complete the request. Status code `424`. Applicable to 4 of 20 methods.*
|
|
567
|
+
* `ResponseValidationError`: Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
549
568
|
|
|
550
569
|
</details>
|
|
551
570
|
|
package/jsr.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redis-iris/agent-memory",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"author": "Redis",
|
|
5
|
+
"homepage": "https://redis.io/docs/latest/develop/ai/context-engine/agent-memory/",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"type": "module",
|
|
7
8
|
"tshy": {
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
"scripts": {
|
|
30
31
|
"lint": "oxlint --max-warnings=0 --deny-warnings --no-error-on-unmatched-pattern src",
|
|
31
32
|
"build": "tshy",
|
|
33
|
+
"prepack": "python3 ../scripts/prepare_public_readme.py --input README.md --in-place",
|
|
32
34
|
"prepublishOnly": "npm run build"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {},
|