# SoL-Pi

> A standalone extension for the Pi coding agent that adds four opt-in token-efficiency mechanisms found through scaled auto-research loops.

SoL-Pi is an NVIDIA (NVlabs) research project and MIT-licensed standalone extension for the Pi coding-agent harness. It packages four efficiency mechanisms that reduce repeated model turns, context replay, oversized observations, and long-log reading. It installs on top of an unmodified Pi release, and every mechanism is opt-in and disabled by default.

## What It Is

SoL-Pi extends Pi through its public extension APIs without patching Pi. It came out of auto-research loops in which agents built executable environments from public data, observed how models explore, and searched for harness changes under an efficiency objective with a predeclared capability floor. The four mechanisms that survived are Action Fusion, ObservationPack, Evidence-Preserving Reducer, and Online Context Compact.

## The Four Mechanisms

- **Action Fusion** runs an edit or write and its follow-up validation command in a single tool call, returning one combined observation.
- **ObservationPack** archives large tool results locally, leaves a stable handle and short excerpt in context, and recalls exact pages on demand.
- **Evidence-Preserving Reducer** delegates first reading of long diagnostic logs to a cheaper model and accepts a compact receipt only when every quoted line matches the archived log.
- **Online Context Compact** treats completed plan steps as candidate points for Pi's native compaction, acting only when economic and window-pressure checks pass.

## Setup Path

It requires Node.js 22.19 or newer and Pi (`@earendil-works/pi-coding-agent`) 0.85.1. Install with `pi install git:github.com/NVlabs/SoL-Pi`, either globally or project-local. Configuration lives in `sol-pi.json`, either in `.pi/` in a trusted project or in `~/.pi/agent/`. Feature flags, the reducer provider/model route, and the compaction ratio are set there.

## Storage and Security Notes

ObservationPack and the reducer store session-specific archives locally, and these are not deleted automatically when the session ends. The reducer may send eligible log content to its configured reducer model, so the project advises against enabling remote reduction for logs that must stay local.

## Reported Results

The project reports that on EdgeBench, SoL-Pi retains roughly 94% of Pi's average score while using 45-49% fewer tokens than Pi. It also reports about one-third lower cost than Pi, using official API-equivalent pricing. On Terminal-Bench 4, it solved 15 of 63 tasks versus 18 for Pi and for Codex, at lower total cost. These figures come from the project's own paper and blog.

## Features
- Action Fusion: edit plus follow-up command in one tool call
- ObservationPack: stable handles with exact paged recall of large outputs
- Evidence-Preserving Reducer: verified compact receipts for long diagnostic logs
- Online Context Compact: compaction at completed-subtask boundaries
- Opt-in mechanisms configured via sol-pi.json
- No Pi source patches; uses public Pi extension APIs
- Local archives preserve original observations

## Integrations
Pi coding agent

## Platforms
LINUX, WEB, API, CLI

## Pricing
Open Source

## Links
- Website: https://nvlabs.github.io/SoL-Pi/
- Documentation: https://github.com/NVlabs/SoL-Pi/blob/main/docs/configuration.md
- Repository: https://github.com/NVlabs/SoL-Pi
- EveryDev.ai: https://www.everydev.ai/tools/sol-pi
