# Storage

import Screenshot from "@docs/Screenshot.astro"
import SurfaceTabs from "@docs/SurfaceTabs.astro"
import AskRen from "@docs/AskRen.astro"

Storage is where Ren keeps things between chats. Anything Ren writes outside storage disappears when the chat ends. File stores hold documents and data files. Memory stores hold information Ren should remember. Databases hold structured data that Ren queries.

In the API and CLI, these are `fileStore`, `memoryStore`, and `podDatabase`.

## Choose a store

| Store        | Holds                                          | Example                                         | How Ren reaches it                            |
| ------------ | ---------------------------------------------- | ----------------------------------------------- | --------------------------------------------- |
| File store   | Files you give Ren or files it produces        | Brand assets, a pricing sheet, exported reports | A folder in every chat of an attached project |
| Memory store | Facts, decisions, and preferences, as Markdown | Team conventions, a customer's history          | A folder Ren reads when relevant and updates  |
| Database     | Tables Ren queries with SQL                    | A lead list, daily sales figures                | A SQLite file shared by the space's projects  |

Use a database when you need to filter, join, or aggregate rows. File and memory stores suit documents, Markdown, and config files. Don't keep git repositories or SQLite files in them; use a [repository](/docs/concepts/projects/#repositories) or a database instead.

## What Ren creates for you

| When                         | Ren creates                                                                                                                    |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Your organization is created | An organization file store and memory store, named after the organization, attached to the General space's **Default** project |
| You join an organization     | A personal file store and memory store, named after you, attached to the **Default** project in your personal space            |
| You create a project         | A `<project> Files` file store and a `<project> Memory` memory store, attached to the project                                  |

A space has no file or memory stores of its own, but each database belongs to a space.

Every new file store and memory store starts with an empty `AGENTS.md`. Ren reads it when it opens the store, so use it to say what the store is for and how to organize it.

## Ownership and access

A file store or memory store is either organization-wide or private to one person:

- **Organization-wide** stores are visible to every member, and any project in the organization can attach them.
- **Private** stores are visible only to their owner, and only that person's projects can attach them. Your personal stores and the stores of projects in your personal space are private.

Projects can share an attached file or memory store. Every project in a space can query its databases, and only that space's members can see them.

Only organization admins can open **Settings → Storage**. Any member can attach stores to a project from the project's **Storage** tab.

## Memory stores

A memory store is a folder of Markdown files. Ren reads it for past context and updates it with decisions, preferences, or customer facts. Project instructions define what Ren should keep.

Ren sees attached memory stores but doesn't load all their contents into every chat. When it opens a store, it reads `AGENTS.md`, then the files it needs. Your current request takes precedence over stored memory.

Your personal memory store may also hold a `WHOAMI.md` profile that Ren writes when you join, so it knows your role from your first chat.

<Screenshot
  shot="storage/memory-store"
  alt="A memory store open in the file browser, showing AGENTS.md and fact files"
/>

## Databases

A database is a SQLite file on the space's machine at `/home/user/db/<slug>.db`. Ren backs it up continuously, so it survives when the machine is replaced. Use one when Ren needs to store rows and query them, for example to track leads across daily runs or to feed an [artifact](/docs/concepts/artifacts/) dashboard.

All projects in a space share its databases, and projects in other spaces can't access them.

## Manage storage

<Screenshot shot="storage/settings" alt="Settings Storage with the Memory, Files, and Databases tabs" />

### Create a file store or memory store

<SurfaceTabs>
<Fragment slot="app">

1. Open **Settings → Storage** and choose the **Memory** or **Files** tab.
2. Select **New memory store** or **New file store**.
3. Choose where it goes: your organization, or a project. Choosing a project also attaches the store to it.
4. Enter a **Name** and select **Create memory store** or **Create file store**.

<Screenshot
  shot="storage/new-store"
  frame="detail"
  alt="The New memory store drawer with Add to set to the organization and a name entered"
/>

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Create a memory store called Support playbook and attach it to this project." />

</Fragment>
<Fragment slot="cli">

```sh
ren memory-stores create --name "Support playbook"
ren file-stores create --name "Brand assets" --visibility private
```

</Fragment>
</SurfaceTabs>

### Attach storage to a project

<SurfaceTabs>
<Fragment slot="app">

1. Open the project and go to its **Storage** tab.
2. Choose **Memory** or **Files**, then select **Attach memory store** or **Attach file store**.
3. Pick the store and select **Attach**.

To detach one, open its menu and select **Detach**. The store and its files stay.

<Screenshot
  shot="storage/attach"
  frame="detail"
  alt="The Attach memory store drawer with a store picked and the Attach button"
/>

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Attach the Brand assets file store to this project." />

</Fragment>
<Fragment slot="cli">

```sh
ren projects file-stores add <project-id> --file-store-id <id>
ren projects memory-stores add <project-id> --memory-store-id <id>
```

</Fragment>
</SurfaceTabs>

Attachment changes reach chats when the space's machine receives the update, usually within seconds.

### Upload files

Each file can be up to 50 MB.

<SurfaceTabs>
<Fragment slot="app">

1. Open the project's **Storage** tab, or **Settings → Storage**.
2. Open the store's menu and select **Browse**.
3. Drop files into the browser.

</Fragment>
<Fragment slot="ask-ren">

Attach the file to your message:

<AskRen prompt="Save this price list to the Brand assets file store." />

</Fragment>
<Fragment slot="cli">

Upload a file through the CLI:

1. Run `ren file-stores files start-upload`.
2. Upload the file to the returned URL.
3. Run `ren file-stores files finalize-upload`.

For small text files, use `ren file-stores files write-content` in one call. Memory stores use the same commands under `ren memory-stores files`.

</Fragment>
</SurfaceTabs>

An upload that isn't finalized doesn't appear in the store.

### Create a database

<SurfaceTabs>
<Fragment slot="app">

1. Open **Settings → Storage** and choose the **Databases** tab.
2. Select **New database**, choose the space, and enter a **Name**.
3. Select **Create database**.

Select **Copy path** on a database to copy its path on the machine.

<Screenshot
  shot="storage/new-database"
  frame="detail"
  alt="The New database drawer with the General team selected and a name entered"
/>

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Create a database called leads in this space with a table for company, contact, and stage." />

</Fragment>
<Fragment slot="cli">

```sh
ren pod-databases create <space-id> --name Leads
```

</Fragment>
</SurfaceTabs>

### Delete a store

After you delete a file or memory store, projects lose access on their next update. Ren keeps the files for 30 days, then deletes them permanently. Archived databases keep their backups.

<SurfaceTabs>
<Fragment slot="app">

1. Open **Settings → Storage** and choose the tab.
2. For a file store or memory store, select **Delete**. For a database, select **Archive**.

</Fragment>
<Fragment slot="ask-ren">

<AskRen prompt="Delete the Old campaign file store." />

</Fragment>
<Fragment slot="cli">

```sh
ren file-stores archive <id>
ren memory-stores archive <id>
ren pod-databases archive <space-id> <id>
```

</Fragment>
</SurfaceTabs>

## FAQ

<details>
<summary>Can I bring my memory from ChatGPT, Claude, or Claude Code?</summary>

Yes. Connect the assistant you already use to Ren, then ask it to push what it knows about you into a Ren memory store. See [Migrate from Claude Code](/docs/migrate/claude-code/).

</details>