How memory works
Each space declares one or more memory stores. At session start, the platform injects recent entries into the agent’s system prompt as labeled blocks:Declaring memory stores
workspace.yml
own is a list of store objects, each with a name, type, and strategy.
| Field | Options | Description |
|---|---|---|
type | short_term, long_term | Short-term suits rolling context; long-term accumulates durable facts |
strategy | narrative | Narrative stores auto-inject into agent context |
What auto-injects
The 20 most recent entries from every narrative store in the space are injected at session start. You don’t configure this per-agent — if the space has memory, every agent gets it.Reading and writing memory
Agents use built-in platform tools — no MCP server required:memory_save— write a new entry to a storememory_read— explicitly fetch entries (for time-filtering or reading beyond the 20-entry window)memory_remove— remove a stale entry by ID
workspace.yml
Keep entries terse
Memory is injected on every session — verbose entries waste context tokens and dilute signal. Rules:- One fact per entry, under ~100 characters
- No preamble (“The user said that…”) — write the fact directly
- Suffix time-sensitive entries with
(YYYY-MM-DD)
PR review for myorg/repo #42 — 2 critical findings (2026-04-29)
Avoid: The user asked me to review a pull request and I found that there were two critical security issues in the authentication module
Large content: use artifact references
Don’t write large results directly to memory - they’ll bloat every future session’s context. Instead save the content as an artifact and store a short reference: Step 1 - save the artifactThe agent creates an artifact via an LLM tool call. This returns
art_abc123.
Step 2 - write the reference to memoryThe agent calls the
memory_save tool with a terse string:
In a future session, the agent reads memory (auto-injected or via
memory_read), sees the artifact ID, and fetches the full content:
Memory mounts
Spaces can mount memory from other spaces — useful when multiple spaces share context:workspace.yml
mode is ro (read-only) or rw (read-write). Mounted stores also auto-inject into agent context.
