Skip to content

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.

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

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.

  • 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 nextTurn custom-message queue with triggerTurn: 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 /recall command displays results in the UI only — it does not inject them into the conversation context. /signet-status shows 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, and signet_remember are registered as LLM-callable tools. When the agent calls signet_recall, the results (including memory IDs) are returned into the conversation context via the tool response. signet_source_search searches provenance-backed artifacts separately from ordinary memory recall; signet_session_search searches active or completed session transcripts.
  • Hidden inject messages use display: false and role: "custom". Pi converts custom messages to role: "user" for the LLM, so the X-Initiator header (which determines Copilot billing attribution) is set based on the last message’s role — extensions cannot override it via an attribution field as Oh My Pi can.
  • Does not sync AGENTS.md into pi.

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:

Terminal window
# Use config file defaults
pi
# Disable Signet for a single session
SIGNET_ENABLED=false pi
# Create a config file to disable by default
echo '{"enabled": false}' > ~/.pi/agent/extensions/signet.json
Hook Supported
session-start yes
user-prompt-submit yes
pre-compaction yes
compaction-complete yes
session-end yes