---
title: "Build an AI matching engine with Docling, Granite & OpenShift AI"
description: "PeopleMesh uses Docling and Granite4:3B LLM on Red Hat OpenShift to extract structured data from PDF resumes and match people across multiple dimensions. Docling converts documents into a DoclingDocument with semantic labels using an AI model trained on 150,000 annotated samples to recover reading order from PDF’s print-oriented encoding, then exports to Markdown for LLM-driven JSON extraction via a system prompt. For matching, PeopleMesh decomposes a user query with an LLM to extract intent, entity type, country, and language, then applies structured filtering followed by semantic vector search via cosine similarity on distilled query embeddings. To mitigate embedding dilution from concatenated concepts, PeopleMesh uses a weighted scoring algorithm that reranks top 100 candidates using 7 information channels including nice-to-have skills and penalty multipliers for missing must-have and negative skills. The scoring provides relative ordering only, not normalized probabilities, and default weights are adjustable via the SearchOptions Java record."
---

# Build an AI matching engine with Docling, Granite & OpenShift AI

[Red Hat](https://yomu.fyi/company/red-hat) · Peter Samouelian, Swati Kale, Francesco Pace · Oct 12, 2026

**Type:** Tutorial

## Summary

PeopleMesh uses Docling and Granite4:3B LLM on Red Hat OpenShift to extract structured data from PDF resumes and match people across multiple dimensions. Docling converts documents into a DoclingDocument with semantic labels using an AI model trained on 150,000 annotated samples to recover reading order from PDF’s print-oriented encoding, then exports to Markdown for LLM-driven JSON extraction via a system prompt. For matching, PeopleMesh decomposes a user query with an LLM to extract intent, entity type, country, and language, then applies structured filtering followed by semantic vector search via cosine similarity on distilled query embeddings. To mitigate embedding dilution from concatenated concepts, PeopleMesh uses a weighted scoring algorithm that reranks top 100 candidates using 7 information channels including nice-to-have skills and penalty multipliers for missing must-have and negative skills. The scoring provides relative ordering only, not normalized probabilities, and default weights are adjustable via the SearchOptions Java record.

## Context

Organizations often rely on chance encounters for connecting people with the right skills, leading to missed opportunities. This post presents PeopleMesh, an AI matching engine deployed on Red Hat OpenShift that uses Docling for resume parsing and Granite LLMs for extraction and matching.

## Approach / What changed

PeopleMesh implements a multi-step pipeline: Docling converts PDF resumes to a DoclingDocument with AI layout analysis, exports to Markdown, then Granite4:3B LLM extracts structured JSON via a system prompt. For matching, queries are decomposed by an LLM into intent, entity type, country, and language; then hybrid search combines traditional filtering with vector embedding cosine similarity, followed by a weighted scoring algorithm with 7 channels and penalty multipliers for missing must-have and negative skills.

## Takeaways

- Docling recovers reading order from PDFs by using an AI model trained on 150K samples to identify bounding boxes and semantic labels, then maps PDF Tm coordinates to these boxes.
- PeopleMesh mitigates embedding dilution through a weighted scoring algorithm that combines cosine similarity with 7 additional information channels and penalty multipliers rather than chunking inputs.
- The matching pipeline first decomposes a user query using an LLM to extract intent, entity type, country, and language, then applies structured filtering before semantic vector search.

## FAQ

### How does Docling handle PDFs that don't preserve reading order?

Docling uses an AI model trained on 150,000 annotated samples to identify layout bounding boxes and semantic labels. It then maps the PDF's Tm coordinates (print cursor positions) to these bounding boxes to recover the correct text order.

### Can the matching weights be customized?

Yes, all weights in the scoring algorithm can be overridden by modifying the SearchOptions Java record. The default weights are notional and likely need adjustment for different use cases and datasets.

**Tags:** [Docling](https://yomu.fyi/topic/docling), [Granite](https://yomu.fyi/topic/granite), [Matching Engine](https://yomu.fyi/topic/matching-engine), [OpenShift AI](https://yomu.fyi/topic/openshift-ai)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/10/12/build-ai-matching-engine-docling-granite-openshift-ai)
- Source URL: https://developers.redhat.com/articles/2026/10/12/build-ai-matching-engine-docling-granite-openshift-ai
- Ingested by Yomu: 2026-10-12T15:00:14.424Z

[Read original post](https://developers.redhat.com/articles/2026/10/12/build-ai-matching-engine-docling-granite-openshift-ai)
