# OsMemory

> Encrypted memory shared by your AI tools through OsBox: notes per project, poisoning defences with held notes, secrets refused, team memory.

Source: https://osevel.com/docs/products/osmemory/

OsMemory keeps what your AI tools should know about you and your projects as short notes, in
one place only you can read. Every AI tool reads from it and adds to it through
[OsBox](https://osevel.com/docs/products/osbox/), so you do not explain the same thing again to each tool. You can see, fix
and remove everything it holds.

- [What it protects against](#what-it-protects-against)
- [Set up](#set-up)
- [What it stores](#what-it-stores)
- [How agents use it](#how-agents-use-it)
- [What waits for you, and what is refused](#what-waits-for-you-and-what-is-refused)
- [The OsMemory page](#the-osmemory-page)
- [Import](#import)
- [Team memory](#team-memory)
- [Where it lives](#where-it-lives)
- [With the other Os products](#with-the-other-os-products)
- [Limits](#limits)

## What it protects against

A memory is text that every later agent reads. So the attacks are on the content more than on
the storage.

- **Poisoning.** A page or a file an agent read makes it "remember" an instruction, and next
  week another tool follows it. In OsMemory, where a note may go depends on how far it would
  spread: an agent adds to its own project, but notes about you, which reach every project, wait
  for you. Text that addresses the model is held.
- **Leaking.** An agent stores a key or a customer's data, and later tools read it. Recognisable
  secrets are refused.
- **Reading.** Whoever runs the storage reads your notes. OsMemory's notes are sealed on your
  devices; Osevel's cloud holds boxes it cannot open.
- **Memory locked to one vendor**, and context files that drift apart or get committed by
  accident.

## Set up

OsMemory has no tool entry of its own. It is served by the OsBox gateway.

1. Install the CLI and link this computer to your account (see [OsVault](https://osevel.com/docs/products/osvault/#set-up)).
   OsMemory needs the link.

   ```bash
   npm i -g @osevel/cli
   ```

2. Connect your AI tools to OsBox, if you have not yet (see [OsBox](https://osevel.com/docs/products/osbox/#set-up)):

   ```bash
   osevel box connect
   ```

3. Start a session in a project. The tools `memory__recall`, `memory__remember` and
   `memory__forget` are there.

Check what is kept:

```bash
osevel memory
```

shows, per scope, the notes kept, the notes waiting for you and the count refused.

```bash
osevel memory list
```

lists the notes; `--held` lists those that wait. Waiting notes are decided in the dashboard,
signed with your account, not at the terminal.

## What it stores

A note is at most 500 characters of text with a kind, a scope, a source and a time.

| Kind     | Example                                       |
| -------- | --------------------------------------------- |
| About me | "Reply in Turkish", "I use pnpm, never npm"   |
| Project  | "Payments run on Stripe test mode in staging" |
| Decision | "OsVault has no Stop button, because …"       |
| Lesson   | "Do not run migrations on Fridays"            |
| Pointer  | "Bugs are tracked in Linear project ABC"      |

Three scopes:

- **me**: about you; read in every project.
- **project**: one project of yours. Not shared.
- **team**: shared with the people of a team; only accepted notes.

**A project is a folder, not a name.** The project is the folder with `.git` or `osevel.yaml`
above the folder the tool started in. It is bound to that folder's real path and gets a random
id. A repository cannot claim to be another project by what it says about itself. In the home
folder or the root there is no project: notes about you only.

To use an existing project's memory from another folder:

```bash
osevel memory project link <scope>
```

It shows a code in a window of its own, which you type back.

## How agents use it

- **`memory__recall(query)`** returns matching notes from **me** and from this session's
  project, best first, at most 20. Notes you wrote or accepted rank above agent notes, and agent
  notes are capped per answer. The notes arrive inside an untrusted-data block, each with its
  source.
- **`memory__remember(text, kind, scope)`** adds a note. The gateway binds `project` to this
  session's folder, never to a name the agent gives.
- **`memory__forget(id)`** retires a note written by this same session. An agent cannot retire
  another session's note.

The server's instructions carry no note text. Notes reach an agent only as tool results. Search
is by words; there are no embeddings.

## What waits for you, and what is refused

| An agent writes to | What happens                                                               |
| ------------------ | -------------------------------------------------------------------------- |
| project            | Stored at once. Flagged notes are held.                                    |
| me                 | Held until you look.                                                       |
| team               | Not possible. People propose team notes (see [team memory](#team-memory)). |

**Held** (shown in the dashboard, not given to agents until you decide):

- text that addresses the model ("ignore", "do not tell", "you must");
- hidden or format characters, and words that mix alphabets;
- paths to secrets (`~/.ssh`, `.env`, `~/.aws`);
- long random-looking runs and hex runs;
- text that matches a note you retired or that is held (no re-remembering);
- agent notes over 20 a day in one scope. Past twice that, they are refused.

URLs are shown as a badge, not held.

**Refused** (never stored): recognisable secrets anywhere in the text, also inside base64 or
hex, and the masked stand-ins of [OsBase](https://osevel.com/docs/products/osbase/). With the Osevel service, a note is also
compared with the values in your vaults, inside the service; after five such matches in a day
the service takes no more notes on that computer until the next day.

## The OsMemory page

In the dashboard, your memory is opened in the browser with your account key:

- **Waiting for you**: held notes with the reason; Keep or Drop.
- **New from agents**: the last 7 days by session, with "Retire all from this session".
- **All notes**: edit, retire.
- **Add a note about you.**
- **Your computers**: give a scope's key to another linked computer.

Every action is a record signed with your account key. A note's text is shown as text, never as
markup. The tool and computer of an agent's note are shown as what the agent's side says, not
as proven.

## Import

```bash
osevel memory import claude-code
```

| Source           | What it reads                                                            |
| ---------------- | ------------------------------------------------------------------------ |
| `claude-code`    | Claude Code's memory folder for this project.                            |
| `files`          | `CLAUDE.md`, `AGENTS.md` and `.cursor/rules` in the project.             |
| `chatgpt <file>` | ChatGPT's saved memories that you copied into a text file, one per line. |

The command shows the notes first and asks before it sends them. **Every imported note waits
for you** in the dashboard; nothing reaches an agent before you keep it. One import is one
session, so you can drop all of it at once.

- Files from a repository go to that project only, never to "about you".
- Long notes are split, duplicates are merged, secrets are refused. A file with any secret in
  it is left out whole.
- Files are opened without following links and must lie inside the project.
- At most 500 imported notes a day.

## Team memory

A team is the people of an [OsVault](https://osevel.com/docs/products/osvault/) vault, as each member's browser verifies them
from the vault's signed log.

- A person proposes a note in the dashboard. Another member accepts it. In a team of one, the
  only member keeps their own.
- An edited note is proposed again.
- Agents do not write to a team. They recall kept team notes.
- When someone leaves, a member makes a new team memory for the people left (one click). The
  kept notes are carried over as proposals. Until then, writes stop.

## Where it lives

- **Keys:** one key per scope, wrapped to your account key and to each linked computer.
- **The log:** append-only, chained and sealed. The cloud cannot invent, change or reorder a
  record without a computer or your browser noticing.
- **On the computer:** with the Osevel service (daemon mode on macOS and Linux, see
  [security](https://osevel.com/docs/security/model/#two-modes-unisolated-and-daemon)), the keys and the opened notes stay
  in the service; your side only asks. Without it, they are in your own folder.
- **Sync:** the cloud holds the shared copy; the local file is a cache that still reads
  offline.
- **What the cloud sees:** random scope ids, how many sealed records each holds, and when they
  change. Never text, never which repository a project is.

## With the other Os products

- [OsBox](https://osevel.com/docs/products/osbox/) serves OsMemory. Without the gateway, agents have no memory tools.
- [OsVault](https://osevel.com/docs/products/osvault/) gives the computer link and the account key, defines who is in a team,
  and its secret detectors refuse keys in notes.
- [OsBase](https://osevel.com/docs/products/osbase/) stand-ins for masked values are refused in notes.
- [OsBrain](https://osevel.com/docs/products/osbrain/) does not judge memory writes. OsMemory's own rules decide.

## Limits

- **"Data, not instructions" is a label.** A model may still follow text it recalls. The real
  defences are what may be written where, and you seeing it.
- **The checks catch obvious instruction text**, not a paraphrased "convention". Project notes
  an agent writes reach that project's agents before you read them.
- **Secret refusal is best effort.** A secret that is split, reworded or encoded unusually can
  get through.
- **Without the Osevel service**, a program running as you can read the memory and forge notes
  that look written by you.
- **Projects are kept apart against mistakes, not against an agent of the same user.** It can
  read any project's notes by starting a session in that folder.
- **A member who left a team keeps what they read.**
- **Not built:** writing memory into `AGENTS.md` or `CLAUDE.md` for tools without MCP, search by
  meaning, web tools (ChatGPT, claude.ai), deleting a team memory, and a notice when the cloud
  stops listing a scope.

Related: [OsBox](https://osevel.com/docs/products/osbox/), [OsVault](https://osevel.com/docs/products/osvault/), [OsBase](https://osevel.com/docs/products/osbase/), [OsBrain](https://osevel.com/docs/products/osbrain/),
[security model](https://osevel.com/docs/security/model/).
