Concepts
Memory types
Every saved record has one of five types. The type tells the agent how to use the record later, and lets you filter searches.
The five types
| Type | Use it for | Example |
|---|---|---|
decision | A choice between options, with the reason. Always fill context with the why. | ”Use pgvector, not ChromaDB. WHY: per-tenant row-level security in one Postgres.” |
solution | A fix or recipe that worked, so it can be reused. | ”Flaky login test: wait for the /session response, not a fixed timeout.” |
lesson | Something learned the hard way: a postmortem, a regression, a trap. | ”Never run migration 0042 twice; it is not idempotent.” |
convention | A rule of the codebase or team. | ”API errors use RFC 9457 problem+json.” |
fact | Anything else worth remembering. | ”Staging Postgres listens on port 5433.” |
memory_recall accepts type to narrow a search ("all" is the default).
Importance
memory_save takes an optional importance: critical, high, medium (default) or low. It multiplies the record’s score at recall time (×1.5, ×1.2, ×1.0, ×0.8). Reserve critical for things like migration blockers and security incidents; if everything is critical, nothing is.
Other kinds of memory
Besides typed records, TAM keeps a few specialised stores. You rarely call them directly; the agent or hooks do.
- Session summaries: what
session_endwrites andsession_initreads back. - Episodes: narratives of how a piece of work went, via
memory_episode_save. - Errors and rules:
learn_errorrecords failures; repeated patterns become rules loaded byself_rules_context. - Structured decisions:
save_decisionstores options, criteria and the rejected alternatives. - Workflows:
workflow_trackandworkflow_predictlearn which steps usually solve a kind of task. - Temporal facts: subject–predicate–object facts with validity dates. See Facts that change.
Duplicates and updates
Saving the same words again (ignoring case and punctuation) replaces the stored record, so it carries the latest date. Any other text, including a changed value, is stored as a new record. To retire the old value explicitly, see Facts that change.