# Local PDF to JSON Extractor (Ollama + Docling)

> Turn PDFs into Markdown with Docling, then extract schema-validated JSON with a local Ollama model and Pydantic. Nothing leaves your machine.

Local PDF to JSON Extractor (Ollama + Docling) is a free AI agent skill on Agensi by Rahul Bhargava, in Workflow Automation. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Rahul Bhargava](https://www.agensi.io/creators/rahul-bhargava)
- Category: [Workflow Automation](https://www.agensi.io/skills/workflow-automation)
- Version: 1.0
- Last updated: 2026-11-26
- Security: scan passed (2026-11-26); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/local-pdf-to-json-extractor-ollama-docling
- Tags: data, automation, coding

## About this skill

Turn a folder of PDFs into Markdown with Docling, then pull out schema-validated JSON (invoices, line items, reports) using a local Ollama model and Pydantic. Documents never leave your machine.

Included:
- A PDF-to-Markdown converter with content-hash caching, so unchanged PDFs are never reprocessed
- A Python extractor that validates model output against your Pydantic schema and retries with the exact errors when it fails
- Helpers to wrap untrusted document text and flag prompt-injection attempts
- Guidance on a deterministic-first pass to cut local compute cost

## Requires

- Python 3.10+
- Ollama with a pulled model
- docling and torch (PDF step)
- requests and pydantic

## Known limitations

Quality depends on the local model; long documents should be chunked first. The extractor is a Python library, not a CLI. VLM PDF conversion is slow on CPU and downloads model weights on first run.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Local PDF to JSON Extractor (Ollama + Docling) skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What does Local PDF to JSON Extractor (Ollama + Docling) do?

Turn PDFs into Markdown with Docling, then extract schema-validated JSON with a local Ollama model and Pydantic. Nothing leaves your machine.

### Which AI agents support Local PDF to JSON Extractor (Ollama + Docling)?

This skill uses the open SKILL.md standard. Use it through an MCP-compatible agent connected to Agensi, and check the compatibility information on this page for confirmed agents and required capabilities.

### How do I use Local PDF to JSON Extractor (Ollama + Docling)?

Connect your AI agent to Agensi through MCP, then ask it to use Local PDF to JSON Extractor (Ollama + Docling) on your task. Your agent loads the latest approved version each time. Paid skills require a purchase or active subscription. Skill files are not available for download; your licence does not allow you to save, copy or export any part of a skill.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
