omp packages

pi-grasp0.4.6

Pi extension for web and GitHub search plus reusable local document research

GitHub Actions Published 1 day ago MIT ~549 downloads/mo

Untested on omp

This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.

Did it work for you?

Result

One report per person. A new report replaces your old one.

Reports 0

No reports yet.

Readme

pi-grasp

A Pi extension for finding and reading public sources, searching retained papers and books, and inspecting figures and PDFs. See installation, tool arguments, and development checks.

pi install npm:pi-grasp@0.4.6
Tool Use
document_prepare Capture reusable documents, prepare requested extraction/index views, resume work or manage saved sources.
document_search Locate candidate passages or pages within explicit retained sources.
document_read Read saved evidence or original page/region images; continue with next_read.
web_search Discover public sources on the open web, or in Reddit, Hacker News or X discussions.
web_read Acquire a public source or expand a session snapshot.
web_view Inspect a static image or browser screenshot.
web_crawl Discover links, map sitemaps, read selected URLs or crawl a bounded topic.
github_search Search public repositories, code, issues and pull requests.

With default standalone settings on stable Pi 1.x starting at 1.6, new chats initially declare only load_research from this package. It lists the available research tools. Load exact names together, then call those tools with their normal arguments:

{"names":["web_search","web_read"]}

See tool loading to preload tools or keep them all active.

Requirements

Requires Node.js 22.19+, npm and Pi 1.x from 1.1.0; use Pi 1.6.0 or later for a fresh setup. Git installs need git on PATH. Pi supplies the TypeBox 1.3.27 peer. Every install includes the compiled extension and prebuilt locking bindings, so nothing compiles on your machine. Python is needed only for the optional PDF runtime.

Feature Additional requirements
Search, static web/GitHub/HTML/text reads, direct images Core install only.
Retained HTML/text documents A bundled file-locking binding for macOS ARM64/x64, glibc Linux ARM64/x64 or Windows x64 (experimental).
Browser rendering and screenshots Matching Playwright Chromium on a supported OS. On supported Linux systems, run npx playwright install-deps chromium from the installed package directory to use its Playwright version. This may require sudo. See Windows execution.
PDF text, OCR and page images Standard 64-bit CPython 3.12–3.14 with the GIL and venv. The setup preflight accepts macOS 14+ Apple Silicon, Linux glibc 2.28+ x86-64/ARM64, or Windows x86-64 Python. On Debian 12, install libgl1, libglib2.0-0 and libxcb1; other Linux distributions need the corresponding shared libraries. See Windows execution.
Optional PDF structure The PDF runtime above, plus a separate offline Docling 2.126.0 environment and prefetched layout/table models; qualified with CPython 3.12. See structured PDF setup.
Semantic document search (EmbeddingGemma 2, "EG2") A llama.cpp embedding server on localhost; visual indexing also needs the matching vision projection. See local EG2 setup.

The full Git lifecycle with Chromium and PDF/OCR was verified on macOS ARM64 and Debian 12 ARM64. Core install and retained text were also verified on macOS x64 under Rosetta and Linux x64 under emulation. The PDF preflight covers the pinned wheels and accepts more platforms than have been tested. Intel Mac, Alpine/musl and native Windows ARM64 Python are unsupported for PDF features.

Install

Check the intended executable with pi --version. Its configuration directory (default ~/.pi/agent) owns personal packages; Pi binaries sharing it share the package list.

pi install npm:pi-grasp@0.4.6
pi list

Pin the version as shown; pi update leaves pinned packages alone. Disable any competing search adapter in pi config to avoid duplicate tool names. To uninstall, see Remove package and runtimes.

For another profile, set PI_CODING_AGENT_DIR before both installation and launch:

  • POSIX: export PI_CODING_AGENT_DIR=/absolute/path/to/profile
  • PowerShell: $env:PI_CODING_AGENT_DIR = 'C:\path\to\profile'

For a project-only installation, add --local and run the command from the project directory. Grant Pi project trust; non-interactive commands may need --approve.

From Git or a checkout

pi install git:https://github.com/galyavin/pi-grasp.git@v0.4.6

Pi clones the source and installs dependencies. To run a local checkout in place instead:

