databricks-ai-function…
Use Databricks built-in AI Functions (ai_classify, ai_decide, ai_extract, ai_summarize, ai_mask, ai_translate, ai_fix_grammar,…
Build RAG / unstructured-document evaluation datasets and demo documents (e.g. for a Genie Agent with an attached volume) on Databricks: generate synthetic PDFs locally, upload to Unity Catalog volumes, and pair each document with test questions for retrieval evaluation.
Claude Code
$ npx -y skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation --agent claude-code
Codex
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a codex -y
Cursor
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a cursor -y
Gemini CLI
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a gemini-cli -y
GitHub Copilot
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a github-copilot -y
OpenCode
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a opencode -y
Windsurf
$ npx skills add databricks/databricks-agent-skills --skill databricks-unstructured-pdf-generation -a windsurf -y
name: databricks-unstructured-pdf-generation description: "Build RAG / unstructured-document evaluation datasets and demo documents (e.g. for a Genie Agent with an attached volume) on Databricks: generate synthetic PDFs locally, upload to Unity Catalog volumes, and pair each document with test questions for retrieval evaluation." compatibility: Requires databricks CLI (>= v1.0.0) metadata: version: "0.1.0" parent: databricks-core
Workflow for producing **synthetic PDF documents + paired test questions** as a Unity Catalog-resident dataset for Demos and RAG / unstructured-document retrieval evaluation on Databricks. The PDF-generation step uses standard local HTML → PDF tooling; the Databricks-specific value is the workflow shape — UC volume layout, paired question files, and integration with downstream Databricks retrieval / `ai_extract` / `ai_parse_document` evaluation.
1. Write HTML files to `./raw_data/html/` (write multiple files in parallel for speed) — domain-shaped to match the documents your retrieval pipeline will see in production. 2. Convert HTML → PDF using `<SKILL_ROOT>/scripts/pdf_generator.py` (parallel conversion, wraps `plutoprint`). 3. Upload PDFs to a Unity Catalog volume via `databricks fs cp` — same volume shape your production pipeline will read from. 4. Generate `./raw_data/pdf/pdf_eval_questions.json` pairing each document with retrieval-eval questions; this becomes the gold dataset for `mlflow.genai.evaluate()` or comparable retrieval-quality scorers.
> If you only need ad-hoc PDFs (no Databricks workflow), any HTML → PDF tool (`weasyprint`, `wkhtmltopdf`, `playwright pdf`, `plutoprint`) works directly — this skill exists for the synthetic-dataset-on-UC end-to-end shape, not as a general PDF generator.
> **Path convention:** `<SKILL_ROOT>` below = the directory containing this SKILL.md. Resolve to the absolute install path (e.g. `~/.claude/skills/databricks-unstructured-pdf-generation`). `./raw_data/...` paths are relative to your own project cwd.
uv pip install plutoprint
mkdir -p ./raw_data/html
Write HTML documents to `./raw_data/html/filename.html`. Use subdirectories to organize (structure is preserved).
# Convert entire folder (parallel, 4 workers) python <SKILL_ROOT>/scripts/pdf_generator.py convert --input ./raw_data/html --output ./raw_data/pdf
Skips files where PDF exists and is newer than HTML. Use `--force` to reconvert all.
`databricks fs` requires the `dbfs:` scheme prefix even for UC Volume paths. `-r` copies the *contents* of the source directory into the target (the source directory name is not preserved), so name the target `raw_data/pdf` explicitly to keep the PDFs in their own folder on the volume. They land under `raw_data/pdf/` — i.e. `dbfs:/Volumes/my_catalog/my_schema/raw_data/pdf/report.pdf` — so an ingest pipeline can point at that single folder. **For a Genie Agent, upload to a dedicated managed volume instead** (e.g. `dbfs:/Volumes/my_catalog/my_schema/docs/`), because Genie indexes the *whole* volume, not a subfolder (see [databricks-genie-agents § Documents](../databricks-genie-agents/references/create-genie-agent.md#documents-uc-volumes)).
databricks fs cp -r --overwrite ./raw_data/pdf dbfs:/Volumes/my_catalog/my_schema/raw_data/pdf
Create `./raw_data/pdf/pdf_eval_questions.json` with questions for evaluating a Genie Agent (or a legacy Knowledge Assistant) over the PDFs. **Keep it out of a volume attached to a Genie Agent**: the whole volume is indexed, so the answers would leak into the agent's context (upload the PDFs before writing it, or `databricks fs rm` it from that volume):
{
"api_errors_guide.pdf": {
"question": "What is the solution for error ERR-4521?",
"expected_fact": "Call /api/v2/auth/refresh with refresh_token before the 3600s TTL expires"
},
"installation_manual.pdf": {
"question": "What port does the service use by default?",
"expected_fact": "Port 8443 for HTTPS, configurable via CONFIG_PORT environment variable"
}
}Use it to build Agent-mode test cases (or Genie benchmarks) and validate retrieval accuracy.
When generating documents for Genie Agent (document Q&A) testing or demos:
**Good document types:**
**Example content:** Instead of generic "Connection failed" errors, write:
python <SKILL_ROOT>/scripts/pdf_generator.py convert [OPTIONS] --input, -i Input HTML file or folder (required) --output, -o Output folder for PDFs (required) --force, -f Force reconvert (ignore timestamps) --workers, -w Parallel workers (default: 4)
Subfolder structure is preserved:
./raw_data/html/ ./raw_data/pdf/ ├── report.html → ├── report.pdf ├── quarter
Build on Databricks with AI coding agents such as Claude Code, Cursor, Codex, GitHub Copilot, and many others. This repository provides the skills and agent plugins for Databricks AI Tools.
Use Databricks built-in AI Functions (ai_classify, ai_decide, ai_extract, ai_summarize, ai_mask, ai_translate, ai_fix_grammar,…
Databricks AI Runtime, the `databricks air` CLI commands for submitting and managing GPU training workloads on Databricks…
Create Databricks AI/BI dashboards. Must use when creating, updating, or deploying Lakeview dashboards as Databricks Dashboard…
Design the UX of custom-code Databricks Apps (AppKit/React) data screens — KPI/overview pages, reports, charts, tables, and…
Python backend for Databricks Apps — FastAPI (default), Flask, Dash, Streamlit, Gradio, Reflex. **Default for a new Databricks…
Build apps on Databricks Apps platform. Use when asked to create data apps, analytics tools, or custom interactive…
Use this skill to extract structured Markdown/JSON from PDFs and document images—tables with cell-level precision, formulas as…
Estimates intracellular metabolic fluxes from steady-state carbon-13 isotope-tracing measurements using validated atom maps,…