Resources

OpenShift Credentials

  • username: username
  • password: user-password

Dev Spaces

Developer Console

Matrix

Rocket.Chat

BGCreated with Sketch.

Tasks to complete

Get Started
BGCreated with Sketch.

Congratulations!

Return to the dashboard to continue your journey.

Go to home

Developing the AI assistant

Open the Camel route

In your editor’s file explorer, click on the following file — Kaoto will automatically open it and render the route as a visual diagram.

📁 workshop
  📁 lab
    📁 agent
 !   agent.camel.yaml

New to Kaoto?

Most of the processing flows you’ll edit during this workshop use Kaoto, the visual integration designer for Apache Camel. Kaoto is a VS Code extension that renders Camel definitions graphically so you can design and configure routes without editing YAML by hand.

vs code kaoto

Among other tasks, Kaoto helps you to:

  • Create Camel routes (the primary way to define processing flows)

  • Create Kamelets (reusable building blocks for your routes)

  • Create data transformations

  • Apply EIPs (Enterprise Integration Patterns)


Here’s what the Kaoto canvas looks like — each step in the route is rendered as a visual node that you can click to configure:

kaoto overview
The Kaoto extension is already pre-installed in your Dev Spaces environment.

Kaoto will open the file and display all the route definitions it contains. The file includes several routes, but the one we want to focus on is the main agentic flow. Do as follows:

  1. Click the Routes dropdown in the upper-left toolbar

  2. Select rocketchat-to-agent from the list


    kaoto routes dropdown

kaoto-routes-m4

{x: 24, y: 24, rot: 210, size: .8} {x: 30, y: 63, rot: 230, size: .8}

{x: 33, y: -8, size: 1.5} {x: 45, y: 39, size: 1.5}


To center the route in the canvas, click the Reset View button at the bottom:

kaoto reset view
Use the mouse wheel to zoom in and out of the canvas, and click and drag to pan around the view.


You should now see the route you’ll be working with — the starting point for the customer support flow:

kaoto agent route

kaoto-agent-route

{x: 35.5, y: 72, rot: 0, size: 1, color: "red"} {x: 52.5, y: 72, rot: 0, size: 1, color: "red"}

{x: 35.5, y: 117, size: 1.2, color: "red"} {x: 52.5, y: 117, size: 1.2, color: "red"}


Reading left to right, the route listens for messages from Rocket.Chat and extracts the text — but the flow is incomplete. The set system prompt step is disabled, and the To do: Agent block contains only a dummy response that returns "Hello World" regardless of what the user says.

Throughout this exercise, you’ll be guided to complete this flow step by step:

1 You’ll enable the set system prompt step — this will instruct the AI agent how to behave
2 You’ll replace the Dummy response with a MaaS-powered AI agent, and progressively equip it with tools to handle real customer requests


Start the dev loop

From this point on, you’ll work in a rapid development cycle — Camel JBang runs in dev mode, which means every change you make to the route is instantly picked up and applied. You can modify the flow, save the file, and immediately observe the new behaviour without restarting.

Start by running the Camel route as-is to see the placeholder behaviour in action:

camel run agent --dev

What does this command do?
  • camel run agent — loads the resources under the agent directory and runs the route defined inside it.

  • --dev — dev mode, automatically reloads when you save changes to any source file.

Wait for Camel to fully start — you should see …​(agent) started…​ in the terminal.

Switch to your Rocket.Chat window.

If you haven’t logged in yet, follow the Rocket.Chat platform onboarding instructions (opens in a new tab).

In the left sidebar, find and select the ai-support channel that matches your user identifier:

A ⌗ ai-support

Then type a simple message:

Hi

The Camel bot picks up the message and responds with Hello World — confirming the route is working end to end:

rocket.chat
U
username 5:05 PM
Hi
A
ai-bot 5:05 PM
Hello World