cd /absolute/path/to/pi-grasp
npm ci --omit=dev --legacy-peer-deps
pi install .

Keep the checkout's path stable. To try it for one invocation without installing, run pi --no-extensions -e /absolute/path/to/pi-grasp/extensions/index.js.

Optional runtimes

From the installed package directory shown by pi list, run the installer for each feature you need:

npm run install:chromium   # Browser rendering and screenshots
npm run install:documents  # PDF text, OCR and page images

PYTHON selects a setup executable without arguments. Successful setup verifies the candidate and records the opt-in. Package installation and updates leave optional downloads to the runtime installers. Setup inherits proxy, CA and package-index settings, and workers run with a restricted environment.

Runtimes are keyed by canonical package path, platform, architecture and dependency versions. Profiles sharing a checkout share its managed runtimes. The cache root is ~/Library/Caches/pi-grasp on macOS, %LOCALAPPDATA%/pi-grasp on Windows and $XDG_CACHE_HOME/pi-grasp (default ~/.cache/pi-grasp) on Linux. To override it, set the same absolute PI_GRASP_CACHE_DIR outside the package for setup and launch.

npm run runtime:status reports managed paths, opt-ins and presence. Use npm run runtime:check to run the Chromium launch or PDF extraction, page rendering and OCR checks. It exercises opted-in runtimes and explicit executable paths from the active profile. With neither selected, it runs no probes.

For externally managed runtimes, set browser.executablePath or documents.pythonExecutable in the active Pi agent directory’s pi-grasp.json. Use the isolated host fields for optional worker and library settings. Standalone search credentials come from the launching environment.

install:documents installs PDF text/OCR/rendering, not Docling or EG2. Their separate setup and ownership are described below.

Remove package and runtimes

Close Pi. Before removing the last reference to this checkout, run from its installed directory:

npm run runtime:clean

Then run pi remove <source> using the source from pi list or the absolute local package path. For a project installation, return to the original project and use pi remove <source> --local, with the same profile and project trust.

Cleanup removes verified runtimes and opt-ins for this checkout. It reports interrupted attempts for manual removal after their installer processes exit. Manage retained research separately after closing all consumers. Pi removes managed Git clones and deregisters local directories. Remove old extracted packages separately.

If a Git clone was removed before cleanup, reinstall the same source in the same profile to recover its location, then follow this sequence. Defer runtime cleanup while another profile still uses the checkout.

Credentials

Set keys in Pi’s launching environment and restart Pi after shell changes. DuckDuckGo and direct public reads work without a key, but DuckDuckGo often refuses automated searches, so set at least one search key for regular work. In standalone Pi, EXA_API_KEY also enables paid page-read fallback.

Provider Variable
Exa EXA_API_KEY
Tavily TAVILY_API_KEY
Brave BRAVE_API_KEY
Parallel PARALLEL_API_KEY
Diffbot DIFFBOT_API_TOKEN
Bright Data BRIGHTDATA_API_KEY, plus the SERP zone name in BRIGHTDATA_SERP_ZONE (a zone is not a secret; without one Bright Data is never routed or probed)
GitHub; required for code search, optional otherwise PI_GRASP_GITHUB_PUBLIC_TOKEN

The GitHub token must have no private-repository access. The extension cannot inspect its grants and never imports ambient gh credentials. Never commit secrets or include confidential material in public search queries.

Standalone Pi enables each paid provider whose key is set when the extension loads, and reads the key's value on each call. A newly added provider needs a Pi restart. X is available only through an explicit host configuration; no X environment variable is discovered automatically. An isolated host fixes credential sources while allowing key rotation within enabled providers.

Use the tools

Ask Pi for research as usual. The model calls load_research, loads the tools it needs, and calls them with arguments such as:

{"query":"llama.cpp speculative decoding benchmarks","freshness":"year","limit":5}

Search variants may broaden discovery. Verify against the original entities, timeframe, exclusions and comparison criteria; expand to close a named evidence gap. Treat search excerpts, quoted claims, old ancestors and authored replies according to their representation and attribution before drawing conclusions.

Documentation

Author

Rustem Galyavin · galyavin.com

License

MIT. See LICENSE; adapted third-party portions are listed in NOTICE.