# pair, the memory companion

Companion to the All Things Agentic post **Memory: Why Your Agent Forgets You**.

A tiny multi-turn coding helper. The in-run conversation history lives in an `SQLiteSession(":memory:")`. Durable facts live in a Chroma vector store under `./.pair-memory/` and survive between runs.

## Run it

```bash
cd static/code/memory-why-your-agent-forgets-you
uv sync
export OPENAI_API_KEY=sk-...
uv run python pair.py
```

## Two-session demo

Session 1:

```
pair> (type :q to exit)
you> I use uv and pytest. My project is at ~/code/foo.
pair> Got it: uv + pytest, project at ~/code/foo. What can I help you run or fix?
you> :q
```

Quit. Re-run:

```
pair> (type :q to exit)
you> remind me what dev stack I told you about earlier
pair> - Project path: ~/code/foo
- Package manager: uv
- Test runner: pytest
you> :q
```

The second session is a fresh process. The recall came from the on-disk vector store under `./.pair-memory/`.

## Shell tool

The agent has one read-only shell tool, allowlisted to `ls`, `cat`, `pytest`, `uv`. Anything else is refused. The allowlist is the safety boundary; do not loosen it without reading the post's footgun section.

## Reset memory

```bash
rm -rf .pair-memory/
```
