Memory
Memory files give Posit Assistant persistent context. They’re loaded automatically at the start of every conversation, so the assistant always knows your preferences and your project’s conventions, architecture, and setup.
Memory Files
Memory lives at two levels:
- User memory —
~/.posit/assistant/AGENTS.md: your global file, for personal preferences and cross-project context (for example, “I prefer metric units” or “always use ggplot2”). It’s loaded in every session, even when no project folder is open. - Project memory —
AGENTS.mdin the project root: project structure, coding conventions, preferred libraries, deployment details, or anything else the assistant should know about this project.
Both files are plain Markdown. When the two conflict, project memory wins.
Personal project memory (AGENTS.local.md)
For notes that are yours alone, such as your local interpreter path or a personal preference for this project, create an AGENTS.local.md next to the project’s AGENTS.md. It loads after the shared file and overrides it where they conflict.
Create the file yourself; Posit Assistant never creates it. Add AGENTS.local.md to your .gitignore so it isn’t committed. Posit Assistant doesn’t edit .gitignore or check that the file is ignored. If the file exists, the assistant may save personal facts about the project to it; other project facts go to AGENTS.md. Like project memory, it’s only loaded in trusted workspaces, and it’s listed in the trust prompt.
Memory files in subdirectories
You can also put an AGENTS.md in a subdirectory, for example packages/api/AGENTS.md. When the assistant reads a file in that directory or below, it also loads that subdirectory’s memory file (and those of any directories in between), delivered automatically in the next message as project memory rather than user attachments. An AGENTS.local.md in a subdirectory loads too, after the AGENTS.md beside it. A subdirectory file applies only to files in its own directory and below, and when several apply, the one closest to the file wins. Like project memory, subdirectory files are only loaded in trusted workspaces.
Memory files in parent directories
The assistant also loads AGENTS.md files (and any AGENTS.local.md beside them) from the directories above your project folder. For a project inside your home directory, for example ~/work/repo, it looks in each directory up to and including your home directory, so ~/work/AGENTS.md and ~/AGENTS.md both apply. For a project outside your home directory, it looks in each directory above the project, but not at the filesystem root. Files closer to your project folder win over ones farther up. Trusting the workspace also trusts these files, and the trust prompt lists them.
Creating and Updating Memory
Use the /savememory command to create or update your project memory file:
/savememory
Use /savememory user to target your user-level memory file instead:
/savememory user I prefer metric units
The assistant will write or update the memory file based on the current conversation. You can add specific instructions:
/savememory Remember that we use tidymodels for all modeling and testthat for tests
The assistant also routes facts on its own when you ask it to remember something: personal preferences go to the user file, project facts go to the project file.
You can also edit the memory files directly in your editor — they’re just Markdown. The overflow menu (gear icon — in the top bar, or in the sidebar footer’s icon rail in the sidebar layout) has Open project memory and Open user memory entries that open or create the right file. These entries aren’t available on Posit Connect, where the file can’t be opened in a local editor.
Including Other Files
Reference additional files from your memory file using the @filename.md syntax:
# Project Memory
This project uses R with tidyverse conventions.
See also:
@docs/api-reference.md
@docs/coding-standards.md
Referenced files are resolved relative to the memory file’s directory and may not escape it.
Workspace Trust
Project memory files are only loaded in trusted workspaces. This prevents untrusted projects from injecting prompts into the assistant’s context. The user-level memory file is your own file — like your settings — and loads regardless of workspace trust.
Use /trust to mark a workspace as trusted, or respond to the trust prompt when opening a new project.