This is expected — the route is still using the hardcoded dummy response. In the next steps, you’ll replace it with a real AI agent that can reason and respond naturally.


Wire the AI agent

Now replace the dummy response with a real AI agent. Head back to the Kaoto canvas and follow the steps below:


  1. Enable the system prompt

    The set system prompt step is currently disabled — it’s greyed out because there was no AI agent to use it.

    Enable it:
    kaoto enable step

    kaoto-enable-step

    {x: 92, y: 11, size: 3}

    {x: 82.5, y: 75, rot: 0, size: .8}

    1. Hover the step and click the button.

  2. Replace the dummy response with an Agent

    The Dummy response step is a placeholder — it always returns "Hello World". Replace it with the LangChain4j Agent component that connects to MaaS.

    1. Hover the Dummy response step and click the floating     button.

    2. Type lang in the 🔍 Filter to find the LangChain4j Agent component, then select it.

    3. Click the LangChain4j Agent step to open the configuration panel.

    4. Select the Required configuration tab.

    5. Set the Agent Id to:

      myagent

      kaoto agent steps


      Because you’re running in dev mode, Camel hot-reloads automatically. Watch the terminal — the logs should confirm the agent is running:

      2026-03-24 18:14:11.113  INFO camel.support.RouteWatcherReloadStrategy : Routes reloaded summary (total:2 started:2)
      2026-03-24 18:14:11.115  INFO camel.support.RouteWatcherReloadStrategy :     Started rocketchat-to-agent (platform-http:///ai-support)
      2026-03-24 18:14:11.116  INFO camel.support.RouteWatcherReloadStrategy :     Started to-rocketchat (direct://to-rocketchat)


  3. Check the updated flow

    The system prompt is now active (1) and the AI agent has replaced (2) the dummy response. Your route should look like this:

    kaoto agent route complete

    kaoto-agent-route-complete

    {x: 35.5, y: 72, rot: 0, size: 1, color: "red"} {x: 52.5, y: 72, rot: 0, size: 1, color: "red"}

    {x: 35.5, y: 117, size: 1.2, color: "red"} {x: 52.5, y: 117, size: 1.2, color: "red"}


  4. Interact with the agent

    Switch back to your Rocket.Chat window and type:

    Hi again

    The AI agent processes your message — it sends it to the LLM via MaaS, which reasons about it and returns a natural language response. You should see something like:

    rocket.chat
    U
    username 5:06 PM
    Hi again
    A
    ai-bot 5:06 PM
    Hello! How can I assist you today?


    The bot is responding, but can it do real work?
    Not yet. The MCP servers and tools exist in the exercise but are not active yet.

    Try asking for something specific:

    Can you show me policy document 61356291

    Your lab comes with a sample policy document (61356291) ready to use. This is the one referenced in the command above.
    You can also try fetching policy documents you generated during the Ingestion lab — feel free to use any policy document number from your earlier exercises.


    The bot responds with something like:

    rocket.chat
    U
    username 5:07 PM
    Can you show me policy document 61356291
    A
    ai-bot 5:07 PM
    I'm sorry, I don't have the capability to retrieve that PDF right now.

    As expected, the bot declines the request.

    Why did the bot respond that way?

    The AI agent doesn’t have access to the tools it needs — the MCP servers haven’t been wired in yet.

    The system.message file contains the system prompt that guides the AI agent’s behaviour. One of its rules explicitly instructs the model to decline when it lacks the right tool:

    # CRITICAL CONSTRAINTS
    * **NO TOOL, NO URL:** If there is no tool fit for the job (missing),
      you MUST return Pattern 2 with the text: "I'm sorry, I don't have
      the capability to retrieve that PDF right now."

    Once you register the tools, the agent will discover and use them automatically.


Wire in the MCP servers

The project includes MCP servers to provide the necessary tools for the Camel agentic flow — but the agent doesn’t know about them yet. You need to wire them in to the agentic flow.

The diagram below shows how the Agentic Integration (once MCP is active) routes tool calls from the AI model. Two MCP servers provide distinct toolsets — Node.js and Camel Quarkus. When the AI model needs a tool, the Agentic Integration routes the request to the appropriate MCP server, which executes the tool against the backend systems and returns the result.

flowchart LR

    MaaS <-->|Tool calls| INTLabel

    INTLabel <--> |"Toolset 1"| NodeJSLabel
    INTLabel <--> |"Toolset 2"| CamelQuarkusLabel
    NodeJSLabel --> |"Integrations"| ToolsInner
    CamelQuarkusLabel --> |"Integrations"| ToolsInner

    INTLabel[⚙️ <span style='font-weight:bold;font-size:1.2em;color: #EE0000'>Agentic Integration\n</span><p style='margin-top:5px'/><div style='border: solid 1px red; padding: 10px;background-color: #fce4e4'><div style='padding: 5px 0px 5px 25px;text-align:left;color: black;'>• AI reasoning<br>• Tool calling<br>• Integrations</div></div>\n]

    subgraph ToolsLabel ["<br><br><br>Backend Systems&nbsp;"]
        subgraph ToolsInner [" "]
            direction LR
            DB ~~~ S3 ~~~ HD
        end
    end

    subgraph NodeJSLabel [" "]
        NodeJS
    end

  subgraph CamelQuarkusLabel [" "]
        CamelQuarkus
    end

    MaaS@{ img: "../../_images/module-03/common/ai-model-icon.svg", label: "AI Model", pos: "b", h: 80, w: 80, constraint: "on" }
    NodeJS@{ img: "../../_images/module-03/common/nodejs-icon.svg", label: "MCP NodeJS", pos: "b", h: 80, w: 80, constraint: "on" }
    CamelQuarkus@{ img: "../../_images/module-03/common/camel-quarkus-icon.svg", label: "MCP Camel Quarkus", pos: "b", h: 80, w: 80, constraint: "on" }
    DB@{ img: "../../_images/module-03/common/database-icon.svg", label: "Database", pos: "b", h: 70, w: 70, constraint: "on" }
    S3@{ img: "../../_images/module-03/common/s3-icon.svg", label: "S3 / ODF", pos: "b", h: 70, w: 70, constraint: "on" }
    HD@{ img: "../../_images/module-03/common/helpdesk-icon.svg", label: "HelpDesk", pos: "b", h: 70, w: 70, constraint: "on" }

    style MaaS fill:none,stroke:none
    style NodeJS fill:none,stroke:none
    style CamelQuarkus fill:none,stroke:none
    style DB fill:none,stroke:none
    style S3 fill:none,stroke:none
    style HD fill:none,stroke:none
    style INTLabel fill:none,stroke:none
    style NodeJSLabel fill:none,stroke:none
    style CamelQuarkusLabel fill:none,stroke:none
    style ToolsLabel fill:none,stroke:none,color:#EE0000,font-weight:bold
    style ToolsInner fill:#fce4e4,stroke:#EE0000
The Agentic Integration can work with MCP servers implemented in different languages. This lab includes a Node.js MCP server and a Camel Quarkus MCP server — each providing distinct tools to the AI model.

In Camel you don’t need MCP servers to define tools. You can define them directly as regular routes that starts with the langchain4j-tools component. The route describes what the tool does — the agent discovers it automatically via tags and invokes it when needed.

For example, this is how you would define a local tool that retrieves the PDF URL for a given policy document:

kaoto tool route

The route starts with the langchain4j-tools source, processes the request through a series of steps, and returns the result to the LLM. No special wiring is needed. Camel uses tags to match agents with tools — when an agent’s tag matches a tool’s tag, the agent can call that tool.


  1. Wire in the MCP servers (Node.js and Camel Quarkus)

    1. Stop the process running in your terminal with CTRL+C.

    2. Open your agent’s configuration file file.

        📁 lab
          📁 agent
       ⚙   application.properties

    3. Uncomment the properties for the MCP servers. You should see this:

      # MCP server (Node JS)
      camel.component.langchain4j-agent.mcpServer[nodejs.transportType]=http
      camel.component.langchain4j-agent.mcpServer[nodejs.url]=http://localhost:9090/mcp
      
      # MCP server (Camel MCP)
      camel.component.langchain4j-agent.mcpServer[camel.transportType]=http
      camel.component.langchain4j-agent.mcpServer[camel.url]=http://localhost:9091/mcp

    4. Now, use the mcp script to start the MCP servers, as follows:

      ./mcp start

      You should see the MCP servers starting up in the terminal:

      [INFO] [Node.js] Starting MCP server...
      [INFO] [Node.js] Installing dependencies...
      [INFO] [Node.js] Starting server...
      [INFO] [Node.js] Server started (PID: 89810)
      [INFO] [Node.js] Endpoint: http://localhost:9090/mcp
      
      [INFO] [Camel] Starting MCP server...
      [INFO] [Camel] Starting Camel MCP server...
      Running Camel Main: mcp-camel in background with PID: 89891 (waiting to startup)
      Camel Main: mcp-camel (state: Starting)
      [INFO] [Camel] Server started
      [INFO] [Camel] Endpoint: http://localhost:9091/mcp
      How to monitor the MCP server logs

      You can follow the logs of either MCP server in real-time by passing its name (camel or node) to the logs command:

      ./mcp logs camel -f

      For example, the Camel MCP server logs show the five routes registered as MCP tools:

      ...AbstractCamelContext : Routes startup (total:5 started:5 kamelets:1)
      ...AbstractCamelContext :     Started route1 (ai-tool://amend-policy-document)
      ...AbstractCamelContext :     Started get-policy-document-data (direct://get-policy-document-data)
      ...AbstractCamelContext :     Started route2 (ai-tool://create-ticket)
      ...AbstractCamelContext :     Started store-pdf-s3 (direct://store-pdf-s3)
      ...AbstractCamelContext :     Started route3 (ai-tool://share-ticket)
      ...AbstractCamelContext : Apache Camel 4.22.0 (mcp-camel) started in 6s719ms
      ...
      How do I check if the MCP servers are running?

      You can check the status of the MCP servers at any time by running:

      ./mcp status

      You should see output similar to:

      [INFO] Checking MCP servers status...
      
      [INFO] [Node.js] Server is RUNNING (PID: 89810)
      [INFO] [Node.js] Endpoint: http://localhost:9090/mcp
      
      [INFO] [Camel] Server is RUNNING (PID: 89867)
      [INFO] [Camel] Endpoint: http://localhost:9091/mcp


  2. Restart the Camel agent

    The MCP servers are now running and your agent is configured.
    Restart it to pick up the new configuration:

    camel run agent


  3. Try it out

    Go back to Rocket.Chat and ask again:

    Can you show me policy document 61356291

    What if the AI still says it can’t help?

    The workshop uses a small LLM that can be inconsistent. The system prompt tells it to re-evaluate its tools before responding, but sometimes it replies as if no tools are available, for example:

    rocket.chat
    U
    username 5:10 PM
    Can you show me policy document 61356291
    A
    ai-bot 5:10 PM
    I'm sorry, I don't have the capability to retrieve that PDF right now.

    If that happens, try one or both of these options:

    1. Send a more specific request:

      Please try again using the tool to get policy documents

      This points the LLM to the right tool, which is usually enough to get it working.

    2. Stop the process with CTRL+C and restart it. A fresh start gives the LLM a clean tool list.

    If all goes well, this time the LLM discovers the tool, calls it, and responds with the policy document:

    rocket.chat
    U
    username 6:47 PM
    Can you show me policy document 61356291
    A
    ai-bot 6:47 PM
    Here is the policy document you requested.
    Policy Document 61356291 PDF ▾
    Click to view or download

    The bot identified the right tool, retrieved the policy document, and returned a download link to the support agent. Clicking the link opens the PDF in a new tab.

    See the sample policy document

    Policy no: 61356291
    Date of issue: 09/06/2025

    Insurer:
    Parasol Insurance
    One Parasol Plaza
    Atlanta, GA 30313

    Tax Id: 843-56-1234
    IBAN: GB50ACIE59715038217063
    Policyholder:
    Alex Morgan
    742 Maple Avenue
    Austin, TX 78701

    Tax Id: 949-84-9105
    COVERAGE DETAILS
    No. Description UM Net price Net worth VAT [%] Gross worth
    1. Personal Liability – Standard Plan | Bodily injury & property damage | Limit: $100,000/occurrence mo. 28,99 28,99 10% 31,89
    2. Property Damage | Third-party property damage caused by insured | Limit: $50,000 | Deductible: $500 mo. 34,50 34,50 10% 37,95
    3. Medical Payments | No-fault medical expenses for injured parties | Limit: $5,000 per person mo. 18,00 18,00 10% 19,80
    4. Roadside Assistance | 24/7 towing, jump-start & lockout service | Up to 50 miles per incident mo. 12,00 12,00 10% 13,20
    SUMMARY
    VAT [%] Net worth VAT Gross worth
    10% 93,49 9,35 102,84
    Total $ 93,49 $ 9,35 $ 102,84


Amend the policy document

The ai-bot can do more than just retrieve data — it can act on it. Imagine the customer has changed their mind and wants to remove a coverage item. Ask the AI assistant to amend the policy document:

The customer would like to remove the Roadside Assistance coverage, could you please adjust the policy document?

The agentic system inspects the policy document, identifies the matching coverage item, triggers the necessary tools to update the database, and responds with a summary of the changes:

rocket.chat
U
username 6:49 PM
The customer would like to remove the Roadside Assistance coverage, could you please adjust the policy document?
A
ai-bot 6:49 PM
The database records have been updated. The Roadside Assistance coverage (Item 4) has been removed, and the summary values have been recalculated. Would you like to see the new policy document?

The agentic system acted autonomously — it inspected the policy document, identified the coverage item, updated the record in the database, recalculated the totals, and confirmed the changes. All from a single natural language request.

Notice the bot’s response — it may suggest viewing the updated policy document (LLMs are unpredictable, so the exact wording varies). If it does, simply reply yes. If it doesn’t, ask to see the amended policy document:

Can you show me the updated policy document?

Either way, the bot responds with the updated PDF link:

rocket.chat
A
ai-bot 6:50 PM
Here is the updated PDF for Policy Document 61356291.
Policy Document 61356291 PDF ▾
Click to view or download

Click the link to open the regenerated policy document.

See a sample of the amended policy document

Amended
Policy no: 61356291
Date of issue: 09/06/2025

Insurer:
Parasol Insurance
One Parasol Plaza
Atlanta, GA 30313

Tax Id: 843-56-1234
IBAN: GB50ACIE59715038217063
Policyholder:
Alex Morgan
742 Maple Avenue
Austin, TX 78701

Tax Id: 949-84-9105
COVERAGE DETAILS
No. Description UM Net price Net worth VAT [%] Gross worth
1. Personal Liability – Standard Plan | Bodily injury & property damage | Limit: $100,000/occurrence mo. 28,99 28,99 10% 31,89
2. Property Damage | Third-party property damage caused by insured | Limit: $50,000 | Deductible: $500 mo. 34,50 34,50 10% 37,95
3. Medical Payments | No-fault medical expenses for injured parties | Limit: $5,000 per person mo. 18,00 18,00 10% 19,80
SUMMARY
VAT [%] Net worth VAT Gross worth
10% 81,49 8,15 89,64
Total $ 81,49 $ 8,15 $ 89,64
Notice the red Amended tag in the upper-right corner of the document — this indicates the policy document has been modified from the original.

Inspect the document and verify the modifications are correct — the Roadside Assistance coverage (item 4) should be removed, and the totals recalculated accordingly.


Raise a ticket

A customer support process rarely ends with a single action. Amending a policy involves multiple departments — confirming the changes, processing any refund, updating the policy records, notifying the customer. Rather than handling each step manually, ask the AI agent to raise a ticket that coordinates everything:

Could you please raise a ticket? Include the details explained, and ask the right departments to process the policy amendment accordingly.

The agentic system gathers the context from the conversation, creates a ticket in the HelpDesk system, and responds with a confirmation:

rocket.chat
U
username 6:52 PM
Could you please raise a ticket? Include the details explained, and ask the right departments to refund the customer accordingly.
A
ai-bot 6:52 PM
A ticket has been created with ID 1025. Would you like to share this ticket with the customer?


Before going any further, make sure you have already onboarded to Matrix and accepted the room invitation — the ticket will be shared with the customer there. Remember, Matrix represents the customer side, while Rocket.Chat is where the support agent works. If you haven’t done this yet, follow the Matrix platform onboarding instructions.

The interaction above illustrates a simple request and response — but because LLMs are non-deterministic, the bot may have responded differently. Here’s what to expect and how to handle each case:

  • The bot asks to share the ticket (as shown above) — reply with:

    Yes, please share it with the customer.

  • The bot doesn’t mention sharing at all — ask it explicitly:

    Could you share the ticket with the customer?

  • The bot shares the ticket automatically without asking — no action needed, skip ahead.


Either way, the final outcome is the same — the bot shares the ticket and the customer receives a link to the HelpDesk system:

rocket.chat
U
username 6:53 PM
Yes, please share it with the customer.
A
ai-bot 6:53 PM
The ticket #1025 has been successfully shared with the customer. They will receive a link to the HelpDesk system.

Remember — the customer communicates from the Matrix messaging platform. The bot indicated the ticket was shared, which means the customer should have received a message with the ticket reference. Switch to your Matrix window and check.

You should see a message like this:

matrix
U
username
11:05 ai@rocketchat:
📄 Ticket #1025 created.
(Click to open in HelpDesk)


Verify the ticket from the customer’s perspective

Now put yourself in the customer’s shoes. The customer received a message in Matrix with a link to the Parasol HelpDesk ticketing system. Click the ticket link in the Matrix window.

A new tab opens with the Parasol HelpDesk login page:

PARASOL
HELPDESK
Username
 
Password
 
LOGIN

Log in using the credentials below:

  • Username:

    username

  • Password:

    /credentials/im

    password

    REPLACE


Once logged in, the Parasol HelpDesk displays the list of open tickets. You should see the ticket the AI agent just created:

PARASOL
HELPDESK
Tickets
Status
#
Subject
Created
Requester
N
1025
Policy Amendment for Policy Document 61356291
03/28/2026
username

Click the ticket to inspect its details. The AI agent composed the ticket body from the conversation — it includes a summary of the changes and a link to the updated policy document:

Policy Amendment for Policy Document 61356291
username <username@parasol.com>
Mar 28, 2026, 07:05am
A policy amendment has been made to remove Roadside Assistance coverage from the policy document. Please process the amendment accordingly.

The full circle is complete: the AI assistant retrieved a policy document, amended it, raised a ticket with all the relevant details, and shared it with the customer across messaging platforms. All from natural conversation.

When you’re done, press Ctrl+C in the terminal to stop Camel.


Can you see the ticket details and the link to the updated policy document in the Parasol HelpDesk?

Well done — you’ve built an agentic flow that can retrieve, reason about, and modify data, raise tickets, and coordinate across departments through natural conversation.

Review your steps — make sure the agentic flow has tools enabled (Tags = all) and the system prompt is active. Check the Matrix window for the correct room.