DocImprint Document Intelligence

Verifiable document intelligence for AI agents.

Documentation

DocImprint

Document memory agents can prove.
PDFs & URLs → cited answers · evidence bundles · on-chain attestation

npm version npm downloads PyPI version PyPI downloads Smithery Glama MCP OpenAPI docs MIT license GitHub stars


Table of contents


At a glance

DocImprint turns any PDF or URL into a tamper-evident evidence bundle — structured data, AI-cited answers, and a cryptographic proof your agents can verify independently.

InputPDF or URL
Outputev_... evidence bundle — cited answers, artifact hashes, EIP-191 signature
Verifyclient.verify() — free, no auth; optional Base L2 notarization via EAS

Choose your integration

PathBest forStart here
TypeScript SDKNode agents, typed appsQuick start
Python SDKCrewAI, scriptsQuick start · CrewAI
MCP serverClaude, CursorMCP server
x402 USDCAutonomous agents, no accountx402 USDC payments

See what you get

Every response includes a verifiable bundle ID, manifest hash, and cited answers tied to exact source quotes.

{
  "bundle_id": "ev_01jqv8k3m2x",
  "manifest_sha256": "a3f2c1d8e9b0476f8a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f",
  "signature": {
    "signature": "0x8f4e2a1b9c3d5e7f0a2b4c6d8e0f1a3b5c7d9e1f3a5b7c9d1e3f5a7b9c1d3e5f71c",
    "signer_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0EbE",
    "algorithm": "secp256k1-eip191"
  },
  "answer_cited": {
    "value": "Section 4.2 does not permit unilateral termination without 90 days written notice.",
    "citations": [
      {
        "quote": "Neither party may terminate this Agreement unilaterally except upon ninety (90) days prior written notice to the other party.",
        "paragraphs": [42],
        "page": 4,
        "confidence": "high"
      }
    ]
  },
  "artifacts": {
    "markdown": { "sha256": "b4e5f6a79876543210fedcba9876543210fedcba9876543210fedcba9876543210ab" },
    "manifest": { "sha256": "a3f2c1d8e9b0476f8a2b1c0d9e8f7a6b5c4d3e2f1a0b9c8d7e6f5a4b3c2d1e0f" }
  }
}

API response with provenance and citations

Evidence bundle manifest anatomy


How it works

flowchart LR
  source[PDF or URL] --> extract[extract / qa / checkClaims]
  extract --> bundle[Evidence bundle ev_...]
  bundle --> artifacts[Artifacts + manifest SHA-256]
  bundle --> citations[Cited answers with quotes]
  artifacts --> verify[verify - free]
  verify --> notarize[notarize on Base L2 - optional]

Merkle citation proof flow


Why not plain OCR or RAG?

Plain OCRVector RAGDocImprint
Exact source quotesNoApproximateYes, with paragraph refs
Tamper evidenceNoNoSHA-256 manifest + EIP-191 sig
Independent verifyNoNoverify() without API key
On-chain attestationNoNoEAS on Base L2
Agent audit trailNoNoProvenance + handoff (Python)

Use cases

ScenarioMethodResult
Contract Q&Aclient.qa()Cited answer with confidence score
Claim verificationclient.checkClaims()Per-claim verdict: supported / contradicted / not_found
Invoice intakeclient.extract({ mode: 'invoice' })Structured merchant, line items, totals — all cited
Compliance archivelegal_hold: true + notarize()Immutable on-chain record, deletion blocked

Install

npm install docimprint           # TypeScript / Node.js
pip install docimprint           # Python REST client
pip install "docimprint[crewai]" # + 10 CrewAI tools & ProvenanceTracker

Python source lives in python/. PyPI: docimprint.


Quick start

Get an API key at docimprint.com — free tier available, no credit card required.

TypeScript

import { DocImprintClient } from 'docimprint'

const client = new DocImprintClient({ apiKey: 'dr_live_...' })

const result = await client.extract({
  source: 'https://example.com/contract.pdf',
  include: ['markdown', 'summary'],
})

console.log(result.bundle_id)        // ev_01j...
console.log(result.summary)          // AI-generated summary
console.log(result.manifest_sha256)  // tamper-evident hash
console.log(result.key_points_cited[0].citations[0].quote)

Python

from docimprint import DocImprintClient

client = DocImprintClient(api_key="dr_live_...")

result = client.extract(
    url="https://example.com/contract.pdf",
    include=["markdown", "summary"],
)
print(result["bundle_id"])         # ev_01j...
print(result["summary"])           # AI-generated summary
print(result["manifest_sha256"])   # tamper-evident hash

