Docling in IBM Bob
Fill a compliance assessment form from a PDF, a Word document and an EPUB by asking IBM Bob, with Docling for IBM watsonx doing the conversion
You are a compliance analyst at a bank. Every quarter a bundle of documents arrives, a risk disclosure as a PDF, an internal audit summary as a Word file and the regulator's guidelines as an EPUB, and you have to fill in the same assessment form from them.
In this tutorial you do that without writing code. IBM Bob converts the three documents with Docling for IBM watsonx, navigates them with dclq, fills the eight fields of the form and writes a short report. All Bob needs is a skill: a Markdown file that tells it how to use the docling convert-remote command.
What you'll build
- Three documents in your workspaceA PDF risk disclosure, a Word audit summary and an EPUB guideline
- IBM Bob reads the skill.bob/skills/docling-service/SKILL.md tells Bob how to use Docling
- Bob converts with Docling for IBM watsonxdocling convert-remote --to md --to dclxmddclx
- Bob navigates the DocLang outputdclq outline, grep and show fetch only the sections it needs
- Filled form and reportEight fields from three documents, plus a Markdown summary
| Piece | Role |
|---|---|
| Docling for IBM watsonx | Converts each document into Markdown and DocLang on IBM Cloud. No local GPU or models |
docling convert-remote | The command that sends the documents and saves the results in your workspace |
DocLang and dclq | DocLang is an open, ISO-standardized XML format for documents. dclq lets Bob jump to one section or table instead of reading everything |
| The skill | Plain Markdown that tells Bob when and how to use the two commands |
| IBM Bob | Plans the steps, runs the commands and writes the answers |
Time: about 30 minutes.
Prerequisites
- A Docling for IBM watsonx instance, with its Service URL and an API key. See Quick Start.
- IBM Bob, signed in.
- Python 3.10 or later. The steps use
uv, butpipworks too. git, to download the sample documents and the skill.
Step 1: Get the code and the sample documents
The sample documents, the empty form, the skill and the prompts are in the 04-bob-agent-skill folder of the examples repository. Clone it and open the bob-agent-skill folder in Bob as your workspace:
git clone https://github.com/IBM/docling-ibm-examples
cd docling-ibm-examples/04-bob-agent-skillThe docs/ folder holds the documents and the form:
| File | Format | Fields it contains |
|---|---|---|
vantara_risk_disclosure.pdf | PDF, 6 pages, with tables and a chart | Entity name, reporting period, regulator reference number, total risk exposure, risk categories |
q3_audit_summary.docx | Word | Material findings, sign-off date. Repeats the risk exposure and reference number |
regulatory_guidelines_2026.epub | EPUB | Key regulatory obligations |
compliance_assessment_form.json | JSON | The empty form |
The organisations, people and figures in these documents are fictional. The folder also contains the skill from Step 4, already in place in .bob/skills/docling-service/, and every prompt of Steps 5 and 6 in prompts.md.
You can use your own documents instead. Put them in docs/ and change the field names in the prompts.
Step 2: Install the tools
Create a virtual environment in the workspace (the bob-agent-skill folder) and install the CLI and dclq:
uv venv
source .venv/bin/activate
uv pip install docling-client dclqdocling-client provides the docling convert-remote command (docling-slim or the full docling package work too). See Command Line.
Step 3: Add your credentials and test the connection
Create a .env file in the workspace root. Copy the repository's .env.example and fill in the two Docling values (the WATSONX_* lines are not used here):
cp ../.env.example .envDOCLING_SERVICE_URL=https://your-service-url
DOCLING_SERVICE_API_KEY=your-api-keyNever commit .env. The examples repository already lists it in .gitignore.
Test it with one conversion from the terminal:
docling convert-remote --to md --output ./converted docs/regulatory_guidelines_2026.epub
head -20 converted/regulatory_guidelines_2026.mdIf you see Markdown, the URL, the key and the conversion all work. Otherwise:
| You see | Cause |
|---|---|
Exit code 2, No service URL | .env is missing, not in the current folder, or a variable name is misspelt |
401 or 403 | The API key is wrong or has been regenerated |
Cannot reach service | The Service URL is wrong, or outbound HTTPS is blocked |
Step 4: Install the skill
The skill is already in the workspace, in .bob/skills/docling-service/SKILL.md. This is the whole file. To use it in another workspace, create the folder .bob/skills/docling-service/ there and save this as SKILL.md inside it:
---
name: docling-service
description: >
Use when the user wants to convert, read or query a document (PDF, DOCX, PPTX,
XLSX, HTML, EPUB, images, URLs) with the Docling for IBM watsonx service.
Trigger phrases: "convert", "read this PDF", "what does this document say",
"find the table", "extract fields from".
---
# Docling for IBM watsonx
Convert documents on the managed service with `docling convert-remote`, then
navigate the DocLang output with `dclq`. No local models are needed.
Credentials come from the `.env` file in the workspace root
(`DOCLING_SERVICE_URL`, `DOCLING_SERVICE_API_KEY`). Never print or export them.
Activate `.venv` and run commands from the workspace root.
## Convert
Always request Markdown and DocLang together:
docling convert-remote --to md --to dclx --output ./converted <file-or-url-or-folder>
- Several sources: list them, or pass a folder.
- Only some formats from a folder: `--from pdf --from docx`.
- Born-digital PDF: add `--no-ocr`. Scanned PDF with bad text: `--force-ocr`.
- Classify pictures (chart, diagram, photo, ...): `--enrich-picture-classes`.
- Page subset: `--page-range 1-3`.
Output: `./converted/<name>.md` and `./converted/<name>.dclx`.
Exit code 1 means a connection or conversion failure, 2 means missing credentials.
## Navigate before answering
Do not read a whole document if you only need part of it. Use `dclq` on the
`.dclx` file:
dclq inspect ./converted/<name>.dclx # inventory
dclq outline ./converted/<name>.dclx # headings + XPaths
dclq grep -i 'pattern' ./converted/<name>.dclx # find units
dclq show ./converted/<name>.dclx '/heading[N]' --section # one section
dclq list ./converted/<name>.dclx --type table_cell --page 1 # table cells
When you answer, cite the section heading or XPath you used.
Read the Markdown file when the user wants the whole document.Bob scans .bob/skills/ when it loads a workspace. If you opened the workspace before cloning, or you change the skill, reload the window (or close and reopen the folder).
The open-source docling package also ships a general skill for the Python SDK. You can install it with uvx library-skills install --skill docling --all -y and link .agents/skills/docling into .bob/skills/. It is not needed for this tutorial. See Agent Skills.
Step 5: Convert and explore one document
Open the Bob chat and send the prompts one at a time. Read what Bob does, not only what it answers. You can copy every prompt from prompts.md.
Convert docs/vantara_risk_disclosure.pdf to Markdown and DocLang.The first time, Bob asks to use the skill. Choose Approve skill tools for task so it does not ask again in this conversation.

