Pi package that adds Diffbot tools to the coding agent — Knowledge Graph (DQL), Extract, Web Search, Entities, Crawl, Ask, and Ontology.
All runtime calls go through @diffbot/typescript. This package does not use the Python SDK or CLI.
# from npm
pi install npm:@diffbot/pi
# from git
pi install git:github.com/diffbot/diffbot-pi
# from a local checkout
pi install .Try without installing:
pi -e .If you also have diffbot-skills discoverable in Pi, disable those skills (or remove them from settings). Skill names collide on purpose; package skills have lower precedence than user/auto skills, so the Python-oriented ones would win otherwise.
Token resolution (via resolveToken from @diffbot/typescript/node):
DIFFBOT_API_TOKENenvironment variableDIFFBOT_API_TOKEN=...in~/.diffbot/credentials
Check status in Pi with /diffbot.
| Tool | Purpose |
|---|---|
diffbot_dql |
Query / export KG with DQL (filter, format, exportspec) |
diffbot_dql_probe |
Parallel hit counts for query variants |
diffbot_ontology |
Browse / refresh KG ontology |
diffbot_extract |
Extract structured content from a URL |
diffbot_web_search |
Search Diffbot's web index (maxTokens) |
diffbot_entities |
Named entities + sentiment (format: dql helper) |
diffbot_ask |
Diffbot LLM ask / short chat |
diffbot_crawl |
Start a Crawlbot job (optional watch) |
diffbot_crawl_jobs |
List or inspect crawler jobs |
diffbot_crawl_delete |
Delete a crawler job |
Workflow guidance for those tools (parity with diffbot-skills, but invoking TS-backed Pi tools). Invoke with /skill:name:
| Skill | Command |
|---|---|
| DQL / Knowledge Graph | /skill:diffbot-dql |
| Organizations (companies) | /skill:diffbot-organizations |
| People | /skill:diffbot-people |
| Places (geography) | /skill:diffbot-places |
| Deals (funding / M&A) | /skill:diffbot-deals |
| News & articles | /skill:diffbot-news |
| Extract | /skill:diffbot-extract |
| Web Search | /skill:diffbot-web-search |
| Entities (NLP) | /skill:diffbot-entities |
| Crawl | /skill:diffbot-crawl |
| Ask | /skill:diffbot-ask |
git clone https://github.com/diffbot/diffbot-pi.git
cd diffbot-pi
npm install
npm run typecheck
# load from this directory
pi -e .
# or install into user settings
pi install .0.4.0 depends on @diffbot/typescript ^0.6.0. DQL goes through the SDK dql() helper, which posts a JSON body; the token stays a query parameter. package-lock.json still records the published 0.3.0 tarball — run npm update @diffbot/typescript once 0.6.0 is on npm. A missing crawl job from crawlGetJob() is undefined.
Publishing uses npm trusted publishing from .github/workflows/release.yml (no npm token).
- Bump
versioninpackage.json(and updatepackage-lock.json) on a branch. - Merge to
main. - Tag the merge commit and push the tag:
git tag vX.Y.Z && git push origin vX.Y.Z.
The workflow checks the tag matches package.json, runs npm ci and npm run typecheck, then runs npm publish --access public --provenance and creates the GitHub Release with generated notes. Running the workflow manually (workflow_dispatch) only does the checks and npm publish --dry-run.
One-time npm setup (package settings → Trusted publisher): org diffbot, repo diffbot-pi, workflow release.yml, no environment.
Follows the Pi package conventions:
diffbot-pi/
├── extensions/ # TypeScript extensions (tools + /diffbot)
├── skills/ # Agent Skills (SKILL.md workflows)
├── package.json # pi manifest + pi-package keyword
└── README.md
MIT