Appearance
Short-term context
"Short-term" here means the context that lives only for the duration of one or a few turns: the prior conversation, the most-recent target snapshot, recent activity frames. It is short-term for the model — the underlying records are still durable in the store.
Sources of short-term context
| Source | Where it comes from |
|---|---|
| Prior messages | AgentsStore.loadMessages(sessionId) — full transcript so far |
| Target snapshot | loadSessionState(sessionId, 'snapshot') — captured at session start |
| Most-recent memories | MemoryActor.memory.search over the actor scope (default 10) |
| Active plan | MemoryActor.plan.active(mount) — if any |
| Recent events | only when profile.context.includeRecentEvents = true (the monitor profile) |
How it's assembled
OraclePromptBuilder.buildResumeContext (and the equivalent fresh-build path) composes:
SYSTEM PROMPT
| profile.systemPrompt (or generated from purpose)
| skill bundle (deterministic order)
| target snapshot (rendered tree)
| (optional) recent memories matched to the prompt
| tool list (JSON Schema)
USER MESSAGES
| prior messages from session
| the new promptThe order is fixed; the per-section content is profile-driven. The four prompt formats (legacy / edn / sexp / markdown) shape the rendering of these sections, not their content.
Memory cascade for short-term
profile.context.memoryScope (AgencyProfile.ts:3) decides the cascade:
| Scope | What memory is included on each turn |
|---|---|
none | nothing — short-term context contains zero memories |
session | memories saved during this session only |
instance | memories tied to this concrete actor instance |
actor | memories at the actor level (default for default profile) |
class | memories saved for any actor of the same class |
subtree | memories from the actor and all its descendants |
profile | memories saved under this profileKey (cross-target — used by propose and edit) |
global | unlimited cascade — admin-level |
The cascade is enforced in searchMemoriesCascade (AgentsStore.ts:251-259) using memoryBelongsToCascade.
What's NOT short-term
- Plans. Plans persist across sessions until completed. They live in
planswith active/completed status. - Embeddings. Once generated, embeddings persist with the memory. They are not regenerated each turn.
- Audit trail. Every cross-actor memory access is logged in
memory_access_log, regardless of how short-term the surrounding turn was.
See also
Source:
projects/matrix-3/packages/agents/src/profiles/AgencyProfile.ts:3-46(memory scopes),projects/matrix-3/packages/agents/src/AgentsStore.ts:251-265(cascade search).