@induction/pi-induction
A context-compression extension for Pi that runs Induction Subset on tool results before the model sees them.
Package details
Install @induction/pi-induction from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@induction/pi-induction- Package
@induction/pi-induction- Version
0.1.5- Published
- Nov 20, 2026
- Downloads
- 1,000/mo · 1,000/wk
- Author
- maxsiq
- License
- MIT
- Types
- extension
- Size
- 786.5 KB
- Dependencies
- 0 dependencies · 5 peers
Pi manifest JSON
{
"extensions": [
"./index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@induction/pi-induction
A context-compression extension that runs Induction Subset on tool results before the model sees them. The extension reduces incoming tool results to only what your main model needs.
Every tool the model can call gains a required pare_query parameter along
with instructions in the system prompt. When a call comes back with a query,
the extension sends the result and part of the context to the
Induction Subset endpoint and hands the model the subset in place of the
raw result. The endpoint stores the raw result and returns an id for it,
which the extension records in the Pi session, and a praxis_query tool
uses that id to return the result whole or answer a new query against it.
The endpoint keeps a stored result 30 days after its last use, so
praxis_query works after a restart or a compaction too.
Setup
Install it into Pi:
pi install npm:@induction/pi-induction
Then, start up a Pi session and run /induction_login. It opens the API Keys page at https://app.induction.ai/?page=api_keys and asks you to paste a key, saves it to ~/.pi/agent/induction.json, then starts Subset in the same session.
With no key saved, the extension does nothing but warn in Pi.
To change the 2048-character size under which results are shown whole, add
min_size_chars to the same file:
{ "api_key": "...", "min_size_chars": 4096 }
Subset activity
In interactive Pi, a panel above the editor shows concurrent subsets:
Induction Subset · 2 active
⠹ read 1.2s 42.0KB Find authentication settings
⠹ web_search 1.2s 86.0KB Compare weekend forecasts
- Up to three rows, with active subsets first and a count of additional rows. Including the heading and overflow count, the panel uses at most five lines.
- Animated activity indicators, elapsed time, tool names, and queries. MCP tool names omit their server prefix.
- Completed rows show the outcome and, when available, input/output size and text reduction. Each disappears three seconds after completion.
- Text reduction compares the source sent to Subset with its returned text, not Pi's truncated preview. Percentages round down; reductions below 1% omit the percentage.
- Sizes count UTF-8 bytes, not tokens. Queries on stored results omit the input size because it is not returned by the endpoint.
- The animation indicates activity, not percentage complete. The endpoint returns a final result without progress updates.
RPC clients receive a plain active-subset count instead. Print and JSON modes have no activity UI. The panel is not added to the model's context or session history.
To hide the panel and the Induction: <input> → <subset> line above each
subset result, add "show_ui": false to ~/.pi/agent/induction.json.
Subset still runs, and warnings still show. The setting takes effect on the
next session or /reload.
What the model sees
- A
<calling_tools>block appended to the system prompt, which instructs the model on how to usepare_query. pare_queryon every tool, including MCP tools. On a tool whose own schema forbids extra properties, the extension takespare_queryout of the call before Pi checks it, and puts it back in what the model sees on later turns.- Every text result with a
pare_querythat is overmin_size_chars(2048 characters by default) goes to the endpoint, which returns the text the model reads in place of the raw tool result.
A result with no pare_query, with images, or at or under min_size_chars
never reaches the endpoint: the model gets it as the tool returned it, or, for
an MCP or bash result Pi cut, the saved text cut at 100KB. The endpoint reads only text.