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

Exploring an insurance use case with AI and Node.js

February 7, 2025
Lucas Holmquist
Related topics:
Artificial intelligenceNode.jsRuntimes
Related products:
Red Hat build of Node.js

    Welcome back to this ongoing series of posts about using Large Language Models(LLMs) with Node.js.  This post will serve as the conclusion as we see how all the previous posts come  together to illustrate how AI can be integrated into an existing Claims Management System for an insurance company

    Before we start, here is what the series looks like up to this point:

    Experimenting with a Large Language Model powered Chatbot with Node.js | Red Hat Developer

    Experimenting with Email generation and summarization with Node.js and Large Language Models | Red Hat Developer

    Improving Chatbot result with Retrieval Augmented Generation (RAG) and Node.js | Red Hat Developer

    Chatbot, I Choose You….. to call a function

    Application Overview Review

    The application that was used to demonstrate all the features was a very basic claims management system. It is similar to something that an insurance company might use to process their insured's claims.

    Parasol Insurance Application

     

    The application front-end was written in react and the backend in node.js, using the Fastify framework for the REST apis and langchain.js as the interface between the application and the Large Language Models(LLMs)

    Adding a chatbot

    As mentioned in the first post, a chatbot was constructed for users of the application to ask it questions about the claims to better service their customers.  The user could ask something like: “What happened here?” and the chat bot would give a succinct summary of this claim.

    Throughout that post, we explored some of the basic building blocks when writing AI applications.  Some of those concepts were about connecting to models, constructing prompts and creating chains.    We also added the ability for the chatbot to store the message history using methods from the lanchain.js framework.  This added to the chatbot's ability to have a more natural conversation as well as having some context of previous questions asked.

    Email Generation and Output Parsers 

    The next post in the series had us adding the ability to generate email summaries that could potentially be sent out to a customer.  However, generating summaries wasn’t just the main concept of this post.  

    We learned how we could leverage the use of output parsers to have our response from the LLM to be formatted a certain way.  Our Web UI wanted our response to be in JSON and by leveraging langchain.js’s output parsers, as well as defining a schema to send to our model using the popular Zod schema framework, we were able to output the format we wanted.

    Retrieval Augmented Generation

    In the third post, we expanded our chatbot with extra knowledge without having to retrain the model it was using.  This concept is called Retrieval Augmented Generation or RAG.  Each insured might have different information in their policies and retraining models can be expensive.  Policy data is also very sensitvie, so storing that information in a model might not be possible.  So being able to add some more context based on some external resource can be very handy.

    As the article stated, there are two main concepts of RAG, Indexing and Retrieval, and we saw how each of those concepts could be added to our chatbot code to give it a little more context when answering questions.

    In the example, we wanted the chatbot to be able to answer questions from an insurance policy that was in a pdf.  We saw that by using the langchain.js framework, we could easily load the pdf.  We used an in-memory vector store to index it.  Then a retriever was created that could easily be added to our current chain.

    Tools/Functions

    The last post in the series gave a brief overview of the concept of having our LLM call a function when responding to a request.

    The chatbot was updated so when a user said something like “Update this claims status to approved”, our LLM would parse that request, see that we’ve created a function called “UpdateClaimStatus” and would call that.  This function would then update that claims’ status in the database.

    Conclusion

    While the claims management system we added the chatbot and other features to was fictitious, it illustrates a real world scenario of how a small amount of code can add some powerful AI features to aid in day-to-day scenarios.

    As always if you want to learn more about what the Red Hat Node.js team is up to check these out:

    https://developers.redhat.com/topics/nodejs

    https://developers.redhat.com/topics/nodejs/ai

    https://developers.redhat.com/blog/2024/11/20/essential-ai-tutorials-nodejs-developers

    https://github.com/nodeshift/nodejs-reference-architecture

    https://developers.redhat.com/e-books/developers-guide-nodejs-reference-architecture

     

    Last updated: February 10, 2025
    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

    • Protect data offloaded to GPU-accelerated environments with OpenShift sandboxed containers

    • Case study: Measuring energy efficiency on the x64 platform

    • How to prevent AI inference stack silent failures

    • Preventing GPU waste: A guide to JIT checkpointing with Kubeflow Trainer on OpenShift AI

    • How to manage TLS certificates used by OpenShift GitOps operator

    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.