Task-driven tools
Pi includes governance, policy, retrieval, knowledge, onboarding, or usage guidance in the prompt only when the task needs it. The runtime guard remains active in the background.
Local indexing, ranked retrieval, task-driven tool loading, semantic compaction, and transparent telemetry for Agent Watch.
Pi includes governance, policy, retrieval, knowledge, onboarding, or usage guidance in the prompt only when the task needs it. The runtime guard remains active in the background.
FTS5, symbols, and the import graph live under .pi/piagent-state/context-engine/. Storage is restricted to the current OS account; policy changes retry FTS rebuild and VACUUM until purging completes.
Explicit paths, lexical matches, symbols, Git signals, test relationships, positive feedback, and graph rank are combined before packing into a hard token budget.
Preserves the goal, decisions, changed files, verification, and blockers. Removes repeated logs, source excerpts, and superseded plans.
Walks the import graph backward from changed files to suggest dependents and focused tests before running the full suite.
Local events include session, model, thinking, tool surface, retrieval confidence, context-use ratio, and waste metrics without storing raw prompts or outputs a second time.
Protected paths and secret files are excluded. The directory uses mode 0700; database, WAL, and SHM files use 0600. Normal refresh uses SQLite core and FTS5 secure delete. Full FTS rebuild and VACUUM run only when exclusion policy changes or an interrupted purge must resume, not on every prompt or refresh.
/context index
/context rebuild
/context pack Fix invoice calculation
/context impact
/usage efficiencypiagent-context rebuild
piagent-context pack "Fix invoice calculation" --tokens 4000
piagent-context efficiency