Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

AI-driven data extraction using Apache Camel and LangChain4J

September 5, 2024
Alexandre Gallice
Related topics:
Artificial intelligenceIntegrationJavaQuarkus
Related products:
Red Hat build of Apache CamelRed Hat build of Quarkus

    Always curious about the kind of challenges information technology companies are facing, I noticed a trend about unstructured data related topic these days. Explaining in details the differences between structured and unstructured data is beyond the scope of this blog post. Basically, examples of structured data could be dates, addresses and credit card numbers while unstructured data examples are more like natural language texts, videos and social media posts. Exploiting the value of unstructured data is a huge topic. And actually, explaining all the possibilities and limitations would take time. For the sake of brevity, let's just remind that large part of today's data is unstructured, the volume is growing quickly and companies are struggling to deal with it.

    As a contributor to the Red Hat Build of Apache Camel, I decided to experiment with Quarkus LangChain4j to extract such a structured information from raw text. Let's imagine a situation where an insurance company records the transcript of the discussion between customers and hotline. With Red Hat Build of Apache Camel, we could consume the conversation transcripts as raw text data from a lot of different systems. But how could we extract information like the customer name and birth date from the conversation transcripts to later store them in let's say a relational database? Is it possible at all anyway?

    AI-driven unstructured data extraction integration flow

    So, in search of answers, I started to build a prototype as shown in the schema above. In input, we have a raw text conversation between an operator and a customer. This conversation is injected inside a large language model prompt through the use of a LangChain4j AI service as demonstrated here. Then, the large language model answers with a JSON document containing the extracted customer satisfaction, name, birthday and also a short summary of the input conversation. As a last step, LangChain4j transforms this JSON document into a Java object.

    Building this prototype was a good opportunity to learn. After an initial period of infancy, I eventually realized that explicitly configuring the model to output JSON only responses was paramount. Step by step, I had success in extracting structured information from 3 conversations transcripts with a 7 billion parameter model. It takes quite some time for the model to give answers as I don't have any dedicated graphical processor units on hand to speed up computation. Still, I was able to create a Camel Quarkus community example where you can find all technical details.

    Now, beyond a simple proof of concept, it would be interesting to see what it takes to implement a true business like scenario. From previous experience in a handwriting recognition company, I would say that the key is to check whether the extraction accuracy is high enough to trigger return on investment. As such, it would be interesting to see what accuracy could be achieved by changing the model, using a 30 billion parameter model or improving the prompt for instance. For such an experience to be realistic, it would need at least a set of 100 conversations with expected output, plus some graphical processing units compute power. Anyone interested?

    If yes, I would propose my readers to review the unstructured data they have at disposal and imagine the value that could be derived from it. Anyone having an interest could then play with the community example. And there is a good news here for Red Hat customers entitled to use the last supported version of Red Hat Build of Apache Camel Quarkus. Indeed, you don't need to migrate to the latest upstream version and can experiment data extraction straight away with the Red Hat version.

    I've tested this setup at this commit level with Openjdk 21 and Apache Maven 3.9.6. You simply need to amend the pom.xml file with the setup below:

    <properties>
     <quarkus.platform.version>3.8.5.SP1-redhat-00001</quarkus.platform.version>
     <camel-quarkus.platform.version>3.8.5.SP1-redhat-00001</camel-quarkus.platform.version>
     <quarkus.platform.group-id>com.redhat.quarkus.platform</quarkus.platform.group-id>
     <camel-quarkus.platform.group-id>${quarkus.platform.group-id}</camel-quarkus.platform.group-id>
     <camel-quarkus.platform.artifact-id>quarkus-camel-bom</camel-quarkus.platform.artifact-id>
    </properties>
    
    <pluginRepositories>
     <pluginRepository>
      <id>redhat-ga</id>
      <url>https://maven.repository.redhat.com/ga</url>
     </pluginRepository>
    </pluginRepositories>
    <repositories>
     <repository>
      <id>redhat-ga</id>
      <url>https://maven.repository.redhat.com/ga</url>
     </repository>
    </repositories>

    Of course, Quarkus LangChain4j is not supported yet, still it's possible to experiment and contact Red Hat in case of interest.

    That's it for today. So far, I hope we have learned a bit about unstructured data and seen a prototype in action. Maybe it would give ideas for people to experiment data extraction with true business data.

    Last updated: September 9, 2024
    Disclaimer: Please note the content in this blog post has not been thoroughly reviewed by the Red Hat Developer editorial team. Any opinions expressed in this post are the author's own and do not necessarily reflect the policies or positions of Red Hat.

    Recent Posts

    • Every layer counts: Defense in depth for AI agents with Red Hat AI

    • Fun in the RUN instruction: Why container builds with distroless images can surprise you

    • Trusted software factory: Building trust in the agentic AI era

    • Build a zero trust AI pipeline with OpenShift and RHEL CVMs

    • Red Hat Hardened Images: Top 5 benefits for software developers

    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Chat Support

    Please log in with your Red Hat account to access chat support.