Memories
client.memories exposes nine operations for managing memories. All methods return typed promises and throw typed errors on failure.
create
Stores a new memory in the workspace. Processing is asynchronous — the memory is available for search once its status reaches READY.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The memory content — write as a clear, self-contained statement |
userId | string | No | ID of the user this memory belongs to |
agentId | string | No | ID of the agent this memory belongs to |
sessionId | string | No | ID of the conversation session |
metadata | Record<string, unknown> | No | Arbitrary key-value metadata |
categories | string[] | No | Category tags for filtering and organization |
priority | MemoryPriority | No | LOW, MEDIUM (default), or HIGH |
layer | MemoryLayer | No | TASK (temporary, with TTL) or RAW (permanent, default) |
Example
search
Searches memories using semantic similarity, keyword matching, or a hybrid of both. Returns memories ranked by relevance with a score field.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
userId | string | No | Filter results to a specific user |
limit | number | No | Maximum number of results to return (default 10) |
mode | SearchMode | No | hybrid (default), semantic, or keyword |
categories | string[] | No | Filter results to specific categories |
priority | MemoryPriority | No | Filter results by priority level |
Example
list
Lists memories chronologically with optional filters. Use this when you need to browse all memories rather than search by relevance.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | string | No | Filter by user ID |
agentId | string | No | Filter by agent ID |
status | MemoryStatus | No | Filter by status: PENDING, PROCESSING, READY, FAILED |
layer | MemoryLayer | No | Filter by layer: TASK or RAW |
priority | MemoryPriority | No | Filter by priority: LOW, MEDIUM, or HIGH |
categories | string[] | No | Filter by category tags |
page | number | No | Page number (default 1) |
pageSize | number | No | Results per page (default 20) |
Example
get
Retrieves a single memory by its ID.
Signature
Example
Throws NotFoundError if the memory does not exist or does not belong to the workspace.
update
Updates a memory's content, metadata, categories, or priority. The memory is re-processed after an update.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the memory to update |
content | string | No | New memory content |
metadata | Record<string, unknown> | No | New metadata (replaces existing) |
categories | string[] | No | New category list (replaces existing) |
priority | MemoryPriority | No | New priority level |
Example
delete
Permanently deletes a memory. This action cannot be undone.
Signature
Example
promote
Promotes a TASK-layer memory (temporary, with expiration) to RAW layer (permanent, no expiration). Use this when a memory that was created as temporary context proves to be persistently relevant.
Signature
Example
feedback
Submits a quality signal on a memory. Feedback is used to improve retrieval quality over time.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the memory |
signal | FeedbackSignal | Yes | POSITIVE, NEGATIVE, or NEUTRAL |
comment | string | No | Optional explanation for the feedback |
Example
history
Returns the event timeline for a memory — creation, updates, promotions, and feedback submissions.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID of the memory |
page | number | No | Page number (default 1) |
limit | number | No | Events per page (default 20) |
Example
Related
- Advanced Search — search modes, filters, and feedback loops
- Knowledge — consolidated knowledge profile built from memories
- Type Reference —
Memory,SearchResult,PaginatedResult, and all related types