Signature
typescripttypescript
await ctx.remember(options: RememberOptions): Promise<MemoryRecord>Parameters
| Field | Type | Required |
|---|---|---|
agent | string | yes |
content.text | string | yes |
metadata | Record<string, unknown> | no |
Behavior
- Embeds
content.text - Stores original content unchanged
- Stores metadata as opaque JSON
- Assigns a UUID and timestamps
- Commits inside an ACID transaction
Example
typescripttypescript
const memory = await ctx.remember({
agent: "research",
content: {
text: "Stripe supports recurring invoices.",
},
metadata: {
source: "docs",
topic: "billing",
},
});
console.log(memory.id);
console.log(memory.createdAt);Returns
A MemoryRecord containing id, organization, agent, content, metadata, archived, and timestamps.