Memory Types & TTL
Types
Types are just strings — use them as filters. Built-in suggestions:
| Type | Use for |
|---|---|
preference | User preferences and settings |
fact | Facts about the user |
feedback | Feedback on agent behavior |
project | Project context |
reference | Links and external resources |
general | Default 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 memoriesTTL
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 })