Pi
pi (pi)
Section titled “pi (pi)”pi uses a managed Signet runtime extension installed by
@signetai/connector-pi. The extension forwards lifecycle events
to the daemon and injects hidden Signet context into the session when
needed.
Files managed by Signet
Section titled “Files managed by Signet”| File | Description |
|---|---|
PI_CODING_AGENT_DIR/extensions/signet-pi.js |
Managed extension bundle when PI_CODING_AGENT_DIR is set |
~/.pi/agent/extensions/signet-pi.js |
Managed extension bundle in the default pi agent directory |
Managed extension
Section titled “Managed extension”During setup or connect, the connector writes a bundled
signet-pi.js file into the pi extensions directory. If
PI_CODING_AGENT_DIR is set, Signet uses that agent directory.
Otherwise it writes to ~/.pi/agent/extensions/. The file can contain the
configured Signet API key, so Signet writes it with mode 0600 and resets a
broader mode on every setup or sync run.
Runtime behavior
Section titled “Runtime behavior”- Existing unrelated pi extensions are left untouched.
- Signet refuses to overwrite a colliding unmanaged
signet-pi.js. - Daemon or network failures are fail-open, so prompt handling, compaction, session switches, and shutdown continue even if Signet is unavailable.
- Automatic recall: On every user prompt, the extension starts a prompt-submit request without delaying input acceptance and waits for it once before the agent starts. Session context, recall, and the prompt clock are combined into one hidden custom message (
display: false) that Pi persists in its session history. Later model requests retain the exact inserted content, including the original clock, until normal compaction or history changes. A failed or timed-out prompt-submit is not retried for the same prompt. - Late context: Notifications polled during a run and recall from steering input use Pi’s
nextTurncustom-message queue withtriggerTurn: false. Pi persists and includes them with the next non-streaming user prompt, not a continuation or steering message in the active run. Late context never starts an extra model turn on Pi 0.66.1 or 0.99.1; queued content is lost if Pi exits before that next prompt. - Session history: Resume, switch, and fork do not inject session context again when Pi’s effective model history still contains it. Combined messages record whether they contain session context, recall, or a clock; clock-only and recall-only messages do not suppress newly available session context. Legacy session-context messages remain recognized. After compaction, Signet refreshes session context and includes it with the next prompt only if compaction removed the previous context message.
- Evidence: Hidden Signet messages, including legacy custom types, are excluded from transcript reconstruction and from both history and split-turn compaction summarization inputs. They do not become new evidence through those paths.
- Manual commands:
/recall <query>and/remember <content>let users explicitly search and store memories. The/recallcommand displays results in the UI only — it does not inject them into the conversation context./signet-statusshows connection and memory stats./remember <content>— save a memory/remember critical: <content>— save as pinned (never decays)/remember [tag1, tag2]: <content>— save with tags/remember critical: [tag1, tag2]: <content>— pinned with tags (critical prefix must come first)
- Agent tools:
signet_recall,signet_source_search,signet_session_search, andsignet_rememberare registered as LLM-callable tools. When the agent callssignet_recall, the results (including memory IDs) are returned into the conversation context via the tool response.signet_source_searchsearches provenance-backed artifacts separately from ordinary memory recall;signet_session_searchsearches active or completed session transcripts. - Hidden inject messages use
display: falseandrole: "custom". Pi converts custom messages torole: "user"for the LLM, so theX-Initiatorheader (which determines Copilot billing attribution) is set based on the last message’s role — extensions cannot override it via anattributionfield as Oh My Pi can. - Does not sync
AGENTS.mdinto pi.
Configuration
Section titled “Configuration”Configuration is optional and loaded from ~/.pi/agent/extensions/signet.json
(or $PI_CODING_AGENT_DIR/extensions/signet.json if set). The SIGNET_ENABLED
environment variable overrides the file setting.
Optional ~/.pi/agent/extensions/signet.json:
{ "enabled": false}| Option | Description | Default |
|---|---|---|
enabled |
Whether Signet is enabled by default | true |
Environment Variable (overrides file config):
| Variable | Description |
|---|---|
SIGNET_ENABLED |
Set to false to disable |
SIGNET_PROMPT_SUBMIT_TIMEOUT |
Prompt-submit daemon wait budget in ms (default 5000) |
Examples:
# Use config file defaultspi
# Disable Signet for a single sessionSIGNET_ENABLED=false pi
# Create a config file to disable by defaultecho '{"enabled": false}' > ~/.pi/agent/extensions/signet.jsonSupported hooks
Section titled “Supported hooks”| Hook | Supported |
|---|---|
| session-start | yes |
| user-prompt-submit | yes |
| pre-compaction | yes |
| compaction-complete | yes |
| session-end | yes |

