A step-by-step guide to building an AI-powered document processing system using Apache Camel, IBM Docling, and LangChain4j in Java. The tutorial covers converting PDF documents to Markdown via a Docling server running in Docker, orchestrating the workflow with Camel routes, sending the structured content to an OpenAI-compatible LLM through LangChain4j, and exposing an interactive Q&A HTTP API using an embedded Undertow server. Key patterns include caching the converted Markdown to avoid repeated conversions and using Camel's pollEnrich EIP to reuse preprocessed documents per request.
Table of contents
1. Overview2. Problem Statement3. Project Setup4. Converting a PDF Document to Markdown5. Passing the Markdown Document to LangChain4j6. Interactive Q&A API7. Conclusion2.8K Impressions