In the conversation you will see Bob use the skill, read it, and run docling convert-remote. The converted Markdown appears in converted/:

Now let Bob look at the structure before reading anything:
Use dclq to show me the outline of the risk disclosure, with the XPath of each section.Find where the document talks about risk exposure, and show me only that section.Bob runs dclq outline, then dclq grep -i 'risk exposure' and dclq show '<xpath>' --section. The answer is based on one addressable section, not on the full document, and Bob can tell you which section it used.
What are the main risk categories in this document? Which one is the largest, and in which table did you find it?To see the same structure yourself, open converted/vantara_risk_disclosure.dclx in the DocLang Viewer. Explore with DocLang explains what you see there.
Step 6: Fill the form from three documents
The form has eight fields, and no single document contains all of them (see also form.md):
| Field | Found in |
|---|---|
entity_name, reporting_period, total_risk_exposure_usd, highest_risk_category, regulator_reference_number | the PDF |
material_findings (list), sign_off_date | the DOCX |
key_obligations (list) | the EPUB |
Convert all three:
Convert all documents in docs/ to Markdown and DocLang.Bob converts the whole folder in one command. You will find a .md and a .dclx file for each document in converted/.
The file compliance_assessment_form.json will most probably fail to convert. This is expected. This JSON file is the blank form that will need to be filled from the three documents.
Look at the audit summary before using it. It is a Word document with a different structure from the PDF:
Use dclq to show the outline of the audit summary. Which section lists the material findings, and which one has the sign-off?Fill the form:
Fill docs/compliance_assessment_form.json using the three converted documents.
For each field, use dclq to find the section that contains it, and read only that section.
Return the completed JSON, and after it a table with one row per field showing
the source document and the section XPath you took it from.
Save the result as converted/compliance_assessment_form_filled.json.Cross-check: two fields, the total risk exposure and the regulator reference number, appear in both the PDF and the DOCX. Ask Bob to compare them:
The total risk exposure and the regulator reference number appear in two documents.
Compare the values from each. Do they agree?Write the report:
Write a three-sentence executive summary covering the total risk exposure,
the highest risk category and the most important obligations.
Then write converted/compliance_report.md with the summary followed by
the filled form as a Markdown table, including the source column.Check the numbers. The field values are produced by Bob's language model reading the converted documents. Docling for IBM watsonx supplies the structure (sections, tables and cells), but it does not choose the values. Before you rely on the form, compare each value with the section Bob cited, especially amounts, units (millions or units of currency) and dates. Asking for the source section of every field, as in the prompts above, makes this quick.
Verify
You should now have, in converted/:
- a
.mdand a.dclxfile for each of the three documents, compliance_assessment_form_filled.jsonwith all eight fields set,compliance_report.mdwith the summary and the table.
Spot-check two values yourself:
dclq grep -i 'reference' converted/vantara_risk_disclosure.dclx
dclq grep -i 'sign' converted/q3_audit_summary.dclxVariant: the same workflow through MCP
Instead of a skill, Bob can use Docling MCP, which exposes conversion as MCP tools. Start the server in remote mode against your instance:
set -a && source .env && set +a
DOCLING_MCP_CONVERSION_MODE=remote \
DOCLING_MCP_SERVICE_URL="$DOCLING_SERVICE_URL" \
DOCLING_MCP_SERVICE_API_KEY="$DOCLING_SERVICE_API_KEY" \
uvx --from docling-mcp docling-mcp-server --transport streamable-httpThen add the server in Bob's MCP settings and use the same prompts as in Steps 5 and 6. Note that the MCP server uses its own variable names (DOCLING_MCP_SERVICE_URL, DOCLING_MCP_SERVICE_API_KEY). The MCP page has the configuration details, and Agent Skills compares the two approaches.
Clean up
- Delete the
converted/folder if you no longer need the results. - Delete
.env, or revoke the API key in your instance if you created it only for this tutorial. - Remove
.bob/skills/docling-service/if you do not want Bob to keep using the skill in this workspace.
Next steps
Get the code
The skill, the sample documents, the form and the prompts
Agent Skills
Use the skill in other assistants, and compare skills with MCP
Command Line
All docling convert-remote options
Explore with DocLang
DocLang Viewer and dclq in depth
Batch Conversion
Convert whole collections from cloud storage
Streaming Document Pipelines with Confluent Cloud
Stream Docling for IBM watsonx chunks into Confluent Cloud and clean, redact and deduplicate them with Flink SQL, ready for search and RAG
Ingest a Document Library into a Vector Database
Convert, chunk and index documents into AstraDB with one batch API call and no glue code