Pi Coding Agent integration

Pi, with memory that follows the turn.

@remnic/plugin-pi is the native Remnic extension for Pi Coding Agent. It uses Pi's extension hooks to recall context before turns, observe messages and tool activity after turns, expose Remnic MCP tools as Pi tools, and coordinate LCM before Pi compacts conversation history.

How it plugs in

Context-hook recall

Pi's context hook asks Remnic for relevant memories before the agent turn starts.

Turn observation

agent_end, turn_end, and session_shutdown events feed Pi messages and tool activity into Remnic.

Compaction coordination

session_before_compact flushes Remnic LCM, then records the compaction token delta after Pi checkpoints.

MCP tools as Pi tools

The extension registers Remnic recall, store, LCM search, and inspection tools when the daemon token is configured.

Install

# Install Remnic and start the daemon
npm install -g @remnic/cli && remnic daemon install

# Install the Pi connector
remnic connectors install pi

The installer writes an auto-discovered extension under ~/.pi/agent/extensions/remnic/, stores a private daemon URL and auth token in remnic.config.json, and runs a daemon health check.

To generate the connector token without writing the extension, pass --config installExtension=false. To target another daemon or namespace, pass --config remnicDaemonUrl=... and --config namespace=....

Pi slash commands

  • /remnic-status: check daemon health.
  • /remnic-recall <query>: recall relevant Remnic context.
  • /remnic-remember <memory>: explicitly store a memory.
  • /remnic-lcm-search <query>: search archived Pi context.
  • /remnic-why: inspect the last recall explanation.
  • /remnic-compact: request Pi compaction.

Configuration

The extension reads REMNIC_PI_CONFIG first, then ~/.pi/agent/extensions/remnic/remnic.config.json. Common keys include recallMode, recallTopK, recallBudgetChars, observeEnabled, compactionEnabled, mcpToolsEnabled, and requestTimeoutMs.