pi-dig

Adaptive inline research for OMP/Pi — fast answers with confidence-based escalation, query optimization, and context-safe sourcing

Packages

Package details

extension

Install pi-dig from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-dig
Package
pi-dig
Version
1.0.0
Published
Aug 1, 2026
Downloads
186/mo · 11/wk
Author
themuuln
License
MIT
Types
extension
Size
21.7 KB
Dependencies
0 dependencies · 0 peers
Pi manifest JSON
{
  "name": "pi-dig",
  "description": "Adaptive inline research — /dig quick answers with confidence-based escalation, query optimization, and context-safe sourcing",
  "extensions": [
    "./pi-dig.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-dig

Adaptive inline research for OMP / Pi. Starts fast, escalates only when results are thin, and keeps raw page content out of your context window.

Install

# OMP
omp install pi-dig

# Pi
pi install npm:pi-dig

Usage

/dig what is tRPC
/dig next.js vs remix 2026
/dig supabase edge functions pricing
/dig https://docs.example.com/api
/dig should I use zustand or jotai

Flags

Flag Effect
--fast Single round, no checkpoint — answer with what you found + caveats
--deep Larger budget: up to 16 research calls + 2 subagents
--lang=<code> Force answer language (ISO 639-1, e.g. mn, en)

Flags combine and may appear anywhere in the line:

/dig --fast --lang=mn supabase edge functions pricing

How it works

Triage → Phase 1 (3-4 calls) → dig_checkpoint → DONE | ITERATE | ESCALATE
  1. Triage — one interpretation assumed, URL queries fetch first, opinion questions never escalate, /research recommended for deep dives.
  2. Search query optimization (mandatory) — decompose compound questions into one facet per query, search for the answer's terms not the question's words, scope with operators (site:, after:, "exact phrase", -term), never repeat a failing query, mirror the wording of the best hit.
  3. Context-safe sourcing (mandatory)web_search snippets first; full pages only via targeted firecrawl scrape/extract; never raw HTML in the transcript; no curl/bash HTTP fetching.
  4. Confidence checkpoint — reports sources, quality, contradictions, coverage, confidence. Verdict rules:
    • DONE — ≥2 non-weak sources, full coverage, confidence ≥ 0.7, zero unresolved contradictions
    • ITERATE — 2-3 reformulated queries targeting the gaps, then answer
    • ESCALATE — 1-2 read-only isolated subagents (max 3-4 calls each), merged findings, then answer
    • Opinion/recommendation questions always take DONE with stated criteria
  5. Budget caps — 10 calls default (16 --deep), one checkpoint per run, ~3-minute time-box.

Answers are date-aware ("Today is {DATE}"), match the query's language, and cite only pages actually inspected.

What it registers

  • /dig command — adaptive research
  • dig_checkpoint tool — confidence gate the agent must call after Phase 1

License

MIT