Context-hook recall
Pi's context hook asks Remnic for relevant memories before the agent turn starts.
@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.
Pi's context hook asks Remnic for relevant memories before the agent turn starts.
agent_end, turn_end, and session_shutdown events feed Pi messages and tool activity into Remnic.
session_before_compact flushes Remnic LCM, then records the compaction token delta after Pi checkpoints.
The extension registers Remnic recall, store, LCM search, and inspection tools when the daemon token is configured.
# 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=....
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.