Three kinds of context
| Context | Purpose | Scope |
|---|---|---|
| Recent history | Keeps the latest turns verbatim, including tool-aware context | One chat |
| Compacted history | Summarizes older turns when a chat becomes long | One chat |
| Durable memory | Recalls relevant facts in future conversations | Tenant, external subject, or restricted knowledge base |
Compaction does not depend on durable memory. A long chat can retain continuity even when durable memory is disabled or temporarily unavailable.
Durable-memory settings
Durable memory is opt-in at the tenant level:| Setting | Values | Behavior |
|---|---|---|
mode | disabled, durable | Enables or disables cross-conversation memory |
retention | none | Recall may be configured, but new facts are not stored |
retention | explicit_only | Store facts only when a user explicitly asks |
retention | automatic | Store useful facts automatically and accept explicit requests |
kbMemoryMode:
| KB mode | Behavior |
|---|---|
disabled | Skip durable recall and storage for this knowledge base |
subject | Use the caller’s normal tenant or external-subject memory scope |
kb_restricted | Use a separate memory scope isolated to this knowledge base |
Scope by caller
| Caller | Durable-memory scope |
|---|---|
| Dashboard user | Tenant-wide memory |
API end user with external_subject_id | Tenant plus that external subject |
API-key chat without external_subject_id | Durable recall and storage are skipped |
Any caller on a kb_restricted knowledge base | Separate scope for that knowledge base |
Recall lifecycle
Prepare chat context
Long histories are compacted when needed. Recent turns remain verbatim and the older summary preserves decisions and prior context.
Resolve the memory scope
AutoSage applies the tenant policy, knowledge-base mode, caller type, and
external_subject_id before any recall.Recall relevant facts
Relevant durable memories are selected from the resolved scope and added as context for the current message.
Generate the answer
Memory context is combined with recent history, the new message, and any knowledge-base or tool results.
memory_used boolean rather than exposing recalled memory contents.
Explicit memory
When durable memory is enabled and retention isexplicit_only or automatic, users can store a fact directly with phrasing such as:
Management endpoints
| Method | Path | Purpose |
|---|---|---|
GET | /tenants/:id/memory-settings | Read tenant mode and retention |
PATCH | /tenants/:id/memory-settings | Update tenant mode or retention |
GET | /tenants/:id/memories | List or search tenant memories with q, limit, and offset |
DELETE | /tenants/:id/memories/:memoryId | Delete one tenant memory |
GET | /tenants/:id/memories/graph | Read the tenant entity graph |
GET | /knowledge-bases/:id/memories | List or search kb_restricted memories |
DELETE | /knowledge-bases/:id/memories/:memoryId | Delete one restricted memory |
GET | /knowledge-bases/:id/memories/graph | Read the restricted entity graph |
kb_restricted mode.
See the Tenant API, Knowledge-base API, and Memory product docs for configuration and management details.
Next steps
Durable memory
Choose retention and knowledge-base memory modes.
Prompt assembly
See where memory and compacted history enter a run.