REST API (cURL)

curl -X POST https://api.docimprint.com/v1/extract \
  -H "Authorization: Bearer dr_live_..." \
  -H "Content-Type: application/json" \
  -d '{"source": "https://example.com/contract.pdf", "include": ["markdown", "summary"]}'

Features

CapabilityMethod / ModeDescription
Extractextract()Full evidence bundle — markdown, summary, cited key points, artifacts, manifest SHA-256
Invoice parsingmode: 'invoice'Structured InvoiceResult: merchant, date, line items, subtotal, tax, total — all with citations
Document comparisonmode: 'compare'Diff two documents; supply previous_bundle_id to track changes
Structured extractionmode: 'extract-structured'Extract typed fields using a caller-defined JSON Schema
Summarizesummarize()Prose summary + key points, each with cited paragraph references
Q&Aqa()Single-question answer with inline citations and confidence score
Claim-checkcheckClaims()Per-claim verdict: supported / contradicted / not_found with evidence quotes
Translatetranslate()Source-cited translation to any language
Describedescribe()AI description of image or PDF page contents
CollectionscreateCollection() + searchCollection() + askCollection()Semantic search + cross-document RAG Q&A across multiple bundles
Verifyverify()Cryptographic integrity check — manifest hash, EIP-191 signature, artifact hashes. Free, no auth
Notarizenotarize()Write manifest SHA-256 to Base L2 via EAS — permanent, immutable attestation
MCP server20 tools · 2 promptsNative MCP for Claude, Cursor, and any MCP-compatible client
x402REST X-Payment headerPay per call in USDC — no account required

Why DocImprint?

  • 🔏 Cryptographic provenance — every bundle is EIP-191 signed at creation; optionally notarized on Base L2 via EAS for an immutable on-chain audit trail
  • 🤖 Agent-native by design — async jobs, webhooks, idempotency keys, and legal hold built into every request, not bolted on
  • 📎 Beyond OCR — citations carry exact quotes, paragraph indices, and confidence scores (high/medium/low), not just raw text
  • 🛠️ 10 CrewAI tools out of the boxresearch_tools(), legal_tools(), collection_tools() pre-grouped for common agent workflows
  • ⚖️ Compliance-readylegal_hold, provenance logging, multi-agent handoff tracking, and on-chain notarization designed for legal and regulated industries
  • 💳 Flexible payment — monthly credit plans or pay-per-call USDC via x402, no account required

Agent-native features

DocImprint is designed for autonomous agent workflows, not just synchronous API calls.

// Fire-and-forget async extraction — returns job_id immediately
const job = await client.extract({
  source: 'https://example.com/large-report.pdf',
  async: true,
  webhook: 'https://your-agent.io/callback',
  idempotency_key: 'report-2025-q4',
  legal_hold: true,
})

const status = await client.getJob(job.job_id)
// { status: 'complete', bundle_id: 'ev_...', progress_pct: 100 }

// Monitor a URL for changes — get notified on diff
await client.extract({
  source: 'https://example.com/terms.html',
  monitor: { webhook: 'https://your-agent.io/changes', mode: 'diff' },
})

Python: provenance & multi-agent handoff tracking

client.log_provenance(bundle_id="ev_...", agent_id="agent-research", action="extracted")
client.handoff(bundle_id="ev_...", from_agent="agent-research", to_agent="agent-legal", note="ready for claim check")

CrewAI integration

10 purpose-built tools for CrewAI agents, organized into preset groups.

from docimprint.crewai import DocImprintToolkit

toolkit = DocImprintToolkit(
    api_key="dr_live_...",
    collection_id="col_...",  # required for collection tools
)

toolkit.research_tools()      # extract, summarize, qa, check_claims
toolkit.legal_tools()         # check_claims, verify, notarize
toolkit.collection_tools()    # search, ask, add_to_collection
toolkit.all_tools()           # all 10 tools
ToolWhat it does
ExtractEvidenceToolFull evidence bundle with citations and manifest hash
SummarizeToolKey points with cited paragraph references
QAToolCited answer with confidence score
CheckClaimsToolPer-claim verdict: supported / contradicted / not_found
TranslateToolSource-cited translation
VerifyBundleToolCryptographic integrity check — manifest, hash, signature
NotarizeToolOn-chain EAS attestation on Base L2
SearchCollectionToolSemantic vector search across document collection
AskCollectionToolCross-document RAG Q&A with cited sources
AddToCollectionToolAdd bundle to collection and trigger async indexing

