# Give your agents long-term memory, starting with the history you already have

URL: https://longtermmemoryai.dev/setup
Last updated: 2026-11-07
Published by Glen (https://tryglen.com), shared memory for coding agents.

> Run npx @tryglen/cli@latest install, choose which coding agents get the plugin, and sign in. Then run glen import to backfill your old local sessions, so recall starts with your last 30 days instead of an empty store. From then on every turn is recorded and recalled automatically.

Long-term memory that starts empty takes weeks to become useful. The quickest route is to install, then import the sessions already sitting on your disk. You need Node.js.

1. **Install the CLI and plugins** The installer finds the coding agents on your machine and asks which ones should get the Glen plugin.

   ```bash
   npx @tryglen/cli@latest install
   ```
2. **Sign in to your organization** The installer offers to sign you in. Your memory belongs to the organization you pick, so choose the one your team will share.
3. **Import your past sessions** Backfill old local agent sessions into memory. Glen's own advice is to import your last 30 days on day one. Skip it and recall has little to draw on until new sessions pile up.

   ```bash
   glen import
   ```
4. **Ask a question only your history can answer** Pick something you worked out weeks ago. The answer comes back with a citation for every claim, in about 10 seconds. A model writes it, so open the sources before you rely on it.

   ```bash
   glen search "why did we stop retrying failed uploads inline"
   ```
5. **Start a new agent session and work** Hooks load at session start. From here every turn is recorded, and agents with per-prompt recall get matching memories before the model reads each prompt.

## How recall reaches each agent

*Recall style per coding agent with Glen installed*

| Agent | How recall arrives | Docs |
| --- | --- | --- |
| Claude Code | Injected before the model reads each prompt | [tryglen.com/docs/claude-code](https://tryglen.com/docs/claude-code) |
| Codex | Injected each prompt through UserPromptSubmit's additionalContext | [tryglen.com/docs/codex](https://tryglen.com/docs/codex) |
| Pi | At the start of every turn | [tryglen.com/docs/pi](https://tryglen.com/docs/pi) |
| Cursor | On demand, when the agent runs `glen search` | [tryglen.com/docs/cursor](https://tryglen.com/docs/cursor) |
| Grok Build | On demand, when the agent runs `glen search` | [tryglen.com/docs/grok](https://tryglen.com/docs/grok) |

## Keeping long-term memory accurate

- Promote a decision that should always hold into `AGENTS.md` or `CLAUDE.md`, so it no longer depends on recall.
- When recall brings back something the team has since reversed, run `glen forget` on it. It is reversible with restore.
- For work that should not become team memory, `glen incognito` keeps recall on and records nothing. `glen off` stops both; `glen silent` records but surfaces nothing.

> **Import your history and start recalling today** One install command, then glen import. Free covers 15,000 memories and up to 3 people, no credit card. Install: `npx @tryglen/cli@latest install`. Start free at https://tryglen.com

Bringing teammates in next? [Setting up memory for a team's agents](https://memoryforaiagents.com/setup) starts from invites. Glen is hosted only, with no self-hosted build, and does not train models on your content. See the [privacy policy](https://tryglen.com/privacy) and [sub-processors](https://tryglen.com/sub-processors).

## Frequently asked questions

### Can I import old AI agent conversations into Glen?

Yes. glen import backfills old local coding-agent sessions into your organization's memory. Importing your last 30 days on day one is the recommended start.

### How much long-term memory does the free plan hold?

Free holds 15,000 memories for up to 3 people. Personal goes to 250,000 memories and adds integrations, and Team has no limits.

### Can I keep some sessions out of long-term memory?

Yes. glen incognito stops recording to team memory while recall keeps working, and the mode applies account-wide.
