> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hellofriday.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Memory

> Persistent state that accumulates across sessions and auto-injects into agent context.

Memory lets a space remember what happened across sessions. Friday automatically injects the 20 most recent entries from each narrative store into agent context at the start of every session — agents don't need to explicitly fetch memory for it to be available.

## 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:

```xml theme={null}
<memory space="my-space" store="notes">
- PR review for myorg/myrepo #42 completed — 2 critical findings (2026-04-29)
- User prefers compact summaries
</memory>
```

Agents can also write to memory explicitly during a job, recording summaries and facts for future sessions.

## Declaring memory stores

```yaml workspace.yml theme={null}
memory:
  own:
    - name: notes
      type: short_term
      strategy: narrative
    - name: history
      type: long_term
      strategy: narrative
```

Memory `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 store
* `memory_read` — explicitly fetch entries (for time-filtering or reading beyond the 20-entry window)
* `memory_remove` — remove a stale entry by ID

In a job, an LLM agent can write a session summary to memory:

```yaml workspace.yml theme={null}
agents:
  session-summarizer:
    type: llm
    description: "Summarizes the session and writes to memory."
    config:
      provider: anthropic
      model: claude-haiku-4-5
      prompt: |
        Summarize what happened in this session in 1-2 sentences.
        Write the result to memory using memory_save.
      tools:
        - memory_save
```

## 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)`

**Good:** `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 artifact**\
The agent creates an artifact via an LLM tool call. This returns `art_abc123`.

**Step 2 - write the reference to memory**\
The agent calls the `memory_save` tool with a terse string:

```
memory_save("Q1 analysis report -> art_abc123 (2026-04-29)")
```

**Step 3 - retrieve later**\
In a future session, the agent reads memory (auto-injected or via `memory_read`), sees the artifact ID, and fetches the full content:

```
artifacts_get(id="art_abc123")
```

## Memory mounts

Spaces can mount memory from other spaces — useful when multiple spaces share context:

```yaml workspace.yml theme={null}
memory:
  own:
    - name: notes
      type: short_term
      strategy: narrative
  mounts:
    - name: shared-kb
      source: "other-workspace-id/own/notes"
      mode: ro
      scope: space
```

`mode` is `ro` (read-only) or `rw` (read-write). Mounted stores also auto-inject into agent context.
