zPET - IBM Z and z/OS Platform Evaluation and Test

zPET - IBM Z and z/OS Platform Evaluation and Test

zPET - IBM Z and z/OS Platform Evaluation and Test

Experiences and tips from a team of system programmers and testers who run a Parallel Sysplex on which we perform the final verification of a z/OS release and System z hardware and System Storage before they become generally available to clients.

 View Only

How to pass token efficient context to Bob using Docling

By Justin Largo posted 06/26/26 04:17 PM

  

If you work in the z/OS space, you already know the deal: knowledge lives everywhere and is in every format imaginable. A procedure written up in a PowerPoint from 2018. A runbook or runlog buried in a PDF that only two people know exists. A recorded walkthrough sitting on a file share that nobody has time to rewatch. z/OS has always had a tribal knowledge problem, and that institutional knowledge tends to stay siloed because there's no easy way to surface it.

That's exactly the kind of problem that makes Bob powerful in theory but frustrating in practice. Raise your hand if you've ever dropped a PDF or some other file into Bob, only to get a confused response or watch your token budget evaporate in real time. We've all been there, and honestly? It's not Bob's fault. PDFs are structurally messy, and the effort Bob spends trying to parse all of them will drain your budget faster than you can blink.

In zPET, we have a massive amount of knowledge spread across PowerPoints, PDFs, recorded demos, and internal docs. Getting Bob to reason over all of that in a useful way felt like a pipe dream until we started using Docling. IBM has developed this fantastic open source project called Docling that takes the vast majority of file types and converts them into clean, structured Markdown, a format that LLMs like Bob are built to read efficiently. The result is more accurate responses, a lighter hit on your Bob Coin budget, and a tighter development loop when writing automation. Instead of manually hunting down context and hoping Bob can parse it, you convert once and reference it anywhere.

And the best part: everything covered here works with any coding agent, from Claude Code to Cursor to Pi.

Pre-requisites

  • Python 3.12
  • UV or Pip package managers

For this tutorial, we'll be focusing on UV, a pip alternative that's become a new favorite of mine thanks to its Rust-powered performance and straightforward dependency management via pyproject.toml.

How to install uv

The installation page can be found here. Make sure to run the correct install command for your operating system.

To verify UV is installed correctly, run uv -V to print your current version. It should look something like this:

uv -V
uv 0.11.6 (65950801c 2026-04-09 aarch64-apple-darwin)

How to install the Docling CLI tool

Another thing I love about UV is how it handles global tool installs, which would normally be a messy operation. UV solves this with the uvx command, letting you run tools without a permanent install. You can read more about it here.

To install Docling locally, there are two flavors to choose from:

  • For static documents like PDFs and slides, uv tool install docling is all you need.
  • For data that requires multimodal audio or video processing, use uv tool install "docling[asr]"
    • Note: You may also need to install FFMPEG to handle video conversion specifically.
    • The [asr] variant is a superset of the static install; static document support is fully included. The extra capability comes from IBM-approved open source AI models used for audio transcription, so there's no security concern. If you're only working with PDFs and slides, the base install is the lighter choice, but either works.

Once installed, verify it's working by running docling --logo for a fun ASCII art logo, or docling --help to see all available options.

How to convert various forms of data into a Bob ready format

Docling's CLI makes conversion straightforward. The simplest way to use it is just passing your file directly:

docling report.pdf

That's it! By default, Docling will convert your file to Markdown and drop it in the current directory. If you want more control over the output format and destination, you can use the full syntax:

docling <source> --to md --output <output-folder>

Here are a few real-world examples:

Convert a PDF:

docling report.pdf --to md --output ./converted

Convert a webpage:

docling https://example.com/some-article --to md --output ./converted

Convert a video (requires the [asr] install):

docling presentation.mp4 --to md --output ./converted

In each case, Docling produces a .md file with your headings, tables, and content cleanly preserved, ready to hand off to Bob.

Token efficient references to MD files in Bob

Now that you have a Markdown file, using it in Bob is simple. The @ syntax lets you explicitly reference a file by path, which is the most token-efficient approach — Bob reads it directly without burning tokens on a file search.

For example, if your converted file lives at ./converted/report.md, you can reference it in your prompt like this:

@./converted/report.md Can you summarize the key findings from this report?

Bob will pull in the file, parse it efficiently, and give you a focused response. Because Markdown is already structured the way LLMs expect, you get better answers and spend fewer tokens getting there.

Note: The @ reference is optional. If you just describe the file naturally ("summarize report.md"), Bob is smart enough to go find it or ask you for clarification. The explicit @ path just skips that search step, saving a few tool calls and keeping your token spend lower.

You're not limited to single files either. You can pass an entire directory as context using the same @ syntax:

@./converted Can you summarize the key findings across all of these reports?

Bob will read every file in that directory, giving it the full picture without you having to reference each document one by one. This pairs especially well with Docling's batch conversion. Convert a whole folder of PDFs or slides in one shot, then hand the entire output directory to Bob at once.

If you want to see this in action, check out the below screenshot:

Tip: If you're converting a batch of documents, you can point Docling at an entire directory and it will process everything in one shot. Your converted files stay organized and ready to @-reference whenever you need them.

0 comments
21 views

Permalink