Memories
client.memories manages text notes owned by one Agent. userId partitions a Memory to an End-user; "" creates Agent-general Memory.
Overview
Attribution is immutable after creation. Lists support exact userId, full-text search, opaque cursor, and limit; omitted userId returns every partition.
Methods
create()
create(agentId: string, body: { text: string; userId?: string }): Promise<MemoryResponse> — POST .../memories. userId defaults to "".
list()
list(agentId: string, options?: { cursor?: string; limit?: number; search?: string; userId?: string }): Promise<MemoriesListResponse> — GET .../memories. limit defaults to 50 and accepts 1–100.
get()
get(agentId: string, memoryId: string): Promise<MemoryResponse> — GET .../memories/:memoryId.
update()
update(agentId: string, memoryId: string, body: { text: string }): Promise<MemoryResponse> — PATCH .../memories/:memoryId. Text is required; Attribution cannot change.
delete()
delete(agentId: string, memoryId: string): Promise<void> — DELETE .../memories/:memoryId.
Types
MemoryResponse wraps { memory }. A Memory contains IDs, immutable userId, text, timestamps, and lastAccessedAt; list responses use { data, nextCursor }. See objects and schemas.
Errors
Empty or oversized text and empty search strings are invalid_request; inaccessible Memories are not_found. See errors.
Example
import { BlazingAgents } from "@blazing-agents/sdk";
const client = new BlazingAgents({ apiKey: process.env.BLAZING_AGENTS_API_KEY! });
const agentId = "ag_0123456789abcdef";
const { memory } = await client.memories.create(agentId, {
userId: "user-42",
text: "Prefers concise release notes.",
});
const page = await client.memories.list(agentId, {
userId: "user-42",
search: "release",
});
await client.memories.update(agentId, memory.id, { text: "Prefers short release notes." });
console.log((await client.memories.get(agentId, memory.id)).memory.text, page.data.length);
await client.memories.delete(agentId, memory.id);