# mem · agent memory store

Three operators, one tool. Remember, recall, forget — with full-text search backed by SQLite.

<p align="center">
  <img src="assets/demo.gif" alt="mem demo — install skill, remember, recall, search" width="860" />
</p>

<p align="center">
  <a href="https://skills.sh/runablehq/memory/mem"><img alt="skills.sh" src="https://img.shields.io/badge/skills.sh-install-green"></a>
  <a href="https://runable.com/npm/@runablehq/mem"><img alt="runable" src="https://img.shields.io/badge/runable.com-try%20it-blue"></a>
</p>

## Setup

### As an agent skill (recommended)

```bash
npx skills add runablehq/memory --all --global
```

This installs the `mem` skill for all your agents via [skills.sh](https://skills.sh/runablehq/memory/mem). Your agent will automatically know how to store and recall information across sessions.

### Manual install

```bash
# requires bun
bun build --compile src/cli.ts --outfile dist/mem
cp dist/mem ~/.local/bin/mem
```

## Usage

```
mem [query]                     recall (search, list, or get by ID)
mem + "content" [--tag a,b]     remember
mem - <id>                      forget
```

### Remember

```bash
mem + "chose SQLite for simplicity" --tag architecture
mem + "user prefers dark mode" --tag prefs
mem + "deploy: bun build --compile" --tag deploy
mem + --image ./screenshot.png --title "Current UI" --tag ui
echo "long content" | mem + --tag notes
```

### Recall

```bash
mem                             # list recent
mem "deploy"                    # search
mem 7sjtNVyZrNIa                # get by ID
mem --tag prefs                 # filter by tag
mem "api" --limit 5 --json     # limit + JSON output
```

### Forget

```bash
mem - 7sjtNVyZrNIa              # forget one
mem - id1 id2 id3               # forget many
```

### Piping

```bash
mem "old" --json | jq .         # pipe to jq
mem "old" --json | jq -r '.[].id' | xargs -I{} mem - {}
echo "long content" | mem + --tag notes
```

## Flags

```
--tag a,b     filter (read) or apply (write)
--json        structured JSON output
--full        full content inline
--limit n     max results (default 20)
--image path  attach image
--title text  set title
--export dir  export image
```

## Storage

`~/.mem/mem.db` — SQLite with FTS5 full-text search.
