A memory is one markdown file your account keeps for its agents, at a path such as `team/conventions.md`. A [session](/docs/sessions) that lists the memory starts with a copy of the file in its environment.

## Give a session memories

```yaml title=".ellipsis/agents/sentry-fixes.yaml"
ellipsis:
  kind: agent
  name: sentry-fixes

trigger:
  type: cron
  schedule: '0 14 * * 1'

session:
  claude_code:
    prompt: |
      Fix the newest unresolved Sentry issue in api-repo
      and open a pull request.
    model: claude-opus-5-5
  environment:
    repositories:
      - name: api-repo
  memories:
    - team/*
    - sentry-fixes/*
  permissions:
    github: all
    ellipsis:
      - memories.list
      - allow: [memories.get, memories.create, memories.update, memories.delete]
        path: sentry-fixes/*
```

Every Monday at 14:00 UTC a session of `sentry-fixes` starts with every memory under `team/` and `sentry-fixes/` in its environment. Through the CLI the agent can list every memory, and can read and change only the ones under `sentry-fixes/`.

Each entry under `memories` is a memory's path or a pattern such as `team/*`. A pattern uses `*`, `?`, and `[...]`, and `*` matches across `/`. When the session's environment starts, every memory the entries match is copied into it under `/ellipsis/memories/`, at its path, so `team/conventions.md` is `/ellipsis/memories/team/conventions.md`. Listing a memory is enough to get its file. The copy needs no permission rule.

`memories` works the same in a `kind: agent` file's `session`, in a [`POST /v1/sessions`](/docs/api/sessions/post-sessions) request, and in an [agent session's request body](/docs/agents#override-settings-for-a-session), where a list replaces the agent's list. The `session` of a Slack, GitHub, Linear, or Sentry agent file takes it too, and so does a [code review](/docs/code-review) reviewer.

## Change a memory from a session

The files in the environment are copies, and nothing saves an edit to them. The agent changes a memory with the Ellipsis CLI. It can read a memory [kept in GitHub](#keep-memories-in-github) and can't change it.

| Command | What it does |
| --- | --- |
| `el memory create <memory-path> -f <file>` | Creates a memory with the file's content. |
| `el memory edit <memory-path> -f <file>` | Replaces a memory's content with the file's. |
| `el memory delete <memory-path>` | Deletes a memory. |
| `el memory list [pattern]` | Lists every memory, or the ones the pattern matches. |
| `el memory get <memory-path>` | Prints a memory. |
| `el memory pull <pattern>` | Copies every memory the pattern matches into `/ellipsis/memories/`. Outside a session it needs `-o <directory>`. |
| `el memory versions <memory-path>` | Lists a memory's versions. |
| `el memory get <memory-path> --version <version-id>` | Prints an old version. |

Listing the memories under `sentry-fixes/` prints each one's path, when it last changed, and who changed it.

```text
$ el memory list 'sentry-fixes/*'
PATH                            UPDATED           UPDATED BY
sentry-fixes/flaky-tests.md     2026-12-02 19:20  hbrooks
sentry-fixes/release-steps.md   2026-11-29 08:02  session_OuSX572onFXx
```

The session ID is shortened here.

What the session's own token can do to memories is set by `permissions.ellipsis`, like every other Ellipsis API operation. [Permissions](/docs/permissions#change-memories-under-one-path) lists the memory operations and the `path` key that limits a rule to some memories. A command that takes a memory's path finds the memory by listing it, so every command except `create` also needs `memories.list` on that path.

## Manage memories

People and scripts manage memories on the dashboard's **Memories** page, with the CLI, and through the [API](/docs/api/memories) and both SDKs, where `client.memories` has `create`, `list`, `get`, `update`, `delete`, and `versions`. A memory can also be a [file in GitHub](#keep-memories-in-github), which is changed only by editing the file.

```python
import os
from pathlib import Path
from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])
response = client.memories.create(path="team/conventions.md", content=Path("conventions.md").read_text())
print(response.memory.id)
```

```typescript
import { readFile } from 'node:fs/promises';
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({ apiKey: process.env.ELLIPSIS_API_TOKEN! });
const content = await readFile('conventions.md', 'utf8');
const { memory } = await client.memories.create({ path: 'team/conventions.md', content });
console.log(memory.id);
```

```bash title="CLI"
el memory create team/conventions.md -f conventions.md
```

Each of these creates `team/conventions.md` from a local file. Paths are unique in the account. A path is segments of letters, digits, `.`, `_`, and `-` joined by `/`, at most 512 characters, ending in `.md`.

An update takes the new content and replaces the old content whole. A path never changes. To move a memory, delete it and create it at the new path. [`PATCH /v1/memories/{id}`](/docs/api/memories/patch-memories-id) and [`DELETE /v1/memories/{id}`](/docs/api/memories/delete-memories-id) take `if_sha256`. With it, a memory whose content changed since you read it returns 409.

## Keep memories in GitHub

Every `.md` file under `.ellipsis/memory/` on a repository's default branch is a memory. In the [`.ellipsis` repository](/docs/organization#shared-configuration) the folder is `memory/`. The memory's path is the file's path under that folder. In an ordinary repository the repository's name leads it, so two repositories never claim one path. In the `.ellipsis` repository there is no prefix.

```text
api-repo:   .ellipsis/memory/testing.md      ->  api-repo/testing.md
web-repo:   .ellipsis/memory/testing.md      ->  web-repo/testing.md
.ellipsis:  memory/team/conventions.md       ->  team/conventions.md
```

A session lists a repository's memories with a pattern such as `api-repo/*`.

A push to the default branch syncs the files it touched. A new file creates a memory, a changed file updates it, and a removed file deletes it. Each change writes a version, recorded as written by the person who pushed.

A memory from a file has `managed_by` set to `github`, and its `source_details` names the repository, path, and branch it syncs from. A memory created through the API, the CLI, or the dashboard has `managed_by` set to `api`. Change a GitHub memory by editing its file. The API, the CLI, and the dashboard refuse to update or delete it, and the API returns 409 and names the file. An agent in a session can read a GitHub memory and can't change it.

A file that can't sync is not a memory. That happens when its memory path is already used by another memory or breaks the [path rule](#manage-memories), when the file is over the size [limit](#limits), or when the account is at its memory limit. A memory that already exists keeps the last content that synced and shows the reason in `last_sync_error`.

## Versions

Every create, update, and delete writes a version that holds the content after the change. A delete's version holds the content that was deleted. Each memory and version records who wrote it, a session, a person, or an API key. A sync with no known person records GitHub.

Versions are kept for 30 days by default. Set `data_retention.memory_versions_days` in your [account settings](/docs/api/account/patch-account-settings) to keep them for 1 to 365 days. Retention never removes a memory's current content. A deleted memory's versions stay readable through its ID until they expire.

## Limits

An account keeps up to 10,000 memories, and a memory holds up to 100 KiB. Your account may have a custom allowance.