ProvenanceTracker wraps all tools to automatically log agent actions and bundle handoffs.

from docimprint.crewai import DocImprintToolkit, ProvenanceTracker

tracker = ProvenanceTracker(client=toolkit.client)
trackable = toolkit.trackable_tools()

DocImprintKnowledgeSource integrates with CrewAI's knowledge system for retrieval-augmented agents.


MCP server

DocImprint exposes a native MCP server for use with Claude, Cursor, and any MCP-compatible client.

Install via Smithery (one command):

npx @smithery/cli install docimprint --client claude

Manual config:

{
  "mcpServers": {
    "docimprint": {
      "type": "streamable-http",
      "url": "https://api.docimprint.com/mcp",
      "headers": {
        "Authorization": "Bearer dr_live_..."
      }
    }
  }
}

Transport: streamable-http · Auth: Bearer token · Listed on Smithery · Listed on Glama

MCP tools

URL tools — lean mode, no bundle stored:

ToolDescription
extract_urlFetch URL → text + metadata
summarize_urlFetch URL → prose summary + key points
qa_urlFetch URL → cited answer to a specific question
translate_urlFetch URL → translated content

Document tools — accepts base64 PDF or image:

ToolDescription
extract_textOCR plain text from PDF / image
extract_tablesOCR tables as Markdown from PDF / image
parse_invoiceStructured invoice fields: merchant, line items, totals + citations
summarize_documentProse summary + cited key points
check_claimsPer-claim verdict with evidence quotes
extract_structuredExtract typed fields using a caller-defined schema

Bundle & collections:

ToolDescription
verify_bundleCryptographic integrity check
get_bundleBundle metadata and notarization status
notarize_bundleOn-chain EAS attestation on Base L2
create_collectionCreate a named document collection
list_collectionsList your collections
add_document_to_collectionAdd bundle + trigger async indexing
search_collectionSemantic vector search
ask_collectionCross-document RAG Q&A
get_job_statusPoll async job (extract, indexing, batch)
get_quotaCheck credit balance and plan status

Guided prompts: claim_check_workflow · invoice_intake

Resource: bundle://{bundle_id} — read bundle metadata directly


API reference

Full typed reference: docimprint.com/docs · OpenAPI

CategoryMethods
Coreextract, verify, download, notarize, deleteBundle
Focusedsummarize, qa, translate, checkClaims, describe
Extract modesinvoice, extract-structured, compare, store: false (lean)
CollectionscreateCollection, listCollections, addToCollection, searchCollection, askCollection
JobsgetJob, listJobs, getQuota

Error handling

import { DocImprintClient, DocImprintError } from 'docimprint'

try {
  const result = await client.extract({ source: 'https://example.com/doc.pdf' })
} catch (err) {
  if (err instanceof DocImprintError) {
    console.error(err.message)    // human-readable error
    console.error(err.status)     // HTTP status code
    console.error(err.requestId)  // x-request-id for support
  }
}

Authentication

API key

Monthly credits via Stripe — sign up at docimprint.com, free tier available:

const client = new DocImprintClient({ apiKey: 'dr_live_...' })

x402 USDC payments

DocImprint supports the x402 open standard — pay per call in USDC on Base, straight from any EVM wallet. No account. No sign-up. No API key. Your agent can call the API autonomously without any human-managed credentials.

The API is x402-native: it returns a standard 402 Payment Required response with on-chain payment details, your client settles in USDC, and the request completes automatically. From $0.01 / call.

With @x402/fetch (automatic payment handling):

import { wrapFetchWithPayment } from '@x402/fetch'
import { createWalletClient, http } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { base } from 'viem/chains'

const account = privateKeyToAccount('0x...')
const wallet = createWalletClient({ account, chain: base, transport: http() })

const fetchWithPayment = wrapFetchWithPayment(fetch, wallet)

const res = await fetchWithPayment('https://api.docimprint.com/v1/summarize', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ source: 'https://example.com/report.pdf' }),
})
const data = await res.json()

Identity on owner routes: For GET/DELETE operations that require ownership (e.g. fetching your bundle), pass the payment-signature header from a prior payment response so the API can verify your wallet address without a separate login.


TypeScript

All request and response types are exported:

import type {
  ExtractRequest,
  ExtractResponse,
  Citation,
  CitedField,
  InvoiceResult,
  Job,
  Collection,
  SearchResult,
} from 'docimprint'

Pricing

Free tier available — no credit card required. Monthly credit plans via Stripe, or pay per call in USDC via x402. See pricing →


Community

Questions, integrations, and announcements: GitHub Discussions.


Links