Active open-source project · MIT License
Web context for AI agents. DocPull fetches any public web source, locks exactly what it fetched, serves agents cited passages from that locked copy, and tells you when a change upstream breaks something an agent already cited.
A source can be a docs site, a pricing or product page, a changelog, a policy, a feed, a GitHub repo, an npm or PyPI package, a paper, a standard, a dataset, or a local PDF. Use DocPull when an agent's answers depend on the live web and you need to know which pages it used, whether they changed, and how to rebuild the same context later.
Five commands cover the daily loop:
pip install docpull
docpull init payments-context # 1. declare sources
docpull add docs.stripe.com stripe.com/pricing npm:stripe github.com/stripe/stripe-node
docpull sync # 2. fetch and lock
docpull query "retry policy" --max-tokens 4000 > answer.json # 3. cited passages
docpull impact answer.json # 4. did a change break them?
docpull ci # 5. gate freshness and qualitydocpull add works out what each input is: a site, a page, a package, a repo, a
paper (doi: or arXiv), a feed, an OpenAPI spec, or a PDF.
| Command | What it does |
|---|---|
init / add |
Create docpull.yaml and declare web pages, sites, packages, repos, papers, feeds, or files. |
sync |
Fetch sources into a new run and pin .docpull/context.lock.json. |
query |
Return deduplicated passages from locked archives with a token budget and exact source spans. |
impact |
Report saved citations that a later source change made stale, contradicted, or broken. |
ci |
Check freshness, citation coverage, pack quality, and rights; exit non-zero on a hard gate. |
docpull --help lists the core and pack commands. docpull help --all lists every
command, and docpull help <command> shows its options. No account or paid API is
required: fetching, discovery, extraction, indexing, diffs, and queries run locally.
See Query locked context for
budget semantics and queries across projects.
Install the MCP extra and register the stdio server with the core toolset, which exposes the query, impact, read, and fetch tools an agent needs day to day:
pip install 'docpull[mcp]'
claude mcp add --transport stdio docpull -- docpull mcp --toolset coreAdd --toolset project or --toolset packs (repeat or comma-separate) for more
tools; the default is all. Project writes stay off unless you pass
--allow-project-writes. See MCP server for HTTP and the full list.
Popular sources are prebuilt in the signed public registry. A pack is a recipe: source URLs, pinned pages, and content hashes, never content. DocPull fetches the pages on your machine and reports which still match:
export DOCPULL_REGISTRY_PUBLIC_KEY=k2wv0zPUlj88D66zXXQD86Knnt66MoJN2ztFitdDg00=
docpull add stripe@latestPacks rebuild daily from registry/catalog.yaml; a new
version appears only when the pages changed.
Check saved citations on every pull request. The action runs docpull ci, keeps
one comment on the PR ("2 cited claims changed upstream"), and fails on a hard gate:
permissions:
contents: read
pull-requests: write
steps:
- uses: actions/checkout@v4
- uses: raintree-technology/docpull@v6.11.0
with:
args: --citations evidence/answers.jsonSee Context CI for inputs and outputs.
- Reproduce agent context. Stable IDs, hashes, manifests, and lockfiles show which source versions produced an answer or artifact.
- Detect web drift. Sync and diff docs, product and pricing pages, changelogs, policies, feeds, repositories, packages, standards, and local documents.
- Catch stale citations.
docpull impactmarks each saved citation valid, stale, contradicted, or broken; on a controlled benchmark it caught every changed fact that a cache-only agent would have kept serving. - Keep web text from steering agents. Query results withhold passages that match prompt-injection patterns and say how many were withheld.
- Keep evidence inspectable. Markdown, NDJSON, SQLite, citations, and provenance sidecars remain readable without a hosted service.
- Choose the downstream surface. Export context for agent clients, vector import, data workflows, or a versioned context-pack release.
- Keep expensive routes explicit. Browser and cloud rendering require an explicit choice and can be blocked with a zero-dollar budget.
declared sources → local acquisition → versioned evidence → diff and validation → export
docpull diff compares runs with hash-based change reports, and
docpull export context-pack --target cursor writes context for an agent client.
Source URLs, content hashes, run IDs, and citations travel with every artifact.
DocPull's v3 pack contract separates raw extraction, agent-ready context, and eval-grade evidence. Validate the level a downstream system requires:
docpull pack prepare packs/docs --eval-grade
docpull pack validate packs/docs --level eval
docpull ci --preparedocpull ci checks freshness, citation coverage, pack quality, rights metadata, and
other configured gates. It writes context-ci.report.json and CONTEXT_CI.md, then
exits non-zero when a hard gate fails.
| Surface | Use it for | Start here |
|---|---|---|
| CLI | Fetch, sync, diff, validate, and export | docs/cli-recipes.md |
| Python SDK | Embed acquisition in Python applications | docs/surface-contract.md |
| MCP server | Give local agent clients source tools | MCP server |
| TypeScript SDK | Read local packs and invoke the CLI from Node or Bun | sdk/js/README.md |
| Agent plugin | Install the supported MCP workflow in an agent client | plugin/README.md |
Common source shapes include static and server-rendered websites, OpenAPI documents, feeds, papers, public GitHub repositories, npm and PyPI packages, standards, datasets, transcripts, Wikimedia pages, product and policy pages, and local PDF or office files. See context-pack workflows for the complete surface.
pip install 'docpull[mcp]'
docpull mcp # stdio, every tool
docpull mcp --toolset core,project # fewer tools for a smaller agent context| Toolset | Tools |
|---|---|
core |
context_query, context_impact, read_doc, grep_docs, list_indexed, ensure_docs, list_sources, fetch_url, project_status |
project |
project_status, project_outdated, project_install, project_sync, project_update |
packs |
Pack builders, pack_*, graph_*, export_pack, audit_pack, refresh_pack, intelligence_bundle, workflow_run |
all |
Everything above plus render_url, explain_routes, validate_policy, serve_pack_status, add_source, remove_source |
DOCPULL_MCP_TOOLSET=core sets the same choice from the environment. Calling a tool
outside the enabled toolsets returns an error that names the toolset to add.
For clients that speak Streamable HTTP, run the same server locally:
pip install 'docpull[mcp,serve]'
docpull mcp --transport http --toolset core # http://127.0.0.1:8765/mcpThe HTTP server has no authentication. It binds 127.0.0.1 by default, rejects
requests whose Host or Origin header is not a loopback address (DNS rebinding
protection), and refuses a non-loopback --host unless you also pass --allow-remote.
DocPull is an evidence-acquisition engine, not a hosted competitive-intelligence product. It owns fetching, explicit rendering adapters, versioning, citations, hashing, validation, replay, and export. Downstream products own scheduling, human review, approved claims, legal conclusions, accounts, and notifications.
The default path does not handle complex interactive browser workflows, CAPTCHAs, stealth scraping, or private dashboards. JavaScript rendering is explicit. Authenticated sources require environment-variable references; DocPull does not persist credential values in project artifacts.
Security defaults include HTTPS-only fetching, robots.txt compliance, SSRF and DNS rebinding protections, redirect guards, XXE protection, and path-traversal checks. Read the web-source boundary, security posture, and evidence-engine decision before extending acquisition behavior.
- CLI recipes — Common commands and advanced workflows.
- Context dependencies — Project and lockfile model.
- Context Pack Contract v3 — Artifact levels and compatibility.
- Public contracts — Schemas and versioning rules.
- Alternatives — Browser automation and hosted extraction tradeoffs.
- JavaScript SDK and loaders — TypeScript client and LangChain/LlamaIndex loaders.
- Dependency security — Locked dependency sets and optional parser support.
- Evaluation lab — Reproducible methods, results, and claim boundaries.
- Changelog — Release history.
DocPull owns evidence acquisition and reproducible agent context. It can be used independently; the sibling projects do not imply a required integration or shared release cycle.
| Project | Responsibility |
|---|---|
| Raintree Standards | Defines governed requirements and evidence. |
| Trellis | Enforces shared JavaScript and TypeScript code policy. |
| HIG Doctor | Audits interface source and provides HIG guidance. |
| PolicyStrata | Tests cross-layer policy behavior. |
See the Raintree open-source portfolio for current lifecycle and distribution links.
Raintree also builds BetterOff, which keeps a household's spending, investments, assets, debts, and net worth in one current record.
Contributing · Code of Conduct · Security · Metrics and evidence limits · Source repository · MIT License

