Core API

remember()

Store a semantic memory for an agent.

Signature

typescripttypescript
await ctx.remember(options: RememberOptions): Promise<MemoryRecord>

Parameters

FieldTypeRequired
agentstringyes
content.textstringyes
metadataRecord<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.