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

# Pi

> Give the Pi coding agent persistent, cross-session memory with Memanto.

# Pi + Memanto

<img src="https://mintcdn.com/memanto/1anYdeLUSJGeRrn_/logo/integrations/pi.svg?fit=max&auto=format&n=1anYdeLUSJGeRrn_&q=85&s=45ff5458e2b8ca4b9657967bcfbec7d7" alt="Pi" width="64" style={{marginBottom: "1.5rem"}} data-path="logo/integrations/pi.svg" />

Connect the [Pi coding agent](https://pi.dev) to Memanto so it can store and recall persistent memory across sessions.

## Connect via CLI (recommended)

```bash theme={null}
memanto connect pi
```

This installs three things into your project:

| Artifact         | Path                             | Purpose                                            |
| ---------------- | -------------------------------- | -------------------------------------------------- |
| Instruction file | `AGENTS.md`                      | Memanto usage rules, injected as a managed section |
| Skill            | `.pi/skills/memanto/SKILL.md`    | The `memanto-memory` reference guidelines          |
| Extension        | `.pi/extensions/memanto-sync.ts` | Auto-syncs `MEMORY.md` on session start            |

Add `--global` to install for every project instead:

```bash theme={null}
memanto connect pi --global
```

The global install writes to Pi's user directory — `~/.pi/agent/AGENTS.md`, `~/.pi/agent/skills/memanto/`, and `~/.pi/agent/extensions/memanto-sync.ts`.

## Auto-sync on session start

Pi has no JSON hook file, so Memanto ships its auto-sync as a Pi [extension](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/docs/extensions.md) — the same behavior the Claude Code integration gets from its `SessionStart` hook.

`memanto-sync.ts` listens for `session_start` and runs `memanto memory sync` in the background, so `MEMORY.md` is current before you start working. It is deliberately unobtrusive:

* **Fresh starts only.** It skips `/resume`, `/fork`, and `/reload` so re-entering a session doesn't re-sync.
* **Never blocks startup.** The sync is fire-and-forget; Pi is usable immediately.
* **Fails quietly.** If the `memanto` CLI isn't installed or isn't on `PATH`, the error is swallowed rather than surfaced on every launch.
* **Confirms only on success.** When the sync exits `0` and Pi is running with a UI, it posts a single `Memanto: memory synced` notification. A non-zero exit says nothing at all.
* **No dependencies.** It is a single self-contained file — no `npm install` step.

<Note>
  Pi loads project-local `.pi/extensions/` only after you have **trusted the project**. Until then the extension is inert and `MEMORY.md` won't auto-sync — run `memanto memory sync --project-dir .` by hand, or install with `--global`.
</Note>

## MCP

Pi does not support MCP, so the CLI connector above is the only integration path. Every other Memanto capability — `remember`, `recall`, `answer` — is available to Pi as ordinary shell commands, which is how the instruction file and skill tell it to work.

## Disconnect

```bash theme={null}
memanto connect remove pi
```

This removes the managed section from `AGENTS.md`, the skill directory, and the extension file. Add `--global` to remove the user-wide install.

## Next Steps

* [CLI: connect command](/cli/connect/connect)
* [CLI: connect remove](/cli/connect/remove)
* [Memory Types Reference](/reference/memory-types)
