Skip to content

Memory Types & TTL

Types

Types are just strings — use them as filters. Built-in suggestions:

TypeUse for
preferenceUser preferences and settings
factFacts about the user
feedbackFeedback on agent behavior
projectProject context
referenceLinks and external resources
generalDefault catch-all

Any string works:

typescript
await tenant.remember({ content: "Using Next.js 15", type: "stack" })
await tenant.recall({ type: "stack" })

Tags

Tags allow cross-type filtering:

typescript
await tenant.remember({
  content: "Prefers organic milk from Whole Foods",
  type: "preference",
  tags: ["shopping", "groceries"]
})

await tenant.recall({ tags: ["shopping"] }) // returns all shopping-tagged memories

TTL

Set ttl (seconds) to auto-expire a memory:

typescript
await tenant.remember({
  content: "Currently debugging the auth flow",
  type: "context",
  ttl: 3600 // expires in 1 hour
})

Expired memories are excluded from recall() by default. Pass includeExpired: true to include them.

Filtering

typescript
// by type
await tenant.recall({ type: "preference" })

// by tag
await tenant.recall({ tags: ["shopping"] })

// full-text search
await tenant.recall({ search: "dark mode" })

// combined
await tenant.recall({ type: "preference", search: "milk", limit: 5 })

Released under the MIT License.