Agent-First PDF v0.1.0

by Agent-First Kit Contributors

The first release of Agent-First PDF — article text, structure and images recovered from PDF layouts, with the engine's evidence kept beside every interpretation, one child process per document by default, and a pinned PDFium build installed and verified on request.

Text pulled out of a PDF comes back shaped like the page: lines broken where the typesetter broke them, a page number every forty lines, two columns read across instead of down. Agent-First PDF (afpdf) returns the article instead, as headings, paragraphs, provisions, tables and figures in reading order, each with the page and rectangle it came from.

Why it is built this way is in The Article, Not the Page. This post covers what v0.1.0 does once it is installed.

What ships

Limits worth knowing

The worker memory limit is enforced on Linux only. Elsewhere it defaults to zero, and asking for a nonzero limit fails every worker instead of running unlimited. There is no OCR and no model call. Table cells, caption association and formula semantics are not guaranteed. The checked-in regression fixtures are Chinese legislation and regulatory documents. The rules are written to be general, but they have not been proven on arbitrary papers or languages.

Getting it

$ brew install agentfirstkit/tap/afpdf      # macOS and Linux
$ scoop bucket add agentfirstkit https://github.com/agentfirstkit/scoop-bucket && scoop install afpdf   # Windows
$ cargo install agent-first-pdf --locked

PDFium is not bundled. Fetch the pinned build once per machine, then check what extraction will load:

$ afpdf engine install
$ afpdf engine status
$ afpdf extract article.pdf

To use the library, depend on agent-first-pdf with default-features = false and turn on engine for in-process extraction or isolation for the child-process client. The Agent Skill tells a coding agent when to trust a page’s text and when to ask for OCR.