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

# Simple Memory

> @obversa/memory-simple provides an in-memory storage adapter for tests and ephemeral runs.

`@obversa/memory-simple` is an in-memory adapter that stores memory records in JavaScript process memory. It is designed for unit tests, local verification, and short runs that do not require durable storage on disk.

## Requirements

* Node.js 22.12 or later

## Install

```bash theme={null}
pnpm add @obversa/memory-simple
```

## Usage

```ts theme={null}
import { createSimpleMemory } from '@obversa/memory-simple';

const memory = createSimpleMemory({
  scope: 'example-run',
});

await memory.execute({
  command: 'create',
  path: '/memories/notes.md',
  text: 'Keep the result small.\n',
});

const result = await memory.execute({
  command: 'view',
  path: '/memories/notes.md',
});
```

## Commands

The adapter supports six memory operations:

* `create`: Write a new file at a path.
* `view`: Read file content, with optional line range.
* `str_replace`: Replace unique text inside a file.
* `insert`: Insert text at a zero-based line index.
* `delete`: Remove a file from memory.
* `rename`: Move a file to a new path.

## Limits

* Data is stored in memory and is discarded when the Node process exits.
* Default limits: 64 KB per file, 1 MB total memory per scope, and at most 256 files.
* Allowed file extensions: `.txt`, `.md`, `.json`, `.py`, `.yaml`, `.yml`.
